-
Notifications
You must be signed in to change notification settings - Fork 166
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
cmd-cloud-prune: Prune images for builds #3867
Conversation
f54c4fc
to
cd7ceef
Compare
One question pertaining to the images pruning is whether we should update the |
cd7ceef
to
9846f87
Compare
9846f87
to
67ee09e
Compare
67ee09e
to
dd7cd72
Compare
I think we should keep them for historical reference. It's also safer to not have to touch other files in s3 (I don't want to get it wrong). |
Can you open a corresponding PR to the pipeline that proposes updates to the gc-policy.yaml based on these changes? I think it will help to illustrate and drive the review process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial round. I've got just a little left to do but will have to pick it up later.
I thought the same. Ideally, we shouldn't modify meta.json to ensure it's safe and to minimize updates to S3. |
|
6875cfe
to
33575de
Compare
NOTE: I don't want to make the following suggested change in this PR. If we did decide to do it I'd propose it for a separate PR after this one merges. Ultimately I think it may be better here to iterate over builds at the highest level
rather than how it is now. A few reasons why:
|
33575de
to
af972a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. One change needed.
# i.e. there may be additional images we need prune | ||
previous_images_kept = previous_cleanup.get("images-kept", []) | ||
if set(images_to_keep) == set(previous_images_kept): | ||
print(f"Build {build_id} has already had {action} pruning completed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're missing the key piece:
print(f"Build {build_id} has already had {action} pruning completed") | |
print(f"Build {build_id} has already had {action} pruning completed") | |
continue |
Extend the garbage collection to the images and whole builds. We will prune all the images apart from what is specified in the images_keep list for each stream in gc-policy.yaml. For pruning the whole builds, we will delete all the resources in s3 for that build and add those builds under tombstone-builds in the respective builds.json
af972a9
to
20e0c3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Let's merge this and then discuss if we think it's worth a followup for the proposal in #3867 (comment) or not.
Extend the garbage collection to the
images
for the builds. We will prune all the images apart from what is specified in theimages_keep
list for each stream ingc-policy.yaml