[ 
https://issues.apache.org/jira/browse/BEAM-4645?focusedWorklogId=116625&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-116625
 ]

ASF GitHub Bot logged work on BEAM-4645:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Jun/18 21:41
            Start Date: 27/Jun/18 21:41
    Worklog Time Spent: 10m 
      Work Description: aaltay closed pull request #5770: [BEAM-4645] Cleanup 
docker images on failure
URL: https://github.com/apache/beam/pull/5770
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sdks/python/container/run_validatescontainer.sh 
b/sdks/python/container/run_validatescontainer.sh
index de99535d8bc..e4da78326aa 100755
--- a/sdks/python/container/run_validatescontainer.sh
+++ b/sdks/python/container/run_validatescontainer.sh
@@ -55,6 +55,14 @@ docker images | grep $TAG
 # Push the container
 gcloud docker -- push $CONTAINER
 
+function cleanup_container {
+  # Delete the container locally and remotely
+  docker rmi $CONTAINER:$TAG || echo "Failed to remove container"
+  gcloud --quiet container images delete $CONTAINER:$TAG || echo "Failed to 
delete container"
+  echo "Removed the container"
+}
+trap cleanup_container EXIT
+
 # Virtualenv for the rest of the script to run setup & e2e test
 virtualenv sdks/python/container
 . sdks/python/container/bin/activate
@@ -82,8 +90,4 @@ python setup.py nosetests \
     --sdk_location=$SDK_LOCATION \
     --num_workers=1"
 
-# Delete the container locally and remotely
-docker rmi $CONTAINER:$TAG || echo "Failed to remove container"
-gcloud --quiet container images delete $CONTAINER:$TAG || echo "Failed to 
delete container"
-
 echo ">>> SUCCESS DATAFLOW RUNNER VALIDATESCONTAINER TEST"


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 116625)
    Time Spent: 40m  (was: 0.5h)

> Docker images not cleaned up when run_validatescontainer.sh fails
> -----------------------------------------------------------------
>
>                 Key: BEAM-4645
>                 URL: https://issues.apache.org/jira/browse/BEAM-4645
>             Project: Beam
>          Issue Type: Bug
>          Components: build-system
>    Affects Versions: 2.6.0
>            Reporter: Alan Myrvold
>            Assignee: Alan Myrvold
>            Priority: Minor
>          Time Spent: 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to