From 6c118ce7ca91394808be0b9fa0aef783bc19ea81 Mon Sep 17 00:00:00 2001 From: aIbrahiim Date: Fri, 30 Jan 2026 15:27:02 +0200 Subject: [PATCH 1/5] Replace gcloud docker push with docker push --- sdks/python/container/run_validatescontainer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/container/run_validatescontainer.sh b/sdks/python/container/run_validatescontainer.sh index 875fd1a138c7..8dee6e9034e7 100755 --- a/sdks/python/container/run_validatescontainer.sh +++ b/sdks/python/container/run_validatescontainer.sh @@ -86,7 +86,7 @@ if [[ "$ARCH" == "x86" ]]; then docker tag "apache/$IMAGE_NAME:$SDK_VERSION" "$CONTAINER:$TAG" # Push the container - gcloud docker -- push $CONTAINER:$TAG + docker push $CONTAINER:$TAG elif [[ "$ARCH" == "ARM" ]]; then # Reset the multi-arch Python SDK container image tag. TAG=$MULTIARCH_TAG From 2e6955823f48ecc69fafe681cda8d954e1907f02 Mon Sep 17 00:00:00 2001 From: aIbrahiim Date: Fri, 30 Jan 2026 15:46:52 +0200 Subject: [PATCH 2/5] fix --- .../runners/portability/sdk_container_builder.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/runners/portability/sdk_container_builder.py b/sdks/python/apache_beam/runners/portability/sdk_container_builder.py index bb5bfd48949d..2dffdf3a42ef 100644 --- a/sdks/python/apache_beam/runners/portability/sdk_container_builder.py +++ b/sdks/python/apache_beam/runners/portability/sdk_container_builder.py @@ -244,7 +244,7 @@ def _invoke_docker_build_and_push(self, container_image_name): build = cloud_build_types.Build() if self._cloud_build_machine_type: build.options = cloud_build_types.BuildOptions() - build.options.machineType = self._cloud_build_machine_type + build.options.machine_type = self._cloud_build_machine_type build.steps = [] step = cloud_build_types.BuildStep() step.name = 'quay.io/buildah/stable:latest' @@ -262,10 +262,10 @@ def _invoke_docker_build_and_push(self, container_image_name): build.steps.append(step) source = cloud_build_types.Source() - source.storageSource = cloud_build_types.StorageSource() + source.storage_source = cloud_build_types.StorageSource() gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location) - source.storageSource.bucket = os.path.join(gcs_bucket) - source.storageSource.object = gcs_object + source.storage_source.bucket = os.path.join(gcs_bucket) + source.storage_source.object = gcs_object build.source = source # TODO(zyichi): make timeout configurable build.timeout = '7200s' From 2a70cdde8a8b2a799a180aabf8bca5899261d009 Mon Sep 17 00:00:00 2001 From: aIbrahiim Date: Fri, 30 Jan 2026 16:12:51 +0200 Subject: [PATCH 3/5] revert docker push --- sdks/python/container/run_validatescontainer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/python/container/run_validatescontainer.sh b/sdks/python/container/run_validatescontainer.sh index 8dee6e9034e7..985bb56a1997 100755 --- a/sdks/python/container/run_validatescontainer.sh +++ b/sdks/python/container/run_validatescontainer.sh @@ -86,8 +86,8 @@ if [[ "$ARCH" == "x86" ]]; then docker tag "apache/$IMAGE_NAME:$SDK_VERSION" "$CONTAINER:$TAG" # Push the container - docker push $CONTAINER:$TAG -elif [[ "$ARCH" == "ARM" ]]; then + gcloud docker -- push $CONTAINER:$TAG. + elif [[ "$ARCH" == "ARM" ]]; then # Reset the multi-arch Python SDK container image tag. TAG=$MULTIARCH_TAG MACHINE_TYPE_ARGS="--machine_type=t2a-standard-1" From 78fba8bf4a13596aefcb6fa55b230b84c5f4832e Mon Sep 17 00:00:00 2001 From: aIbrahiim Date: Fri, 30 Jan 2026 18:22:15 +0200 Subject: [PATCH 4/5] Fix ValidatesContainer: docker push typo, upgrade_ensurepip Python 3.13 compatibility --- sdks/python/container/Dockerfile | 9 +++++---- sdks/python/container/run_validatescontainer.sh | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sdks/python/container/Dockerfile b/sdks/python/container/Dockerfile index 9aa9f0518dd9..a5dbba9db06f 100644 --- a/sdks/python/container/Dockerfile +++ b/sdks/python/container/Dockerfile @@ -84,11 +84,12 @@ RUN \ rm -rf /root/.cache/pip && \ # Update ensurepip to use most recent versions of setuptools and pip. This avoids some vulnerabilities which won't be fixed on older versions of python. + # upgrade_ensurepip may fail on Python 3.13+ due to ensurepip structure changes - allow failure and continue. pip install upgrade_ensurepip; \ - python3 -m upgrade_ensurepip; \ - find /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-*-py3-none-any.whl | tail -n 1)) -delete; \ - find /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-*-py3-none-any.whl | tail -n 1)) -delete; \ - pip uninstall upgrade_ensurepip -y; \ + (python3 -m upgrade_ensurepip && \ + find /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-*-py3-none-any.whl 2>/dev/null | tail -n 1)) -delete 2>/dev/null; \ + find /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-*-py3-none-any.whl 2>/dev/null | tail -n 1)) -delete 2>/dev/null; \ + pip uninstall upgrade_ensurepip -y) || true; \ python3 -m ensurepip; ENTRYPOINT ["/opt/apache/beam/boot"] diff --git a/sdks/python/container/run_validatescontainer.sh b/sdks/python/container/run_validatescontainer.sh index 985bb56a1997..9deae1a5d8e3 100755 --- a/sdks/python/container/run_validatescontainer.sh +++ b/sdks/python/container/run_validatescontainer.sh @@ -85,8 +85,8 @@ if [[ "$ARCH" == "x86" ]]; then # Tag the docker container. docker tag "apache/$IMAGE_NAME:$SDK_VERSION" "$CONTAINER:$TAG" - # Push the container - gcloud docker -- push $CONTAINER:$TAG. + # Push the container (use docker push - gcloud docker is deprecated) + docker push $CONTAINER:$TAG elif [[ "$ARCH" == "ARM" ]]; then # Reset the multi-arch Python SDK container image tag. TAG=$MULTIARCH_TAG From 533e482897fd7fcca482eb3ce76bc895f6ad59ba Mon Sep 17 00:00:00 2001 From: aIbrahiim Date: Fri, 30 Jan 2026 18:48:51 +0200 Subject: [PATCH 5/5] fix --- sdks/python/container/Dockerfile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sdks/python/container/Dockerfile b/sdks/python/container/Dockerfile index a5dbba9db06f..bfba41712c99 100644 --- a/sdks/python/container/Dockerfile +++ b/sdks/python/container/Dockerfile @@ -83,13 +83,7 @@ RUN \ # Remove pip cache. rm -rf /root/.cache/pip && \ - # Update ensurepip to use most recent versions of setuptools and pip. This avoids some vulnerabilities which won't be fixed on older versions of python. - # upgrade_ensurepip may fail on Python 3.13+ due to ensurepip structure changes - allow failure and continue. - pip install upgrade_ensurepip; \ - (python3 -m upgrade_ensurepip && \ - find /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-*-py3-none-any.whl 2>/dev/null | tail -n 1)) -delete 2>/dev/null; \ - find /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-*-py3-none-any.whl 2>/dev/null | tail -n 1)) -delete 2>/dev/null; \ - pip uninstall upgrade_ensurepip -y) || true; \ + # Ensure pip is available. upgrade_ensurepip is skipped - it fails on Python 3.12+ due to ensurepip structure changes. python3 -m ensurepip; ENTRYPOINT ["/opt/apache/beam/boot"]