gcp-variant-transforms icon indicating copy to clipboard operation
gcp-variant-transforms copied to clipboard

Integration test image deletion is not working

Open arostamianfar opened this issue 7 years ago • 2 comments
trafficstars

Just noticed that we have a lot of stale images in the repo and got curious whether image deletion is properly working. Verified that just running ./deploy_and_run_tests.sh does not delete the image. There is some error from gcloud, so not sure if it's related? Note that it does output "Deleting the test image from the registry", so likely the gcloud command is failing.

valid-4-0-gz ... ok
./deploy_and_run_tests.sh succeeded!
Removing integration test environment /tmp/tmp.paigF3efrl
Deleting the test image from the registry
Traceback (most recent call last):
  File "/usr/local/google/home/arostami/Downloads/google-cloud-sdk/lib/gcloud.py", line 88, in <module>
    main()
  File "/usr/local/google/home/arostami/Downloads/google-cloud-sdk/lib/gcloud.py", line 64, in main
    import traceback
ImportError: No module named traceback

arostamianfar avatar May 29 '18 15:05 arostamianfar

You might just need to export "CLOUDSDK_PYTHON_SITEPACKAGES=1".

See: https://cloud.google.com/sdk/crypto#cloudsdk_python_sitepackages1

pgrosu avatar May 29 '18 15:05 pgrosu

I just tried this once yesterday and it worked, i.e., the test image was deleted after the script was done (image tag test_2018-12-05-15-56-42 to be specific). That said, there are a lot of old images left in the Container Registry of the gcp-variant-transforms-test project. I think we should set time-to-live policies for test images but with a quick search I could not find how (maybe we can set TTLs on the GCS buckets holding these but that seems like an ugly solution). Setting TTL is useful because the test script has special flags not to delete the test image so it is good to make sure eventually after a month or two these are cleaned up.

bashir2 avatar Dec 06 '18 17:12 bashir2