From 3776806eb781f6f50568e57e2912a21cdd8e3a2b Mon Sep 17 00:00:00 2001 From: Anand Inguva Date: Thu, 27 Oct 2022 14:41:52 -0400 Subject: [PATCH] Add dockerfile --- sdks/python/tfx_bsl_testing/Dockerfile | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sdks/python/tfx_bsl_testing/Dockerfile diff --git a/sdks/python/tfx_bsl_testing/Dockerfile b/sdks/python/tfx_bsl_testing/Dockerfile new file mode 100644 index 000000000000..895b2f5c2247 --- /dev/null +++ b/sdks/python/tfx_bsl_testing/Dockerfile @@ -0,0 +1,27 @@ +ARG BASE=tensorflow/tensorflow:2.10.0-gpu +FROM $BASE + +# Check that the chosen base image provides the expected version of Python interpreter. +ARG PY_VERSION=3.8 +RUN [[ $PY_VERSION == `python -c 'import sys; print("%s.%s" % sys.version_info[0:2])'` ]] \ + || { echo "Could not find Python interpreter or Python version is different from ${PY_VERSION}"; exit 1; } + +RUN apt-get update -y && apt-get install git -y \ + && apt install libcairo2-dev -y \ + && pip install --user git+https://github.com/pygobject/pycairo.git + +RUN pip install --upgrade pip setuptools \ + && pip install scipy \ + && pip install --no-cache-dir apache-beam[gcp]==2.42.0 +RUN pip install pillow + # Verify that there are no conflicting dependencies. +# Copy the Apache Beam worker dependencies from the Beam Python 3.8 SDK image. +COPY --from=apache/beam_python3.8_sdk:2.42.0 /opt/apache/beam /opt/apache/beam + +# Apache Beam worker expects pip at /usr/local/bin/pip by default. +# Some images have pip in a different location. If necessary, make a symlink. +# This can be omitted in Beam 2.30.0 and later versions. +RUN [[ `which pip` == "/usr/local/bin/pip" ]] || ln -s `which pip` /usr/local/bin/pip + +# Set the entrypoint to Apache Beam SDK worker launcher. +ENTRYPOINT [ "/opt/apache/beam/boot" ]