STT-tensorflow/tensorflow/tools/dockerfiles/partials/tensorflow-ppc64le.partial.Dockerfile
Austin Anderson cf1bf299d3 Use --no-cache-dir more often to save Docker image space
Resolves #38815.

PiperOrigin-RevId: 308159278
Change-Id: I1fe2eee9516db723ddd952c91897b482eadfc6c7
2020-04-23 17:08:55 -07:00

29 lines
1.5 KiB
Docker

# Options:
# tensorflow
# tensorflow-gpu
# tf-nightly
# tf-nightly-gpu
ARG TF_PACKAGE=tensorflow
RUN apt-get update && apt-get install -y curl libhdf5-dev wget
RUN python3 -m pip install --no-cache-dir --global-option=build_ext \
--global-option=-I/usr/include/hdf5/serial/ \
--global-option=-L/usr/lib/powerpc64le-linux-gnu/hdf5/serial \
h5py
# CACHE_STOP is used to rerun future commands, otherwise downloading the .whl will be cached and will not pull the most recent version
ARG CACHE_STOP=1
RUN if [ ${TF_PACKAGE} = tensorflow-gpu ]; then \
BASE=https://powerci.osuosl.org/job/TensorFlow_PPC64LE_GPU_Release_Build/lastSuccessfulBuild/; \
elif [ ${TF_PACKAGE} = tf-nightly-gpu ]; then \
BASE=https://powerci.osuosl.org/job/TensorFlow_PPC64LE_GPU_Nightly_Artifact/lastSuccessfulBuild/; \
elif [ ${TF_PACKAGE} = tensorflow ]; then \
BASE=https://powerci.osuosl.org/job/TensorFlow_PPC64LE_CPU_Release_Build/lastSuccessfulBuild/; \
elif [ ${TF_PACKAGE} = tf-nightly ]; then \
BASE=https://powerci.osuosl.org/job/TensorFlow_PPC64LE_CPU_Nightly_Artifact/lastSuccessfulBuild/; \
fi; \
MAJOR=`python3 -c 'import sys; print(sys.version_info[0])'`; \
MINOR=`python3 -c 'import sys; print(sys.version_info[1])'`; \
PACKAGE=$(wget -qO- ${BASE}"api/xml?xpath=//fileName&wrapper=artifacts" | grep -o "[^<>]*cp${MAJOR}${MINOR}[^<>]*.whl"); \
wget ${BASE}"artifact/tensorflow_pkg/"${PACKAGE}; \
python3 -m pip install --no-cache-dir ${PACKAGE}