Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not delete old unversioned images in CloudBuild #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ steps:
- --tag=us-docker.pkg.dev/$PROJECT_ID/tools/rcran-build:$BUILD_ID
- .

# Delete old images
- id: 'delete-old-images'
name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
set -e
gcloud container images list-tags us-docker.pkg.dev/$PROJECT_ID/tools/rcran-build:$BUILD_ID --filter="NOT tags:latest timestamp.datetime < -P6M" --format='get(digest)' --limit 100 | xargs -I {} gcloud container images delete us-docker.pkg.dev/$PROJECT_ID/tools/rcran-build@{} --quiet --force-delete-tags
gcloud container images list-tags gcr.io/kaggle-images/rcran --filter="NOT tags:latest timestamp.datetime < -P6M" --format='get(digest)' --limit 100 | xargs -I {} gcloud container images delete gcr.io/kaggle-images/rcran@{} --quiet --force-delete-tags

# Pushing the intermediate image can be useful to debug test failures.
- id: 'intermediate-push'
waitFor: ['build']
Expand Down Expand Up @@ -67,4 +56,4 @@ timeout: 86400s
substitutions:
_TAG: testing # Change to latest for production.

tags: ['rcran', 'notification']
tags: ['rcran', 'notification']