Skip to content

Commit 02736fc

Browse files
authored
chore(multiple samples): bump TensorFlow and downgrade python/beam on Dockerfiles (#14384)
* chore(multiple samples): bump TensorFlow and downgrade python/beam on Dockerfiles - Update TensorFlow to 2.21.0 and Apache Beam to 2.74.0 across samples. - Modify Dockerfiles to use Python 3.13 and matching beam images due to compatibility with the updated CUDA base image (`12.5.1`). - Remove pytest version constraints in `requirements-test.txt` * Adress gemini suggestion to remove redundant docker instruction.
1 parent 796997c commit 02736fc

17 files changed

Lines changed: 28 additions & 31 deletions

File tree

dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# NVIDIA CUDA container: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda
1616
# Supported NVIDIA images: https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md
1717
# TensorFlow/CUDA compatibility: https://www.tensorflow.org/install/source#gpu
18-
FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
18+
FROM nvcr.io/nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04
1919

2020
WORKDIR /pipeline
2121

@@ -25,15 +25,14 @@ COPY *.py ./
2525
RUN apt-get update \
2626
# Install Python and other system dependencies.
2727
&& apt-get install -y --no-install-recommends \
28-
curl g++ python3.14-dev python3.14-venv python3-distutils \
2928
&& rm -rf /var/lib/apt/lists/* \
30-
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.14 10 \
29+
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10 \
3130
&& curl https://bootstrap.pypa.io/get-pip.py | python \
3231
# Install the pipeline requirements.
3332
&& pip install --no-cache-dir -r requirements.txt \
3433
&& pip check
3534

3635
# Set the entrypoint to Apache Beam SDK worker launcher.
3736
# Check this matches the apache-beam version in the requirements.txt
38-
COPY --from=apache/beam_python3.14_sdk:2.73.0 /opt/apache/beam /opt/apache/beam
37+
COPY --from=apache/beam_python3.13_sdk:2.74.0 /opt/apache/beam /opt/apache/beam
3938
ENTRYPOINT [ "/opt/apache/beam/boot" ]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
google-api-python-client==2.87.0
22
google-cloud-storage==2.9.0
3-
pytest==9.0.3; python_version >= "3.10"
3+
pytest==9.0.3
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pillow==12.2.0; python_version >= "3.10"
2-
apache-beam[gcp]==2.58.1
2+
apache-beam[gcp]==2.74.0
33
rasterio==1.3.10
4-
tensorflow==2.12.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu
4+
tensorflow==2.21.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu

dataflow/gpu-examples/tensorflow-landsat/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# NVIDIA CUDA container: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda
1616
# Supported NVIDIA images: https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md
1717
# TensorFlow/CUDA compatibility: https://www.tensorflow.org/install/source#gpu
18-
FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
18+
FROM nvcr.io/nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04
1919

2020
WORKDIR /pipeline
2121

@@ -25,15 +25,14 @@ COPY *.py ./
2525
RUN apt-get update \
2626
# Install Python and other system dependencies.
2727
&& apt-get install -y --no-install-recommends \
28-
curl g++ python3.14-dev python3.14-venv python3-distutils \
2928
&& rm -rf /var/lib/apt/lists/* \
30-
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.14 10 \
29+
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10 \
3130
&& curl https://bootstrap.pypa.io/get-pip.py | python \
3231
# Install the pipeline requirements.
3332
&& pip install --no-cache-dir -r requirements.txt \
3433
&& pip check
3534

3635
# Set the entrypoint to Apache Beam SDK worker launcher.
3736
# Check this matches the apache-beam version in the requirements.txt
38-
COPY --from=apache/beam_python3.14_sdk:2.73.0 /opt/apache/beam /opt/apache/beam
37+
COPY --from=apache/beam_python3.13_sdk:2.74.0 /opt/apache/beam /opt/apache/beam
3938
ENTRYPOINT [ "/opt/apache/beam/boot" ]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
google-api-python-client==2.87.0
22
google-cloud-storage==2.9.0
3-
pytest==9.0.3; python_version >= "3.10"
3+
pytest==9.0.3
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pillow==12.2.0; python_version >= "3.10"
2-
apache-beam[gcp]==2.58.1
2+
apache-beam[gcp]==2.74.0
33
rasterio==1.3.10
4-
tensorflow==2.12.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu
4+
tensorflow==2.21.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu

dataflow/gpu-examples/tensorflow-minimal/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# NVIDIA CUDA container: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda
1616
# Supported NVIDIA images: https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md
1717
# TensorFlow/CUDA compatibility: https://www.tensorflow.org/install/source#gpu
18-
FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
18+
FROM nvcr.io/nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04
1919

2020
WORKDIR /pipeline
2121

@@ -25,15 +25,14 @@ COPY *.py ./
2525
RUN apt-get update \
2626
# Install Python and other system dependencies.
2727
&& apt-get install -y --no-install-recommends \
28-
curl g++ python3.14-dev python3.14-venv python3-distutils \
2928
&& rm -rf /var/lib/apt/lists/* \
30-
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.14 10 \
29+
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10 \
3130
&& curl https://bootstrap.pypa.io/get-pip.py | python \
3231
# Install the pipeline requirements.
3332
&& pip install --no-cache-dir -r requirements.txt \
3433
&& pip check
3534

3635
# Set the entrypoint to Apache Beam SDK worker launcher.
3736
# Check this matches the apache-beam version in the requirements.txt
38-
COPY --from=apache/beam_python3.14_sdk:2.73.0 /opt/apache/beam /opt/apache/beam
37+
COPY --from=apache/beam_python3.13_sdk:2.74.0 /opt/apache/beam /opt/apache/beam
3938
ENTRYPOINT [ "/opt/apache/beam/boot" ]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
google-api-python-client==2.131.0
22
google-cloud-storage==2.9.0
3-
pytest==9.0.3; python_version >= "3.10"
3+
pytest==9.0.3
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
apache-beam[gcp]==2.46.0
2-
tensorflow==2.12.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu
1+
apache-beam[gcp]==2.74.0
2+
tensorflow==2.21.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pytest==9.0.3; python_version >= "3.10"
1+
pytest==9.0.3
22
pytest-xdist==3.3.0

0 commit comments

Comments
 (0)