publish: remove the images this job built after pushing them (noel/infra#2151) #23

Open
noel wants to merge 1 commit from claude/publish-image-cleanup into main
Owner

The publish job (ci-protected) will also run on the shared trusted VM from noel/infra#2151 step 7, where Docker and its disk persist across jobs and the janitor only prunes dangling images. Each publish would leave its uniquely tagged image behind.

scripts/publish-image.py now runs docker image rm <IMAGE:tag> for exactly the reference it built, after the push and deployment proposal, and also when the build, push or proposal fails (try/finally). Removal is best effort: a failure logs one line and never fails the job. Nothing else is pruned. The credential-free validate build gets the same cleanup.

Tests: python3 -B -m unittest discover -s scripts/tests -v passes (39 tests, 1 skipped as before), including a new one for removal after push, after a failed push or build, and a failed removal that leaves the job green.

The `publish` job (`ci-protected`) will also run on the shared trusted VM from noel/infra#2151 step 7, where Docker and its disk persist across jobs and the janitor only prunes dangling images. Each publish would leave its uniquely tagged image behind. `scripts/publish-image.py` now runs `docker image rm <IMAGE:tag>` for exactly the reference it built, after the push and deployment proposal, and also when the build, push or proposal fails (try/finally). Removal is best effort: a failure logs one line and never fails the job. Nothing else is pruned. The credential-free validate build gets the same cleanup. Tests: `python3 -B -m unittest discover -s scripts/tests -v` passes (39 tests, 1 skipped as before), including a new one for removal after push, after a failed push or build, and a failed removal that leaves the job green.
publish: remove the images this job built after pushing them (noel/infra#2151)
Some checks failed
Supply-chain scan / Supply-chain scan (pull_request_target) Failing after 14s
Build / validate (pull_request) Successful in 2m32s
Build / publish (pull_request) Has been skipped
439a6b5849
Some checks failed
Supply-chain scan / Supply-chain scan (pull_request_target) Failing after 14s
Build / validate (pull_request) Successful in 2m32s
Required
Details
Build / publish (pull_request) Has been skipped
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'claude/publish-image-cleanup:claude/publish-image-cleanup'
git switch 'claude/publish-image-cleanup'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
noel/photostack!23
No description provided.