Skip to content

Clean up cancelled GPU image builders - #923

Merged
bradhilton merged 2 commits into
mainfrom
hayek/cleanup-cancelled-image-builds
Sep 17, 2026
Merged

bradhilton merged 2 commits into
mainfrom
hayek/cleanup-cancelled-image-builds

Conversation

@bradhilton

@bradhilton bradhilton commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Cancelled image workflows can leave their remote BuildKit processes running and publishing to latest. During the main image failure investigation, run 35169703834 was already cancelled while its builder was still exporting; a second cancelled run also left its completed builder behind.

Give each CI builder a name derived from the workflow run and attempt, and delete that exact pod in an always() step. This provides cleanup even when cancellation kills the shell before the build script's EXIT trap completes.

Also wait for deletion before reusing a prewarm tag-check pod's name. Previously the script could apply to a terminating pod and then spend its ten-minute readiness timeout waiting for that pod to become ready. The replacement uses the existing bounded deletion helper.

Validation: parsed the workflow YAML, checked every shell step and the build script with bash -n, ran the image build-context test, and executed the cleanup step against a recording kubectl stub to verify the context, namespace, exact pod name, and nonblocking deletion. The two confirmed orphaned builders were stopped during the investigation.

@bradhilton
bradhilton merged commit 450d529 into main Sep 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant