Skip to content

Commit d908ef1

Browse files
authored
Merge pull request #981 from netfs/r1.8
Dockerfile fixes from master
2 parents e40fcbc + 570a35a commit d908ef1

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

tensorflow_serving/tools/docker/Dockerfile.devel

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
# limitations under the License.
1414
FROM ubuntu:16.04
1515

16+
ARG TF_SERVING_VERSION_GIT_BRANCH=1.8.0
17+
ARG TF_SERVING_VERSION_GIT_COMMIT=head
18+
1619
20+
LABEL tensorflow_serving_github_branchtag=${TF_SERVING_VERSION_GIT_BRANCH}
21+
LABEL tensorflow_serving_github_commit=${TF_SERVING_VERSION_GIT_COMMIT}
1722

1823
RUN apt-get update && apt-get install -y \
1924
automake \
@@ -67,12 +72,12 @@ RUN mkdir /bazel && \
6772
cd / && \
6873
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
6974

70-
# Download, build, and install TensorFlow Serving
71-
ARG TF_SERVING_VERSION_GIT_BRANCH=1.8.0
75+
# Download TF Serving sources (optionally at specific commit).
7276
WORKDIR /tensorflow-serving
73-
RUN git clone --depth=1 --branch=${TF_SERVING_VERSION_GIT_BRANCH} \
74-
https://github.com/tensorflow/serving .
77+
RUN git clone --depth=1 --branch=${TF_SERVING_VERSION_GIT_BRANCH} https://github.com/tensorflow/serving .
78+
RUN if [ "${TF_SERVING_VERSION_GIT_COMMIT}" != "head" ]; then git checkout ${TF_SERVING_VERSION_GIT_COMMIT} ; fi
7579

80+
# Build, and install TensorFlow Serving
7681
ARG TF_SERVING_BUILD_OPTIONS="--copt=-mavx --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --verbose_failures"
7782
RUN bazel build -c opt --color=yes --curses=yes ${TF_SERVING_BUILD_OPTIONS} \
7883
--output_filter=DONT_MATCH_ANYTHING \

tensorflow_serving/tools/docker/Dockerfile.devel-gpu

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
# limitations under the License.
1414
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
1515

16+
ARG TF_SERVING_VERSION_GIT_BRANCH=1.8.0
17+
ARG TF_SERVING_VERSION_GIT_COMMIT=head
18+
1619
20+
LABEL tensorflow_serving_github_branchtag=${TF_SERVING_VERSION_GIT_BRANCH}
21+
LABEL tensorflow_serving_github_commit=${TF_SERVING_VERSION_GIT_COMMIT}
1722

1823
# Install NCCL
1924
ENV NCCL_VERSION=2.2.12-1+cuda9.0
@@ -104,22 +109,21 @@ RUN mkdir -p ${NCCL_INSTALL_PATH} && \
104109
ln -s /usr/lib/x86_64-linux-gnu/libnccl.so.2 ${NCCL_INSTALL_PATH}lib/libnccl.so.2 && \
105110
ln -s /usr/lib/x86_64-linux-gnu/libnccl.so.$TF_NCCL_VERSION ${NCCL_INSTALL_PATH}lib/libnccl.so.$TF_NCCL_VERSION
106111

107-
# Download, build, and install TensorFlow Serving
108-
ARG TF_SERVING_VERSION_GIT_BRANCH=1.8.0
112+
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1
113+
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:${LD_LIBRARY_PATH}
114+
115+
# Download TF Serving sources (optionally at specific commit).
109116
WORKDIR /tensorflow-serving
110-
RUN git clone --depth=1 --branch=${TF_SERVING_VERSION_GIT_BRANCH} \
111-
https://github.com/tensorflow/serving .
117+
RUN git clone --depth=1 --branch=${TF_SERVING_VERSION_GIT_BRANCH} https://github.com/tensorflow/serving .
118+
RUN if [ "${TF_SERVING_VERSION_GIT_COMMIT}" != "head" ]; then git checkout ${TF_SERVING_VERSION_GIT_COMMIT} ; fi
112119

120+
# Build, and install TensorFlow Serving
113121
ARG TF_SERVING_BUILD_OPTIONS="--copt=-mavx --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --verbose_failures"
114-
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
115-
LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:${LD_LIBRARY_PATH} \
116-
bazel build -c opt --color=yes --curses=yes --config=cuda \
122+
RUN bazel build -c opt --color=yes --curses=yes --config=cuda \
117123
--output_filter=DONT_MATCH_ANYTHING \
118-
--crosstool_top=@local_config_cuda//crosstool:toolchain \
119124
${TF_SERVING_BUILD_OPTIONS} \
120125
tensorflow_serving/model_servers:tensorflow_model_server && \
121126
cp bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server /usr/local/bin/ && \
122-
rm /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
123127
bazel clean --expunge --color=yes
124128
# Clean up Bazel cache when done.
125129

tools/bazel.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
build:cuda --crosstool_top=@org_tensorflow//third_party/gpus/crosstool
1+
build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain
22
build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true
33

44
build --action_env PYTHON_BIN_PATH="/usr/bin/python"

0 commit comments

Comments
 (0)