gitea: configure registry package cleanup rules to cap per-host CI image churn #8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
CI/CD pipelines on
vh/skaldsong+vh/Worldtreepush a new SHA-pinned image per commit. Per-host docker layer caches accumulate indefinitely because nothing GCs them. Snapshot 2026-05-23:Operator's reasoning during the cleanup: docker-side rollback has never been used in production. Git rollback + re-deploy IS the recovery path. So per-host image retention is dead weight; the durable hedge belongs at the source (gitea registry).
Approach
Gitea v1.26.1 (current on
ana-docker) supports native Package Registry Cleanup Rules (per-owner per-type):/owners/{owner}/cleanup_rules(POST/PATCH/DELETE)[cron.cleanup_packages]in app.ini — verify enabled + schedule (default daily)Proposed rule shape:
vhcontainer(Docker registry)Open questions
vh/Worldtreecan have higher N thanvh/skaldsong.):latest,:main) — does the rule protect moving-tag images, or do we need explicit exclusions?docker image prune -a --forcenightly + gitea-side rule).Why this is the durable hedge
A per-host backup image (whether "keep last N tags" or
--until=Xh) only helps when registry is unreachable. Registry is in-fleet, so that's basically "gitea down" — at which point the whole CD chain is broken anyway. Centralizing retention at gitea means any host can re-pull historical SHAs without each host maintaining its own cache.Acceptance
vhowner settings for container packages with a defined retention policy.cron.cleanup_packages).tea packages list ...orcurl /v2/vh/<repo>/tags/list).persistent-memory.mdcapturing the chosen N / age cap so we don't re-debate next quarter.Related context
docker image prune -athat ran on ana-docker + corviduo-dev).Superseded by #9 — CD-driven version-tag mirror + per-release cleanup. The keep_pattern-based gitea cleanup rules in this issue assumed versioned tags would exist in the registry; investigation 2026-05-23 found they don't (every push gets only :sha). #9 fixes the upstream tagging problem AND introduces offsite durability for releases, replacing this approach entirely.