Dan Mick [Sat, 15 Nov 2025 00:00:40 +0000 (16:00 -0800)]
review comments:
- explain --stragglers a bit in help text
- add re match group names and use them
- use variables for URLs in messages
- dryrun -> dry-run
- remove dead code
Dan Mick [Tue, 11 Nov 2025 00:17:18 +0000 (16:17 -0800)]
quay-pruner: completely overhaul prune-quay.py
Pruning had stopped working (up to >26000 image tags), and the
reasons were many; one, pruning's always been less deterministic
than I'd hope; two, when I switched us to ceph.git/container for
building images, I mistakenly changed the format of the 'fulltag'
(no longer has a short sha1 in it) and that was sort of driving
the pruning process. three, I suspect some of the newer flavors
etc. were slipping through the cracks.
So here's an attempt to fix all that by changing the algorithm
fundamentally; now, tags of a certain manifest digest are considered
at the same time, and their sha1 checked in shaman as usual (but
only their sha1); if it's found, the tags are all left, and if not,
they're all removed. This should be cleaner, faster, and more
reliable.
Also refactored a lot of the worker routines to util.py so I could
add some helper/debug/info scripts:
get-tagdates.py generates JSON showing tag-to-age for examining the
state of things
delete-tags.py takes tags on the CLI to delete, or can be invoked
with '--stragglers <age>' to remove anything older than age (as long
as it's not in shaman or seems like it might be a 'distinguished' build
(with recent release names in its name)).
prune-quay.py also now reports summary statistics of its operation.