bazel building tensorflow serving error - bazel

I am running a tensorflow serving container referring to this , all the previous steps are good, but in the last block I met some problems:
git clone --recurse-submodules https://github.com/tensorflow/serving
cd serving/
bazel build -c opt tensorflow_serving/...
root#15bb1c2766e3:/serving# bazel build -c opt tensorflow_serving/...
ERROR:
/root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/third_party/clang_toolchain/cc_configure_clang.bzl:3:1:
file '#bazel_tools//tools/cpp:cc_configure.bzl' does not contain
symbol 'cc_autoconf_impl'. ERROR: error loading package '': Extension
file 'third_party/clang_toolchain/cc_configure_clang.bzl' has errors.
ERROR: error loading package '': Extension file
'third_party/clang_toolchain/cc_configure_clang.bzl' has errors. INFO:
Elapsed time: 0.107s ERROR: Couldn't start the build. Unable to run
tests. And in my container, the bazel version is 0.9.0:

I just came across this error. First please check whether your Bazel version is 0.5.4 by typing the command bazel version.
If the bazel version is 0.5.4 you need to upgrade it to 0.12.0 . For updating you could change Dockerfile.devel BAZEL_VERSION to 0.12.0 and re run all the steps.
Or you could update bazel directly in the docker container by
Download bazel--installer-linux-x86_64.sh from
https://github.com/bazelbuild/bazel/releases location
chmod +x ./bazel--installer-linux-x86_64.sh
./bazel--installer-linux-x86_64.sh
I have already answered this on github and it worked. Please refer to the links https://github.com/tensorflow/serving/issues/851 and https://github.com/tensorflow/serving/issues/854

Related

pytest' is not recognized as an internal or external command, while executing through jenkins job

I am trying to run python test through jenkins. I have pytest framework.
I have also installed python 3.8 on jenkins slave machine and set path in the environment variables
I have added below path under PATH section of environment variable as below
C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\Scripts
C:\Users\Admin\AppData\Local\Programs\Python\Python38-32
But still I am getting below error on while running job.
Below are my windows batch command to run from Jenkins:
echo '#### Create Virtual Environment ####'
python -m venv .UIAutomation/venv
echo '#### Activate Virtual Environment ####'
echo '#### Run tests ####'
pytest -s -v --alluredir=.UIAutomation/reports ./UIAutomation/tests --env=staging --browser=chrome
Please help
More details about console error :
warning: manifest_maker: standard file '-c' not found
12:04:12 Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
Note:
Below is my first requirement from file
Collecting psycopg2==2.8.6 (from -r ./UIAutomation/requirements.txt
So after execution I am seeing below error at first line of console-
12:04:12 Error: pg_config executable not found.
12:04:12 pg_config is required to build psycopg2 from source. Please add the directory
From what I see, I find the batch call suspicious.
I think call launches a new console and returns to the script, if its done. So in your case, you activate your venv in another console and then use your standard python env, not the venv and there is no pytest dependency installed.
See also: https://ss64.com/nt/call.html
I had a similiar problem in a yaml script I wrote for Azure DevOps.
I did solve that, with creating the venv and then adding the venv path to the environment variables.

Error compiling Go from source in an Alpine Docker container: "loadinternal: cannot find runtime/cgo"

I'm trying to build an Alpine Docker image for the FIPS-enabled version of Go. To do this, I am trying to build Go from source using the dev.boringcrypto branch of the golang/go repository.
Upon running ./all.bash, I get the following errors:
Step 4/4 : RUN cd go/src && ./all.bash
---> Running in 00db552598f7
Building Go cmd/dist using /usr/lib/go.
# _/go/src/cmd/dist
loadinternal: cannot find runtime/cgo
/usr/lib/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-
alpine-linux-musl/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-
alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lssp_nonshared
collect2: error: ld returned 1 exit status
The command '/bin/bash -c cd go/src && ./all.bash' returned a non-zero code: 2
Which causes the installation tests to fail and kicks me out of the Docker image build.
I have the gcc installed on the image, and tried setting the environment variable CGO_ENABLED=0 as suggested in other questions, but neither of these things seem to alleviate the problem.
I'm at my wits end with this problem. Has anybody else run into similar issues in the past? I don't understand why this is happening, as the build runs fine in an Ubuntu container.
Thanks!
I had the same error messages, although I was compiling a different project.
It turns out that alpine needs to have the musl-dev package installed for this to work, so I think you need to make sure that is included in your Dockerfile, or manually install it by running apk add --no-cache musl-dev.
Either go isn't correctly installed on the image or the GOROOT is wrong
Put go tool dist banner and go tool dist env in your all.bash for clues

/usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1: version `LLVM_4.0' not found

I am trying to run a tool that uses Clang and LLVM. The tool name is cppgrep that is available with the docker. Please find it from the github repository - https://github.com/peter-can-talk/cppnow-2017. I have tried using Ubuntu 16.04 and 17.10, I got the same error as below:
root#522051d201d2:/home# ./cppgrep -help
./cppgrep: /usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1: version `LLVM_4.0' not found (required by ./cppgrep)
./cppgrep: /usr/lib/x86_64-linux-gnu/libclang-4.0.so.1: version `LLVM_4.0' not found (required by ./cppgrep)
root#522051d201d2:/home#
After some online search, I found that I had to setup the environment variable LD_LIBRARY_PATH. So as a first step I found the library files location in the docker, please find the output below:
root#522051d201d2:/home# find / -iname *libclang*.so*
/usr/lib/x86_64-linux-gnu/libclang-4.0.so
/usr/lib/x86_64-linux-gnu/libclang-4.0.so.1
/usr/lib/llvm-4.0/lib/libclang.so.1
/usr/lib/llvm-4.0/lib/libclang-4.0.so
/usr/lib/llvm-4.0/lib/libclang-4.0.0.so
/usr/lib/llvm-4.0/lib/libclang.so
/usr/lib/llvm-4.0/lib/libclang-4.0.so.1
/usr/lib/llvm-4.0/lib/clang/4.0.0/lib/linux/libclang_rt.dyndd-x86_64.so
/usr/lib/llvm-4.0/lib/clang/4.0.0/lib/linux/libclang_rt.asan-i686.so
/usr/lib/llvm-4.0/lib/clang/4.0.0/lib/linux/libclang_rt.asan-x86_64.so
/usr/lib/llvm-4.0/lib/clang/4.0.0/lib/linux/libclang_rt.asan-i386.so
After this step, I setup the LD_LIBRARY_PATH as follows:
root#522051d201d2:/home# echo $LD_LIBRARY_PATH
/usr/lib:/usr/lib/llvm-4.0/lib/:/usr/lib/x86_64-linux-gnu/
And lastly, I have exported it using the command export LD_LIBRARY_PATH. Now, if I try to run the cppgrep tool, I am still getting the same error. The command to test the tool after building the docker is as follows:
(1) cd into the cppgrep directory, like code/cppgrep,
(2) enter the docker container and mount the folder under /home:
$ docker run -it -v $PWD:/home clang
(3) run cppgrep using ./cppgrep 'x' test.cpp command.
It is suppossed to return functions and variables that has name x.
To replicate the error, after downloading and unzipping the file from github repository, build the docker container using $ docker build -t clang . command. Then follow 1,2,3 steps in the above paragraph.
After couple of days struggle, solved it!!
My initial assumption about the reason for the error is correct. The clang-llvm environment was not available to the cppgrep tool, but I made the mistake in the way of providing the environment information to the cppgrep tool.
The answer has two steps: (1) change the Makefile to point the correct location where you have installed the llvm, in my case, I change the following line in Makefile from HEADERS := -isystem /llvm/include/ to HEADERS := -isystem /usr/lib/llvm-4.0/include/. (2) You have to compile the file again by using the make command, just enter an empty space and save the cppgrep.cpp file before giving the command, otherwise, you will get a message as make: Nothing to be done for 'all'..
That is it, now you should be able to run the cppgrep tool by running ./cppgrep 'x' test.cpp or ./cppgrep -help. For using the other tools in this docker such as ast-dump, mccabe, etc. you have to follow the same above two steps before using them.

Docker hub automated build fails but locally does not

I have setup an automated build on Docker hub here (the sources are here).
The build goes well locally. I have also tried to rebuild it with --no-cache option:
docker build --no-cache .
And the process completes successfully
Successfully built 68b34a5f493a
However, the automated build fails on Docker hub with this error log:
...
Cloning into 'nerdtree'...
[91mVim: Warning: Output is not to a terminal
[0m
[91mVim: Warning: Input is not from a terminal
[0m
[m[m[0m[H[2J[24;1HError detected while processing command line:
E492: Not an editor command: PluginInstall
E492: Not an editor command: GoInstallBinaries
[91mmv: cannot stat `/go/bin/*': No such file or directory
[0m
This build apparently fails on the following vim command:
vim +PluginInstall +GoInstallBinaries +qall
Note that the warnings Output is not to a terminal and Input is not to a terminal appears also in the local build.
I cannot understand how this can happen. I am using a standard Ubuntu 14.04 system.
I finally figured it out. The issue was related to this one.
I am using Docker 1.0 in my host machine, however a later version is in production in Docker Hub. Without the explicit ENV HOME=... line in the Dockerfile, version 1.0 uses / as home directory, while /root is used by the later version. The result is that vim was not able to find its .vimrc file, since it was copied in / instead of /root. The solution I used is to explicitly define ENV HOME=/root in my Dockerfile, so there are no differences between the two versions.

Docker build from source fails

After git clone from dotcloud/docker
cd docker
sudo make VERBOSE=1
Fetching https://net/http/cookiejar?go-get=1
https fetch failed
**
unrecognized import path "net/http/cookiejar"
Can any one please tell me what should i be looking at. I have Go 1.1 installed. The reason i wanted to build docker from src it to remove sys_rawio from lxc.cap.drop. I needed to make CUDA work with lxc containers. I was able to compile cuda code but while running it. I keep getting driver related error that says Operation not permitted.
Installed Go from https://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz
As suggested by user creack in above comments.
cd docker/docker; go build; ./docker -d& ./docker version
I have docker build successfully now.
Docker can now be used to build docker and is the recommended (and only supported) method, see:
https://docs.docker.com/project/set-up-dev-env/

Resources