-
Notifications
You must be signed in to change notification settings - Fork 170
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
Prune update #839
Prune update #839
Conversation
Woah, that's a lot of commits.
Awesome! 👍 Can we start with splitting this out into some prep PRs with fewer changes? (Roughly keeping the "new features" here, and splitting out the "cleanups", both loosely defined :) ). |
Definitely agree on splitting out a prep cleanup PR first, looks like you already have things split up nicely! One other big topic is...before this, See also #823 which introduced some notion of "local state" vs "remote state" into cosa. I wonder if what we really want is |
Love the direction this is heading. One thing I'll mention is that we need a way to indicate that some builds should never be pruned; i.e. official releases. Maybe needs changes to Doesn't (and probably shouldn't) have to be fully implemented here, but something to keep in mind. |
Agree, the defaults are to keep all builds and remove just unreferenced builds (stored in S3, but not found in builds.json). Perhaps its worth splitting this into a dedicated subcommand instead? |
We can also use tags for that. The prune logic already saves those. Also slightly leaning towards a new command for this, though no strong opinion either way. |
3864f6f
to
2706252
Compare
Prune won't remove tagged builds
Implemented this - |
08eb5b3
to
aff4b07
Compare
One thing to keep in mind (doesn't/shouldn't be done in this PR) is that we also need "unreferenced tagged resource" pruning for e.g. AMIs. |
aeba046
to
8ed89a1
Compare
All issues fixed, PTAL |
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.
Just one comment, otherwise LGTM! Can you rebase, drop the debugging bits, and clean up the commit history?
.cci.jenkinsfile
Outdated
@@ -24,15 +24,34 @@ coreos.pod([image: 'registry.fedoraproject.org/fedora:30', privileged: true, kvm | |||
cosa_cmd("init https://github.com/coreos/fedora-coreos-config") | |||
cosa_cmd("fetch") | |||
cosa_cmd("build") | |||
cosa_cmd("kola run") | |||
//cosa_cmd("kola run") |
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.
Please drop this now that #879 landed
.cci.jenkinsfile
Outdated
// cosa_cmd("buildextend-openstack") | ||
// cosa_cmd("buildextend-vmware") | ||
// cosa_cmd("compress") | ||
// cosa_cmd("buildupload --dry-run s3 --acl=public-read my-nonexistent-bucket/my/prefix") |
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.
Also need to uncomment this before we merge.
#!/usr/bin/python3 -u | ||
|
||
''' | ||
This script removes previous builds. DO NOT USE on production pipelines |
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.
Mmmm. I think it's a bit more nuanced than that. For RHCOS we can prune bootimages not pinned by the installer, for example.
But...this gets to an interesting topic. I've been thinking we should explicitly copy/promote bootimages we want to pin to a separate "stream". But anyways, just noting this.
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.
Prune won't touch "tagged" builds - seems this field should be updated with pinned images used in installer
631adbc
to
c6fcef4
Compare
Are we happy with test results? I'm going to drop prune debug commit and squash into a series of commits |
c6fcef4
to
1a3fb5d
Compare
4da4bc0
to
db277a5
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.
Can we squash the commits down? How about just two:
- one that reworks
cmd-prune
+ auxiliary - one that introduces
cmd-remote-prune
db277a5
to
2b351b0
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.
Cool, this looks good to me. Thanks a lot for working on this! There are a few extraneous lines that need to be cleaned up, but not going to block on it.
Will leave it open for a bit for folks to have a chance to have a final look.
Just offhand, a few follow-up steps I see for
|
* Split "insert_build" helper out of cmd-prune * Rework cmd-prune in python * Add prune tests
This subcommand cleans up unreferenced builds on remote location. Currently only s3 buckets are implemented
2b351b0
to
ccec60d
Compare
This PR reworks
coreos-assembler prune
and adds new commands:bump_timestamp
used during the build to update builds.json timestampcleanup-bucket
to remove unreferenced builds in the bucketprune
is now python and removes old builds from build.json (this won't be started during build procedure)TODO:
Removed--skip-prune
option breaks RHCOS pipeline