From ebdd9311201977055c2d53dd285ddb96c9bd34a0 Mon Sep 17 00:00:00 2001 From: David del Real Sifuentes Date: Mon, 6 Jul 2026 20:44:48 +0000 Subject: [PATCH 1/2] 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` --- dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile | 8 ++++---- .../tensorflow-landsat-prime/requirements-test.txt | 2 +- .../tensorflow-landsat-prime/requirements.txt | 4 ++-- dataflow/gpu-examples/tensorflow-landsat/Dockerfile | 8 ++++---- .../gpu-examples/tensorflow-landsat/requirements-test.txt | 2 +- dataflow/gpu-examples/tensorflow-landsat/requirements.txt | 4 ++-- dataflow/gpu-examples/tensorflow-minimal/Dockerfile | 8 ++++---- .../gpu-examples/tensorflow-minimal/requirements-test.txt | 2 +- dataflow/gpu-examples/tensorflow-minimal/requirements.txt | 4 ++-- .../geospatial-classification/requirements-test.txt | 2 +- .../geospatial-classification/requirements.txt | 2 +- .../geospatial-classification/serving_app/Dockerfile | 2 +- .../serving_app/requirements.txt | 2 +- .../land-cover-classification/requirements-test.txt | 2 +- .../land-cover-classification/requirements.txt | 4 ++-- .../land-cover-classification/serving/requirements.txt | 2 +- people-and-planet-ai/land-cover-classification/setup.py | 4 ++-- 17 files changed, 31 insertions(+), 31 deletions(-) diff --git a/dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile b/dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile index 9b2fba3c978..f39262515b4 100644 --- a/dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile +++ b/dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile @@ -15,7 +15,7 @@ # NVIDIA CUDA container: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda # Supported NVIDIA images: https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md # TensorFlow/CUDA compatibility: https://www.tensorflow.org/install/source#gpu -FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 +FROM nvcr.io/nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04 WORKDIR /pipeline @@ -25,9 +25,9 @@ COPY *.py ./ RUN apt-get update \ # Install Python and other system dependencies. && apt-get install -y --no-install-recommends \ - curl g++ python3.14-dev python3.14-venv python3-distutils \ + curl g++ python3.13-dev python3.13-venv python3-distutils \ && rm -rf /var/lib/apt/lists/* \ - && update-alternatives --install /usr/bin/python python /usr/bin/python3.14 10 \ + && update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10 \ && curl https://bootstrap.pypa.io/get-pip.py | python \ # Install the pipeline requirements. && pip install --no-cache-dir -r requirements.txt \ @@ -35,5 +35,5 @@ RUN apt-get update \ # Set the entrypoint to Apache Beam SDK worker launcher. # Check this matches the apache-beam version in the requirements.txt -COPY --from=apache/beam_python3.14_sdk:2.73.0 /opt/apache/beam /opt/apache/beam +COPY --from=apache/beam_python3.13_sdk:2.74.0 /opt/apache/beam /opt/apache/beam ENTRYPOINT [ "/opt/apache/beam/boot" ] diff --git a/dataflow/gpu-examples/tensorflow-landsat-prime/requirements-test.txt b/dataflow/gpu-examples/tensorflow-landsat-prime/requirements-test.txt index f69c50afa50..3b2567ab391 100644 --- a/dataflow/gpu-examples/tensorflow-landsat-prime/requirements-test.txt +++ b/dataflow/gpu-examples/tensorflow-landsat-prime/requirements-test.txt @@ -1,3 +1,3 @@ google-api-python-client==2.87.0 google-cloud-storage==2.9.0 -pytest==9.0.3; python_version >= "3.10" +pytest==9.0.3 diff --git a/dataflow/gpu-examples/tensorflow-landsat-prime/requirements.txt b/dataflow/gpu-examples/tensorflow-landsat-prime/requirements.txt index e8058a01af2..8020832d1f5 100644 --- a/dataflow/gpu-examples/tensorflow-landsat-prime/requirements.txt +++ b/dataflow/gpu-examples/tensorflow-landsat-prime/requirements.txt @@ -1,4 +1,4 @@ pillow==12.2.0; python_version >= "3.10" -apache-beam[gcp]==2.58.1 +apache-beam[gcp]==2.74.0 rasterio==1.3.10 -tensorflow==2.12.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu +tensorflow==2.21.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu diff --git a/dataflow/gpu-examples/tensorflow-landsat/Dockerfile b/dataflow/gpu-examples/tensorflow-landsat/Dockerfile index f547b13de44..75e1a077b01 100644 --- a/dataflow/gpu-examples/tensorflow-landsat/Dockerfile +++ b/dataflow/gpu-examples/tensorflow-landsat/Dockerfile @@ -15,7 +15,7 @@ # NVIDIA CUDA container: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda # Supported NVIDIA images: https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md # TensorFlow/CUDA compatibility: https://www.tensorflow.org/install/source#gpu -FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 +FROM nvcr.io/nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04 WORKDIR /pipeline @@ -25,9 +25,9 @@ COPY *.py ./ RUN apt-get update \ # Install Python and other system dependencies. && apt-get install -y --no-install-recommends \ - curl g++ python3.14-dev python3.14-venv python3-distutils \ + curl g++ python3.13-dev python3.13-venv python3-distutils \ && rm -rf /var/lib/apt/lists/* \ - && update-alternatives --install /usr/bin/python python /usr/bin/python3.14 10 \ + && update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10 \ && curl https://bootstrap.pypa.io/get-pip.py | python \ # Install the pipeline requirements. && pip install --no-cache-dir -r requirements.txt \ @@ -35,5 +35,5 @@ RUN apt-get update \ # Set the entrypoint to Apache Beam SDK worker launcher. # Check this matches the apache-beam version in the requirements.txt -COPY --from=apache/beam_python3.14_sdk:2.73.0 /opt/apache/beam /opt/apache/beam +COPY --from=apache/beam_python3.13_sdk:2.74.0 /opt/apache/beam /opt/apache/beam ENTRYPOINT [ "/opt/apache/beam/boot" ] diff --git a/dataflow/gpu-examples/tensorflow-landsat/requirements-test.txt b/dataflow/gpu-examples/tensorflow-landsat/requirements-test.txt index f69c50afa50..3b2567ab391 100644 --- a/dataflow/gpu-examples/tensorflow-landsat/requirements-test.txt +++ b/dataflow/gpu-examples/tensorflow-landsat/requirements-test.txt @@ -1,3 +1,3 @@ google-api-python-client==2.87.0 google-cloud-storage==2.9.0 -pytest==9.0.3; python_version >= "3.10" +pytest==9.0.3 diff --git a/dataflow/gpu-examples/tensorflow-landsat/requirements.txt b/dataflow/gpu-examples/tensorflow-landsat/requirements.txt index e8058a01af2..8020832d1f5 100644 --- a/dataflow/gpu-examples/tensorflow-landsat/requirements.txt +++ b/dataflow/gpu-examples/tensorflow-landsat/requirements.txt @@ -1,4 +1,4 @@ pillow==12.2.0; python_version >= "3.10" -apache-beam[gcp]==2.58.1 +apache-beam[gcp]==2.74.0 rasterio==1.3.10 -tensorflow==2.12.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu +tensorflow==2.21.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu diff --git a/dataflow/gpu-examples/tensorflow-minimal/Dockerfile b/dataflow/gpu-examples/tensorflow-minimal/Dockerfile index 16c74bc0d75..8497476d940 100644 --- a/dataflow/gpu-examples/tensorflow-minimal/Dockerfile +++ b/dataflow/gpu-examples/tensorflow-minimal/Dockerfile @@ -15,7 +15,7 @@ # NVIDIA CUDA container: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda # Supported NVIDIA images: https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md # TensorFlow/CUDA compatibility: https://www.tensorflow.org/install/source#gpu -FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 +FROM nvcr.io/nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04 WORKDIR /pipeline @@ -25,9 +25,9 @@ COPY *.py ./ RUN apt-get update \ # Install Python and other system dependencies. && apt-get install -y --no-install-recommends \ - curl g++ python3.14-dev python3.14-venv python3-distutils \ + curl g++ python3.13-dev python3.13-venv python3-distutils \ && rm -rf /var/lib/apt/lists/* \ - && update-alternatives --install /usr/bin/python python /usr/bin/python3.14 10 \ + && update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10 \ && curl https://bootstrap.pypa.io/get-pip.py | python \ # Install the pipeline requirements. && pip install --no-cache-dir -r requirements.txt \ @@ -35,5 +35,5 @@ RUN apt-get update \ # Set the entrypoint to Apache Beam SDK worker launcher. # Check this matches the apache-beam version in the requirements.txt -COPY --from=apache/beam_python3.14_sdk:2.73.0 /opt/apache/beam /opt/apache/beam +COPY --from=apache/beam_python3.13_sdk:2.74.0 /opt/apache/beam /opt/apache/beam ENTRYPOINT [ "/opt/apache/beam/boot" ] diff --git a/dataflow/gpu-examples/tensorflow-minimal/requirements-test.txt b/dataflow/gpu-examples/tensorflow-minimal/requirements-test.txt index 36a5b86295e..d12d277c292 100644 --- a/dataflow/gpu-examples/tensorflow-minimal/requirements-test.txt +++ b/dataflow/gpu-examples/tensorflow-minimal/requirements-test.txt @@ -1,3 +1,3 @@ google-api-python-client==2.131.0 google-cloud-storage==2.9.0 -pytest==9.0.3; python_version >= "3.10" +pytest==9.0.3 diff --git a/dataflow/gpu-examples/tensorflow-minimal/requirements.txt b/dataflow/gpu-examples/tensorflow-minimal/requirements.txt index af96d7c55f5..ca6145fc750 100644 --- a/dataflow/gpu-examples/tensorflow-minimal/requirements.txt +++ b/dataflow/gpu-examples/tensorflow-minimal/requirements.txt @@ -1,2 +1,2 @@ -apache-beam[gcp]==2.46.0 -tensorflow==2.12.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu +apache-beam[gcp]==2.74.0 +tensorflow==2.21.0 # Check TensorFlow/CUDA compatibility with Dockerfile: https://www.tensorflow.org/install/source#gpu diff --git a/people-and-planet-ai/geospatial-classification/requirements-test.txt b/people-and-planet-ai/geospatial-classification/requirements-test.txt index 60930e396c3..8bce7490b76 100644 --- a/people-and-planet-ai/geospatial-classification/requirements-test.txt +++ b/people-and-planet-ai/geospatial-classification/requirements-test.txt @@ -1,2 +1,2 @@ -pytest==9.0.3; python_version >= "3.10" +pytest==9.0.3 pytest-xdist==3.3.0 diff --git a/people-and-planet-ai/geospatial-classification/requirements.txt b/people-and-planet-ai/geospatial-classification/requirements.txt index 2aae73b7a92..72a9474e2fb 100644 --- a/people-and-planet-ai/geospatial-classification/requirements.txt +++ b/people-and-planet-ai/geospatial-classification/requirements.txt @@ -2,4 +2,4 @@ earthengine-api==1.5.9 folium==0.19.5 google-cloud-aiplatform==1.157.0 pandas==2.2.3 -tensorflow==2.12.0 +tensorflow==2.21.0 diff --git a/people-and-planet-ai/geospatial-classification/serving_app/Dockerfile b/people-and-planet-ai/geospatial-classification/serving_app/Dockerfile index 9ffdf266bd0..eca5efbad56 100644 --- a/people-and-planet-ai/geospatial-classification/serving_app/Dockerfile +++ b/people-and-planet-ai/geospatial-classification/serving_app/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.14-slim +FROM python:3.13-slim WORKDIR /app diff --git a/people-and-planet-ai/geospatial-classification/serving_app/requirements.txt b/people-and-planet-ai/geospatial-classification/serving_app/requirements.txt index 1d903e8cff6..96e211e49ed 100644 --- a/people-and-planet-ai/geospatial-classification/serving_app/requirements.txt +++ b/people-and-planet-ai/geospatial-classification/serving_app/requirements.txt @@ -1,4 +1,4 @@ Flask==3.1.3; python_version >= '3.9' gunicorn==23.0.0 -tensorflow==2.12.0 +tensorflow==2.21.0 Werkzeug==3.1.8; python_version >= '3.9' diff --git a/people-and-planet-ai/land-cover-classification/requirements-test.txt b/people-and-planet-ai/land-cover-classification/requirements-test.txt index e7f296a21a0..42b0d60cb8d 100644 --- a/people-and-planet-ai/land-cover-classification/requirements-test.txt +++ b/people-and-planet-ai/land-cover-classification/requirements-test.txt @@ -4,4 +4,4 @@ importnb==2023.11.1 ipykernel==6.23.3 nbclient==0.8.0 pytest-xdist==3.3.0 -pytest==9.0.3; python_version >= "3.10" +pytest==9.0.3 diff --git a/people-and-planet-ai/land-cover-classification/requirements.txt b/people-and-planet-ai/land-cover-classification/requirements.txt index f4819f58b63..b7618aabfdb 100644 --- a/people-and-planet-ai/land-cover-classification/requirements.txt +++ b/people-and-planet-ai/land-cover-classification/requirements.txt @@ -1,8 +1,8 @@ # Requirements to run the notebooks. -apache-beam[gcp]==2.46.0 +apache-beam[gcp]==2.74.0 earthengine-api==1.5.9 folium==0.19.5 google-cloud-aiplatform==1.157.0 imageio==2.36.1 plotly==5.15.0 -tensorflow==2.12.0 +tensorflow==2.21.0 diff --git a/people-and-planet-ai/land-cover-classification/serving/requirements.txt b/people-and-planet-ai/land-cover-classification/serving/requirements.txt index 35fe32b48cd..10d13aa4a67 100644 --- a/people-and-planet-ai/land-cover-classification/serving/requirements.txt +++ b/people-and-planet-ai/land-cover-classification/serving/requirements.txt @@ -2,5 +2,5 @@ Flask==3.1.3; python_version >= '3.9' earthengine-api==1.5.9 gunicorn==23.0.0 -tensorflow==2.12.0 +tensorflow==2.21.0 Werkzeug==3.1.8; python_version >= '3.9' diff --git a/people-and-planet-ai/land-cover-classification/setup.py b/people-and-planet-ai/land-cover-classification/setup.py index 0bbc85ba962..77d1719e4e7 100644 --- a/people-and-planet-ai/land-cover-classification/setup.py +++ b/people-and-planet-ai/land-cover-classification/setup.py @@ -20,8 +20,8 @@ url="https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/people-and-planet-ai/land-cover-classification", packages=["serving"], install_requires=[ - "apache-beam[gcp]==2.46.0", + "apache-beam[gcp]==2.74.0", "earthengine-api==1.5.9", - "tensorflow==2.12.0", + "tensorflow==2.21.0", ], ) From 3ab88d4626a715142b3513632ce6ced6ba7f1ad8 Mon Sep 17 00:00:00 2001 From: David del Real Sifuentes Date: Mon, 6 Jul 2026 21:40:07 +0000 Subject: [PATCH 2/2] Adress gemini suggestion to remove redundant docker instruction. --- dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile | 1 - dataflow/gpu-examples/tensorflow-landsat/Dockerfile | 1 - dataflow/gpu-examples/tensorflow-minimal/Dockerfile | 1 - 3 files changed, 3 deletions(-) diff --git a/dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile b/dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile index f39262515b4..2cabbc313ac 100644 --- a/dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile +++ b/dataflow/gpu-examples/tensorflow-landsat-prime/Dockerfile @@ -25,7 +25,6 @@ COPY *.py ./ RUN apt-get update \ # Install Python and other system dependencies. && apt-get install -y --no-install-recommends \ - curl g++ python3.13-dev python3.13-venv python3-distutils \ && rm -rf /var/lib/apt/lists/* \ && update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10 \ && curl https://bootstrap.pypa.io/get-pip.py | python \ diff --git a/dataflow/gpu-examples/tensorflow-landsat/Dockerfile b/dataflow/gpu-examples/tensorflow-landsat/Dockerfile index 75e1a077b01..a0a685366be 100644 --- a/dataflow/gpu-examples/tensorflow-landsat/Dockerfile +++ b/dataflow/gpu-examples/tensorflow-landsat/Dockerfile @@ -25,7 +25,6 @@ COPY *.py ./ RUN apt-get update \ # Install Python and other system dependencies. && apt-get install -y --no-install-recommends \ - curl g++ python3.13-dev python3.13-venv python3-distutils \ && rm -rf /var/lib/apt/lists/* \ && update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10 \ && curl https://bootstrap.pypa.io/get-pip.py | python \ diff --git a/dataflow/gpu-examples/tensorflow-minimal/Dockerfile b/dataflow/gpu-examples/tensorflow-minimal/Dockerfile index 8497476d940..a0a685366be 100644 --- a/dataflow/gpu-examples/tensorflow-minimal/Dockerfile +++ b/dataflow/gpu-examples/tensorflow-minimal/Dockerfile @@ -25,7 +25,6 @@ COPY *.py ./ RUN apt-get update \ # Install Python and other system dependencies. && apt-get install -y --no-install-recommends \ - curl g++ python3.13-dev python3.13-venv python3-distutils \ && rm -rf /var/lib/apt/lists/* \ && update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10 \ && curl https://bootstrap.pypa.io/get-pip.py | python \