Skip to content

chore(deploy): remove local images after push to bound runner disk#712

Open
jaeyunha wants to merge 1 commit into
mainfrom
chore/docker-image-cleanup
Open

chore(deploy): remove local images after push to bound runner disk#712
jaeyunha wants to merge 1 commit into
mainfrom
chore/docker-image-cleanup

Conversation

@jaeyunha

Copy link
Copy Markdown
Member

Why

The shared Mac mini self-hosted runner (forever / opensend / exponential all share one Docker daemon) keeps filling its disk. scripts/deploy-ecs.sh builds <ecr>/exponential-{api,web}:<sha> locally then pushes, but never removes the local copies. docker image prune only reaps dangling images, so these tagged per-commit builds leak disk on every deploy.

Fix

A best-effort EXIT trap that deletes this deploy's own api + web image tags after the run. Runs on EXIT (fires even if a later step fails); || true so it can never fail the deploy. The build/push/ECS logic is untouched.

Mirrors the same fix already merged in forever-agent#420 (verified working on a live deploy).

Validation

  • bash -n scripts/deploy-ecs.sh
  • Trap references only ECR_REGISTRY/APP_NAME/IMAGE_TAG, all defined before it.

Heads-up

This path (scripts/deploy-ecs.sh) is in the deploy workflow's paths: filter, so merging will trigger a deploy — expected and safe.

🤖 Generated with Claude Code

The shared Mac mini self-hosted runner (forever/opensend/exponential share
one Docker daemon) keeps filling its disk. deploy-ecs.sh builds
`<ecr>/exponential-{api,web}:<sha>` locally then pushes, but never removes the
local copies — and `docker image prune` only reaps *dangling* images, so these
*tagged* per-commit builds leak disk every deploy.

Add a best-effort EXIT trap that deletes this deploy's own api+web image tags.
Runs on EXIT so it fires even if a later step fails; `|| true` so it can never
fail the deploy. Mirrors the fix already merged in forever-agent#420.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jaeyunha jaeyunha added the human Protected: human-owned issue or PR; Conductor must not pick up unless explicitly released. label Jun 17, 2026
@jaeyunha

Copy link
Copy Markdown
Member Author

Controller disposition for current head 2830707: human-gated; do not merge in this ordinary staging tick.

Evidence:

  • PR chore(deploy): remove local images after push to bound runner disk #712 targets main directly and changes scripts/deploy-ecs.sh; the PR body notes that merging this path triggers a deploy.
  • Diff is one deploy-script change and cheap gates passed: git diff --check origin/main...pull/712/head and bash -n scripts/deploy-ecs.sh.
  • No GitHub checks are reported.

Blocker:

  • This is production deploy behavior on main, not an ordinary implementation PR for staging; it needs explicit owner routing.

[Jaeyun Ha] Should this deploy-runner disk cleanup be retargeted/rebuilt through the staging release flow, or is it approved as a direct main hotfix/deploy change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human Protected: human-owned issue or PR; Conductor must not pick up unless explicitly released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant