Error while building docker image with Dockerfile.devel-gpu file
I'm trying to build a docker image for tensorflow serving using the following command:
The command execute fine till Step 24/25, but in the last step it is always failing with the following error:
____Loading package: @org_tensorflow//tensorflow/core/grappler/costs WARNING: /root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/tensorflow/core/BUILD:1634:1: in includes attribute of cc_library rule @org_tensorflow//tensorflow/core:framework_headers_lib: '../../../../external/nsync/public' resolves to 'external/nsync/public' not below the relative path of its package 'external/org_tensorflow/tensorflow/core'. This will be an error in the future. Since this rule was created by the macro 'cc_header_only_library', the error might have been caused by the macro implementation in /root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/tensorflow/tensorflow.bzl:911:30. ____Loading package: @org_tensorflow//tensorflow/core/grappler/utils WARNING: /serving/tensorflow_serving/servables/tensorflow/BUILD:120:1: in cc_library rule //tensorflow_serving/servables/tensorflow:session_bundle_factory: target '//tensorflow_serving/servables/tensorflow:session_bundle_factory' depends on deprecated target '@org_tensorflow//tensorflow/contrib/session_bundle:session_bundle': No longer supported. Switch to SavedModel immediately.. WARNING: /serving/tensorflow_serving/servables/tensorflow/BUILD:207:1: in cc_library rule //tensorflow_serving/servables/tensorflow:session_bundle_source_adapter: target '//tensorflow_serving/servables/tensorflow:session_bundle_source_adapter' depends on deprecated target '@org_tensorflow//tensorflow/contrib/session_bundle:session_bundle': No longer supported. Switch to SavedModel immediately.. ____Lost connection for http://mirror.bazel.build/github.com/grpc/grpc/archive/781fd6f6ea03645a520cd5c675da67ab61f87e4b.tar.gz due to java.net.SocketTimeoutException: Read timed out ERROR: /serving/tensorflow_serving/model_servers/BUILD:125:1: no such package '@grpc//': java.io.IOException: Error downloading [http://mirror.bazel.build/github.com/grpc/grpc/archive/781fd6f6ea03645a520cd5c675da67ab61f87e4b.tar.gz, https://github.com/grpc/grpc/archive/781fd6f6ea03645a520cd5c675da67ab61f87e4b.tar.gz] to /root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/grpc/781fd6f6ea03645a520cd5c675da67ab61f87e4b.tar.gz: Tried to reconnect at offset 1,651,220 but server didn't support it and referenced by '//tensorflow_serving/model_servers:tensorflow_model_server'. ERROR: Analysis of target '//tensorflow_serving/model_servers:tensorflow_model_server' failed; build aborted. ____Elapsed time: 56.858s The command '/bin/sh -c bazel build -c opt --config=cuda --crosstool_top=@local_config_cuda//crosstool:toolchain tensorflow_serving/model_servers:tensorflow_model_server && cp bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server /usr/local/bin/ && bazel clean --expunge' returned a non-zero code: 1
*** But if i comment last three line in the Dockerfile.devel-gpu like:
Build TensorFlow Serving and Install it in /usr/local/bin
WORKDIR /serving
#RUN bazel build -c opt --config=cuda
#--crosstool_top=@local_config_cuda//crosstool:toolchain
#tensorflow_serving/model_servers:tensorflow_model_server &&
#cp bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server /usr/local/bin/ &&
#bazel clean --expunge
CMD ["/bin/bash"]
*** Then the docker image is built properly. It seems to me some issue with running bazel command.
Does anyone faced this issue before or is it a intermittent issue of not able to download due to socket timeout??
@Kuntal-G
Hi Kuntal.
It seems the similar error when run Dockerfile.devel-gpu file, as the attached log file shows.
When you say the docker image built properly, with last command commented. Is tf-serving with gpu ok in the image? There is no tensorflow-gpu in mine.
root@4854e735ebb2:/serving# ls
AUTHORS LICENSE RELEASE.md tensorflow tf_models
CONTRIBUTING.md README.md WORKSPACE tensorflow_serving tools
root@4854e735ebb2:/serving# python
Python 2.7.12 (default, Nov 20 2017, 18:23:56)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow
>>> exit()
root@4854e735ebb2:/serving#
[bazel-build-error.log](https://github.com/tensorflow/serving/files/1554765/bazel-build-error.log)
Closing - please see the latest Docker examples for bringing up a build environment.