Skip to content

Commit 41e0b25

Browse files
Merge pull request #2077 from ashahba:ashahba/fix-build-failurs
PiperOrigin-RevId: 491958083
2 parents 8d1e933 + 17f7ddd commit 41e0b25

File tree

2 files changed

+45
-44
lines changed

2 files changed

+45
-44
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ build:tpu --copt=-DLIBTPU_ON_GCE
1717
# Please note that MKL on MacOS or windows is still not supported.
1818
# If you would like to use a local MKL instead of downloading, please set the
1919
# environment variable "TF_MKL_ROOT" every time before build.
20-
build:mkl --define=build_with_mkl=true --define=enable_mkl=true --define=build_with_openmp=true
20+
build:mkl --define=build_with_mkl=true --define=enable_mkl=true --define=build_with_openmp=false
2121
build:mkl --define=tensorflow_mkldnn_contraction_kernel=0
2222

2323
# This config option is used to enable MKL-DNN open source library only,

tensorflow_serving/tools/docker/Dockerfile.devel-mkl

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,59 +21,58 @@ LABEL maintainer="Abolfazl Shahbazi <abolfazl.shahbazi@intel.com>"
2121
LABEL tensorflow_serving_github_branchtag=${TF_SERVING_VERSION_GIT_BRANCH}
2222
LABEL tensorflow_serving_github_commit=${TF_SERVING_VERSION_GIT_COMMIT}
2323

24+
ARG DEBIAN_FRONTEND=noninteractive
25+
26+
# See http://bugs.python.org/issue19846
27+
ENV LANG C.UTF-8
28+
ARG PYTHON=python3
29+
2430
RUN apt-get update && apt-get install -y --no-install-recommends \
25-
automake \
26-
build-essential \
27-
ca-certificates \
28-
curl \
29-
git \
30-
libcurl3-dev \
31-
libfreetype6-dev \
32-
libpng-dev \
33-
libtool \
34-
libzmq3-dev \
35-
mlocate \
36-
openjdk-8-jdk\
37-
openjdk-8-jre-headless \
38-
pkg-config \
39-
python-dev \
40-
software-properties-common \
41-
swig \
42-
unzip \
43-
wget \
44-
zip \
45-
zlib1g-dev \
46-
python3-distutils \
47-
&& \
31+
${PYTHON} \
32+
${PYTHON}-dev \
33+
${PYTHON}-distutils \
34+
automake \
35+
build-essential \
36+
ca-certificates \
37+
curl \
38+
git \
39+
libcurl3-dev \
40+
libfreetype6-dev \
41+
libpng-dev \
42+
libtool \
43+
libzmq3-dev \
44+
mlocate \
45+
openjdk-8-jdk\
46+
openjdk-8-jre-headless \
47+
pkg-config \
48+
software-properties-common \
49+
swig \
50+
unzip \
51+
wget \
52+
zip \
53+
zlib1g-dev \
54+
&& \
4855
apt-get clean && \
4956
rm -rf /var/lib/apt/lists/*
5057

51-
# Install python 3.7.
52-
RUN add-apt-repository ppa:deadsnakes/ppa && \
53-
apt-get update && apt-get install -y \
54-
python3.7 python3.7-dev python3-pip python3.7-venv && \
55-
rm -rf /var/lib/apt/lists/* && \
56-
python3.7 -m pip install pip --upgrade && \
57-
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 0
58-
59-
# Make python3.7 the default python version
60-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 0
58+
RUN curl -fSsL https://bootstrap.pypa.io/get-pip.py | ${PYTHON}
6159

62-
RUN curl -fSsL -O https://bootstrap.pypa.io/get-pip.py && \
63-
python3 get-pip.py && \
64-
rm get-pip.py
60+
# Some TF tools expect a "python" binary
61+
RUN ln -sf $(which ${PYTHON}) /usr/local/bin/python && \
62+
ln -sf $(which ${PYTHON}) /usr/local/bin/python3 && \
63+
ln -sf $(which ${PYTHON}) /usr/bin/python
6564

66-
RUN pip3 --no-cache-dir install \
67-
future>=0.17.1 \
65+
RUN python -m pip --no-cache-dir install \
66+
'future>=0.17.1' \
6867
grpcio \
6968
h5py \
70-
keras_applications>=1.0.8 \
71-
keras_preprocessing>=1.1.0 \
69+
'keras_applications>=1.0.8' \
70+
'keras_preprocessing>=1.1.0' \
7271
mock \
7372
numpy \
7473
portpicker \
7574
requests \
76-
--ignore-installed six>=1.12.0
75+
--ignore-installed 'six>=1.12.0'
7776

7877
# Set up Bazel
7978
ENV BAZEL_VERSION 5.3.0
@@ -89,7 +88,9 @@ RUN mkdir /bazel && \
8988

9089
# Download TF Serving sources (optionally at specific commit).
9190
WORKDIR /tensorflow-serving
92-
RUN curl -sSL --retry 5 https://github.com/tensorflow/serving/tarball/${TF_SERVING_VERSION_GIT_COMMIT} | tar --strip-components=1 -xzf -
91+
RUN git clone --single-branch --branch=${TF_SERVING_VERSION_GIT_BRANCH} https://github.com/tensorflow/serving /tensorflow-serving && \
92+
cd /tensorflow-serving && \
93+
git reset --hard ${TF_SERVING_VERSION_GIT_COMMIT}
9394

9495
FROM base_build as binary_build
9596
# Build, and install TensorFlow Serving
@@ -122,7 +123,7 @@ RUN bazel build --color=yes --curses=yes \
122123
rm -rf /tmp/pip
123124

124125
# Copy openmp libraries
125-
RUN cp /root/.cache/bazel/_bazel_root/*/execroot/tf_serving/bazel-out/k8-opt/bin/external/llvm_openmp/libiomp5.so /usr/local/lib/
126+
RUN cp -rp /root/.cache/bazel/_bazel_root/*/execroot/tf_serving/bazel-out/host/bin/external/llvm_openmp/libiomp5.so /usr/local/lib/
126127

127128
ENV LIBRARY_PATH '/usr/local/lib:$LIBRARY_PATH'
128129
ENV LD_LIBRARY_PATH '/usr/local/lib:$LD_LIBRARY_PATH'

0 commit comments

Comments
 (0)