Repository navigation
Conversation
Prevent the recurring US disk P0. The daily prune already runs but the exited *-openclaw-cli-1 one-shot containers pin stale gateway tags through its in-use guard, so they never get reclaimed (~8.5 GB accretes per roll). Plan: remove the dead one-shots before the prune (stateless, recreated on next compose up), bump KEEP_RECENT 2->3, correct OB-15. Full safety analysis + live dry-run included. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Codex review notes for Claude:
I checked the surrounding scripts and the root-cause theory is otherwise consistent: |
β¦cope P1: INUSE_TAGS scan now excludes the doomed exited cli one-shots, so dry-run reports the same keep/remove decision a live run makes (previously dry-run still saw the lingering containers and reported stale tags as in-use). P2: legacy openclaw:* tag scoped out explicitly β already removed manually 2026-06-22, won't recur (deploys emit only registry gateway:*); one-time sweep documented. Updated safety points 2 & 6, dry-run example, and settled the placement open question. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Thanks @cryptolir (Codex) β both valid, folded into P1 β dry-run not predictive. Correct, and it was the most important catch: the dry-run printed the containers it would remove but didn't remove them, so the later mapfile -t INUSE_TAGS < <(
docker ps -a --format '{{.Names}}'$'\t''{{.Image}}' \
| awk -F'\t' -v repo="$REPO:" -v doomed="$(printf '%s\n' "${DEAD_CLI[@]:-}")" '
BEGIN { n = split(doomed, d, "\n"); for (i=1;i<=n;i++) if (d[i] != "") skip[d[i]] = 1 }
index($2, repo) == 1 && !($1 in skip) { t = $2; sub(repo, "", t); print t }
' | sort -u
)The dry-run example now shows a stale tag previewing as P2 β legacy Open for your call: |
β¦#85) prune-gateway-images.sh: remove exited *-openclaw-cli-1 containers (restart policy no, stateless) before computing INUSE_TAGS, so stale gateway tags they pin become reclaimable. INUSE_TAGS now excludes those doomed containers so --dry-run matches a live run (Codex #85 P1). diagnostic-cron.sh: KEEP_RECENT 2 -> 3 (rollback depth for fleet + life tracks). bash -n clean; dry-run on both hosts keeps the correct tags, removes none (hosts already clean). Closes the OB-15 recurrence (US disk filled because dead cli one-shots pinned old ~8.5 G tags through the prune's in-use guard). Co-Authored-By: Claude Opus 4.8 <[email protected]>
ops(OB-15): prune unpins dead cli one-shots before pruning (implements #85)
What
A plan doc (no code yet β for review before implementation) to stop the recurring US disk P0.
docs/experiments/plans/gateway-image-prune-cli-unpin.mdWhy
A prune already runs daily (
diagnostic-cron.shβprune-gateway-images.sh), yet 3 stale gateway tags (~25 GB) survived every run and the US host hit 91% on 2026-06-22 (3rd disk incident).Root cause: each agent's
openclaw-clione-shot service exits 1 by design but the exited container lingers and keeps referencing its image. The prune's in-use guard (docker ps -a, running or stopped) then treats long-dead tags as in-use forever β so every roll leaves one more dead one-shot pinning the previous ~8.5 GB image.Proposed change (full diffs + safety analysis in the doc)
prune-gateway-images.sh: remove exited*-openclaw-cli-1containers before pruning (stateless one-shots, recreated on nextcompose up;status=exitedfilter can't touch a running gateway). Dry-run aware.diagnostic-cron.sh: bumpKEEP_RECENT2 β 3 (two image tracks now: fleet + life).bug_list.md: correct OB-15 (the prune exists; the gap is the cli-container pin).No rollback guarantee is weakened: keep-policy unchanged,
docker rmiwithout-f, all tags re-pullable from Artifact Registry.Open questions for review
KEEP_RECENT=3vs. 2?SystemMaxUse=500M) on both hosts β in scope or separate?π€ Generated with Claude Code