Skip to content

Commit

Permalink
Merge pull request #1307 from Polber:jkinard/yaml-template-deps
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 603425975
  • Loading branch information
cloud-teleport committed Feb 1, 2024
2 parents 1ebbebe + bef3434 commit 76f6580
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/src/main/python/yaml-template/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ WORKDIR ${WORKDIR}
ENV FLEX_TEMPLATE_PYTHON_REQUIREMENTS_FILE=requirements.txt
ENV FLEX_TEMPLATE_PYTHON_PY_FILE=main.py

# Install dependencies to launch the pipeline
RUN pip install -U -r $FLEX_TEMPLATE_PYTHON_REQUIREMENTS_FILE
RUN pip download --no-cache-dir --dest /tmp/dataflow-requirements-cache -r $FLEX_TEMPLATE_PYTHON_REQUIREMENTS_FILE
# Install dependencies to launch the pipeline and download to reduce startup time
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -U -r $FLEX_TEMPLATE_PYTHON_REQUIREMENTS_FILE \
&& pip download --no-cache-dir --dest /tmp/dataflow-requirements-cache -r $FLEX_TEMPLATE_PYTHON_REQUIREMENTS_FILE

# Install OpenJDK-11
RUN apt-get update && \
Expand All @@ -23,4 +24,7 @@ RUN apt-get update && \
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
RUN export JAVA_HOME

# Avoid downloading dependencies with pip to reduce startup time
ENV PIP_NO_DEPS=True

ENTRYPOINT ["/opt/google/dataflow/python_template_launcher"]

0 comments on commit 76f6580

Please sign in to comment.