Failed to build Dockerfile.devel with error -Werror=maybe-uninitialized - c++

I am building tensorflow-server from source code, refer to doc, but it was failed.
My environment:
Linux 3.10.0-1062.12.1.el7.x86_64
Docker 19.03.8
Build command:
docker build --pull -t $USER/tensorflow-serving-devel -f tensorflow_serving/tools/docker/Dockerfile.devel
Error output:
ERROR: /root/.cache/bazel/_bazel_root/e53bbb0b0da4e26d24b415310219b953/external/upb/BUILD:57:1: C++ compilation of rule '#upb//:upb' failed (Exit 1)
external/upb/upb/table.c: In function 'upb_inttable_pop':
external/upb/upb/table.c:588:10: error: 'val.val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return val;
^~~
cc1: all warnings being treated as errors
Target //tensorflow_serving/model_servers:tensorflow_model_server failed to build
INFO: Elapsed time: 592.958s, Critical Path: 122.61s
INFO: 3550 processes: 3550 local.
FAILED: Build did NOT complete successfully

I've also faced this error when building latest version of Tensorflow Serving container. Looks like particular bazel version causes the error. I have found discussion under one of recent tensorflow serving updates - https://github.com/tensorflow/serving/commit/162f72949c6ecbe9e610182c923dec0aa5924cf2. I tried workaround suggested there, changing Tensorflow Serving branch from master to r2.1 by passing argument to docker build in such a way --build-arg TF_SERVING_VERSION_GIT_BRANCH=r2.1, it helped.

Related

How to add trix.css when it is removed after pruning?

After pruning with the command "docker system prune -a" nodejs wont build anymore beacuse trix.css is missing. I am assuming this was probably deleted while pruning. How can I resolve this error (see the error below)? Why is it not created again while building the container again since the file is in the docker file.
Required path doesn't exist: /code/bower_components/trix/dist/trix.css trix
[13:57:39] 'vendorcss' errored after 1.63 ms
[13:57:39] Error: Promise rejected without Error
at Domain.onError (/usr/local/lib/node_modules/gulp/node_modules/async-done/index.js:49:15)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at Domain.emit (events.js:211:7)
at Domain._errorHandler (domain.js:134:21)
at process._fatalException (bootstrap_node.js:375:33)
[13:57:39] 'staging' errored after 41 ms
ERROR: Service 'nodejs' failed to build: The command '/bin/sh -c gulp staging' returned a non-
zero code: 1
Usually I use this command : "sudo docker-compose -f docker-compose-staging.yml build nodejs" when I want to build the container again. I am very new to this and would be greatfull for some help.
For me, this was the case:
The issue exists because trix.css was removed in the latest version. It has nothing to do with docker system prune as far as I understand.
You can compare the two versions here: https://github.com/basecamp/trix/compare/1.3.1...v2.0.0
Basically, in order to fix this issue, you need to do
yarn install
yarn build
inside bower_components. This is suggested in the official updated README of the trix repository: https://github.com/basecamp/trix.
Once done with that, you will have trix.css and trix.umd.min.js files for your perusal.

GoogleCloudPlatform Buildpacks failed to build

I haven't changed anything recently in my project, but when I tried to deploy it last, I received this error in the logs: ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects
See the full log here: log-d20114fe-3eeb-4a8d-8926-3a971882894c.txt
This is my requirements.txt:
requirements.txt
It seems like it is an issue with the dependencies for the snowflake-connector-python package, but I am not really sure what would have caused this. I see in the logs:
-- Running cmake for pyarrow
Step #0 - "Buildpack": cmake -DPYTHON_EXECUTABLE=/layers/google.python.runtime/python/bin/python3 -DPython3_EXECUTABLE=/layers/google.python.runtime/python/bin/python3 "" -DPYARROW_BUILD_CUDA=off -DPYARROW_BUILD_FLIGHT=off -DPYARROW_BUILD_GANDIVA=off -DPYARROW_BUILD_DATASET=off -DPYARROW_BUILD_ORC=off -DPYARROW_BUILD_PARQUET=off -DPYARROW_BUILD_PARQUET_ENCRYPTION=off -DPYARROW_BUILD_PLASMA=off -DPYARROW_BUILD_S3=off -DPYARROW_BUILD_HDFS=off -DPYARROW_USE_TENSORFLOW=off -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_BOOST=off -DPYARROW_GENERATE_COVERAGE=off -DPYARROW_BOOST_USE_SHARED=on -DPYARROW_PARQUET_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /tmp/pip-install-w1g_50oc/pyarrow_4a54282bee5f4c3c8399d3428e4134e6
Step #0 - "Buildpack": error: command 'cmake' failed: No such file or directory
This makes me think CMake is the problem, but I tried explicitly adding CMake to my requirements file and had the same result.
I also looked at the last successful build, and it looks like I was running python version 3.10.8, and the one that failed first was running 3.11. How can I change what python version cloud build uses? I am using the cloudbuild.yaml file instead of docker.
Figured it out! The issue was with not specifying a version in Cloud Build for Python, so it was defaulting to 3.11, which does not yet have support for pyarrow. I ended up setting the version in the cloud build yaml file to 3.10.8 like so:
steps:
- name: gcr.io/k8s-skaffold/pack
env:
- GOOGLE_ENTRYPOINT=$_ENTRYPOINT
- GOOGLE_RUNTIME_VERSION=$_RUNTIME_VERSION
args:
- build
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
- '--builder=gcr.io/buildpacks/builder:v1'
- '--network=cloudbuild'
- '--path=.'
- '--env=GOOGLE_ENTRYPOINT'
- '--env=GOOGLE_RUNTIME_VERSION'
For those of you who are using a Procfile
I was able to fix by creating a .python-version file that contains just the version number needed,
i.e. 3.10.4

