You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by vt...@apache.org on 2026/02/03 13:13:42 UTC

(beam) branch fix-postcommit-python-validates-container updated: Update sdk container builder

This is an automated email from the ASF dual-hosted git repository.

vterentev pushed a commit to branch fix-postcommit-python-validates-container
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/fix-postcommit-python-validates-container by this push:
     new 4c2f729a08d Update sdk container builder
4c2f729a08d is described below

commit 4c2f729a08d5bbb11deadd27ea3f5a0722cfd2a6
Author: Vitaly Terentyev <vi...@akvelon.com>
AuthorDate: Tue Feb 3 17:13:31 2026 +0400

    Update sdk container builder
---
 .../runners/portability/sdk_container_builder.py      | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 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 6043d55e6b7..7785170d0a5 100644
--- a/sdks/python/apache_beam/runners/portability/sdk_container_builder.py
+++ b/sdks/python/apache_beam/runners/portability/sdk_container_builder.py
@@ -262,10 +262,11 @@ class _SdkContainerImageCloudBuilder(SdkContainerImageBuilder):
     build.steps.append(step)
 
     source = cloud_build_types.Source()
-    source.storage_source = cloud_build_types.StorageSource()
+    storage_source = cloud_build_types.StorageSource()
     gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location)
-    source.storage_source.bucket = os.path.join(gcs_bucket)
-    source.storage_source.object = gcs_object
+    storage_source.bucket = os.path.join(gcs_bucket)
+    storage_source.object = gcs_object
+    source.storage_source = storage_source
     build.source = source
     # TODO(zyichi): make timeout configurable
     build.timeout = '7200s'
@@ -325,16 +326,8 @@ class _SdkContainerImageCloudBuilder(SdkContainerImageBuilder):
     _LOGGER.info('Completed GCS upload to %s.', gcs_location)
 
   def _get_cloud_build_id_and_log_url(self, metadata):
-    id = None
-    log_url = None
-    for item in metadata.additionalProperties:
-      if item.key == 'build':
-        for field in item.value.object_value.properties:
-          if field.key == 'logUrl':
-            log_url = field.value.string_value
-          if field.key == 'id':
-            id = field.value.string_value
-    return id, log_url
+    build = metadata.build
+    return (build.id, build.log_url)
 
   @staticmethod
   def _get_gcs_bucket_and_name(gcs_location):