You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2025/03/12 19:23:30 UTC

(beam) branch master updated: Fix PostCommit Python ValidatesContainer Dataflow With RC job (#34246)

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

damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new ee62d7def54 Fix PostCommit Python ValidatesContainer Dataflow With RC job (#34246)
ee62d7def54 is described below

commit ee62d7def5477293c42a07af6d3bed5e6163fb50
Author: Vitaly Terentyev <vi...@akvelon.com>
AuthorDate: Wed Mar 12 23:23:24 2025 +0400

    Fix PostCommit Python ValidatesContainer Dataflow With RC job (#34246)
    
    * Fix deleting images, change cron
    
    * Fix echo
---
 ..._PostCommit_Python_ValidatesContainer_Dataflow_With_RC.yml |  2 +-
 sdks/python/container/run_validatescontainer.sh               | 11 +++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/beam_PostCommit_Python_ValidatesContainer_Dataflow_With_RC.yml b/.github/workflows/beam_PostCommit_Python_ValidatesContainer_Dataflow_With_RC.yml
index 8befd0d121c..21834c17acb 100644
--- a/.github/workflows/beam_PostCommit_Python_ValidatesContainer_Dataflow_With_RC.yml
+++ b/.github/workflows/beam_PostCommit_Python_ValidatesContainer_Dataflow_With_RC.yml
@@ -17,7 +17,7 @@ name: PostCommit Python ValidatesContainer Dataflow With RC
 
 on:
   schedule:
-    - cron: '15 5/6 * * *'
+    - cron: '15 8/6 * * *'
   pull_request_target:
     paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Python_ValidatesContainer_Dataflow_With_RC.json']
   workflow_dispatch:
diff --git a/sdks/python/container/run_validatescontainer.sh b/sdks/python/container/run_validatescontainer.sh
index 68bea8b00e1..95130f7559b 100755
--- a/sdks/python/container/run_validatescontainer.sh
+++ b/sdks/python/container/run_validatescontainer.sh
@@ -100,7 +100,13 @@ function cleanup_container {
   # Delete the container locally and remotely
   docker rmi $CONTAINER:$TAG || echo "Built container image was not removed. Possibly, it was not not saved locally."
   for image in $(docker images --format '{{.Repository}}:{{.Tag}}' | grep $PREBUILD_SDK_CONTAINER_REGISTRY_PATH)
-    do docker rmi $image || echo "Failed to remove prebuilt sdk container image"
+  do
+    echo "Deleting Docker image: $image"
+    docker rmi $image || echo "Failed to remove prebuilt sdk container image"
+    image_tag="${image##*:}"
+    digest=$(gcloud container images list-tags $PREBUILD_SDK_CONTAINER_REGISTRY_PATH/beam_python_prebuilt_sdk --filter="tags=$image_tag" --format="get(digest)")
+    echo "Deleting from GCloud an image with digest: $digest"
+    gcloud container images delete $PREBUILD_SDK_CONTAINER_REGISTRY_PATH/beam_python_prebuilt_sdk@$digest --force-delete-tags --quiet || echo "Failed to remove prebuilt sdk container image"
   done
   # Note: we don't delete the multi-arch containers here because this command only deletes the manifest list with the tag,
   # the associated container images can't be deleted because they are not tagged. However, multi-arch containers that are
@@ -108,9 +114,6 @@ function cleanup_container {
   if [[ "$ARCH" == "x86" ]]; then
     gcloud --quiet container images delete $CONTAINER:$TAG || echo "Failed to delete container"
   fi
-  for digest in $(gcloud container images list-tags $PREBUILD_SDK_CONTAINER_REGISTRY_PATH/beam_python_prebuilt_sdk  --format="get(digest)")
-    do gcloud container images delete $PREBUILD_SDK_CONTAINER_REGISTRY_PATH/beam_python_prebuilt_sdk@$digest --force-delete-tags --quiet || echo "Failed to remove prebuilt sdk container image"
-  done
 
   echo "Removed the container"
 }