Google certificate-transparency build error: `configure: error: cannot find install-sh, install.sh, or shtool`

I got this error from the gclient sync --disable-syntax-validation command while building Google's certificate-transparency:
configure: error: cannot find install-sh, install.sh, or shtool
in spite of the fact that shtool was in fact installed.
Although I did have shtool installed, I must have installed it after I had run the configuration command (gclient config --name="certificate-transparency" https://github.com/google/certificate-transparency.git).
I deleted the ct directory (i.e. all the source code downloaded from github), reran the config command and gclient sync --disable-syntax-validation and this time did not experience the error.

Tensorflow C++ API example line ending?

I have a problem running the standard C++ API example:
https://www.tensorflow.org/api_guides/cc/guide
I created all the files and directories. Bazel then throws an error after being started.
INFO: From Compiling external/snappy/snappy-sinksource.cc [for host]:
cc1plus: warning: command line option '-Wno-implicit-function-declaration' is valid for C/ObjC but not for C++
ERROR: /home/[...]/tensorflow/tensorflow/core/BUILD:1796:1: Executing genrule //tensorflow/core:version_info_gen failed (Exit 127): bash failed: error executing command
(cd /home/[...]/.cache/bazel/_bazel_[...]/[...]/org_tensorflow && \
exec env - \
LD_LIBRARY_PATH=/opt/ros/lunar/lib \
PATH=/opt/ros/lunar/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; tensorflow/tools/git/gen_git_source.py --generate external/local_config_git/gen/spec.json external/local_config_git/gen/head external/local_config_git/gen/branch_ref "bazel-out/host/genfiles/tensorflow/core/util/version_info.cc"')
/usr/bin/env: 'python\r': No such file or directory
Target //tensorflow/cc/example:example failed to build
INFO: Elapsed time: 2.329s, Critical Path: 0.57s
FAILED: Build did NOT complete successfully
ERROR: Build failed. Not running target
My system is running Debian. It looks like there is an issue with the line ending, but I could not really find anything. Shouldn't work the examples under Linux systems by default?
Or did I misconfigure bazel somehow?
After running dos2unix on all files in the tensorflow directory, compilation works. I think this is really weird. Shouldn't tf be supposed to run out of the box in a Unix system? Anyway, refer
How can I run dos2unix on an entire directory?
to run dos2unix recursively.
I got the same error Build failed. Not running target when trying to follow their guide. For me the problem was solved by explicitly compiling Tensorflow with bazel before compiling and running the example.cc file. I.e. :
./configure
bazel build //tensorflow:libtensorflow_cc.so
bazel run -c opt //tensorflow/cc/example:example

{Yocto} "opkg_install_cmd: Cannot install package <package_name>." Errors

I am working with YOCTO project and running into the problem that made the build progress fail. The failure was at a last task do_rootfs
Below is the error log:
ERROR: Unable to install packages. Command '/home/yocto/Work/skrzg1h_iWg21m_QtHmi/build/tmp/sysroots/x86_64-linux/usr/bin/opkg-cl -f /home/yocto/Work/skrzg1h_iWg21m_QtHmi/build/tmp/work/iwg21m-poky-linux-gnueabi/core-image-weston/1.0-r0/opkg.conf -o /home/yocto/Work/skrzg1h_iWg21m_QtHmi/build/tmp/work/iwg21m-poky-linux-gnueabi/core-image-weston/1.0-r0/rootfs --force_postinstall --prefer-arch-to-version install locale-base-en-us locale-base-en-gb' returned 255:
Unknown package 'locale-base-en-us'.
Unknown package 'locale-base-en-gb'.
Collected errors:
* opkg_install_cmd: Cannot install package locale-base-en-us.
* opkg_install_cmd: Cannot install package locale-base-en-gb.
ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/yocto/Work/skrzg1h_iWg21m_QtHmi/build/tmp/work/iwg21m-poky-linux-gnueabi/core-image-weston/1.0-r0/temp/log.do_rootfs.31252
ERROR: Task 7 (/home/yocto/Work/skrzg1h_iWg21m_QtHmi/build/../poky/meta/recipes-graphics/images/core-image-weston.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 5097 tasks of which 5096 didn't need to be rerun and 1 failed.
No currently running tasks (5096 of 5098)
Summary: 1 task failed:
/home/yocto/Work/skrzg1h_iWg21m_QtHmi/build/../poky/meta/recipes-graphics/images/core-image-weston.bb, do_rootfs
If you guys already run into this problem also, kindly support me how to fix this.
Thanks.