googlegenomics / gcp-variant-transforms

GCP Variant Transforms
Apache License 2.0
137 stars 55 forks source link

Integration test image deletion is not working #242

Open arostamianfar opened 6 years ago

arostamianfar commented 6 years ago

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
pgrosu commented 6 years ago

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

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

bashir2 commented 5 years ago

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.