Repository navigation
Prune Sibyl images that no deployment uses - #49
Merged
Merged
Conversation
Each update pulls a new tag of every Sibyl image, and Podman kept the old ones: 179 images and 42 GB reclaimable on the test host. image-prune keeps the tags in /usr/share/sibyl/image-tag of every bootc deployment, so a rollback still has its images, and removes every other ghcr.io/diffsec/sibyl-* tag, then untagged images that no container uses. Images of other stacks stay. sibyl-image-prune.timer runs it 15 minutes after boot and daily. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Each update pulls a new tag of every Sibyl service image, and Podman keeps the old tags. On the test host,
podman system dfreports 179 images, with 42.37 GB reclaimable.The change
/usr/libexec/sibyl/image-prunereads/usr/share/sibyl/image-tagfrom every bootc deployment: booted, rollback and staged. It keeps theghcr.io/diffsec/sibyl-*images with those tags and their backend variants, such as-hipand-vulkan. A rollback therefore needs no download.ghcr.io/diffsec/sibyl-*tag, then runspodman image prune, which removes only untagged images that no container uses. It does not touch other images, such as those of the stacks that Arcane runs.--dry-runlists what it would remove and changes nothing.sibyl-image-prune.timerruns it 15 minutes after boot and then daily, at idle I/O priority.Verification
internal/hostctl/prune_test.goruns the script with a fakepodman. It tests the kept tags and variants, a tag that only starts with a kept tag (sha-newer), an image in use, other repositories, no deployment, a bad tag file and the dry run. Removing the variant match fails the test.--dry-runkeepssha-18c6914andsha-0e719a2and lists 133 tags. It removed nothing, because a training run is in progress there.bootc container lintpasses 14 checks.go vet,go test -race,golangci-lint(0 issues) andshellcheckpass.🤖 Generated with Claude Code