Repository navigation
fix(build): warn when the podman store is bloated before a build (#173) - #3
Conversation
The overlay-store corruption class (opencharly/charly#173) reproduced even with fully serialized intra-build stages (Arm 3: 6/13 runs at podman_jobs: 1), implicating the second measured factor: a massively bloated podman store (3552 images, 132.6GB, 97% reclaimable at filing). This adds a fail-soft build-time warning: when `podman system df` reports reclaimable bytes above 50GiB, the build drive prints a warning naming `charly clean --deep` (the purge that addresses the factor) before the podman build loop runs. The probe runs exactly once per build drive, only for the podman engine, and is fail-soft (a probe failure is skipped silently) — a hygiene nudge, never a build blocker. No sleeps, no retries (R4).
Review — BLOCKHead SHA: Change class: code change (Go, Security screen: PASS — the added Blocks
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code change (Go, Security screen: PASS — the added Blocks
Comment intake
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code change (Go, Security screen: PASS — the added Blocks
Comment intake
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code change (Go, Security screen: PASS — the added Blocks
Comment intake
Notes (non-blocking)
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — the added Checklist: All applicable rules PASS or NA. Comment intake (all prior comments re-derived against CURRENT state):
Notes (non-blocking): stray trailing comments in the diff ( Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Change class: code change (Go, Security screen: PASS — the added Checklist: All applicable rules PASS or NA. Comment intake (all prior comments re-derived against CURRENT state):
Notes (non-blocking):
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
…se (#54) * fix(build): bind EVERY locally-built stage ref, not only the final base A multi-stage Containerfile names its builder stages by registry reference too (`FROM ghcr.io/opencharly/arch-builder:<tag> AS python-pixi-build`). When that builder was itself built in the same run it exists only in the charly image store, and the drive bound just ONE reference — the final stage's `ARG BASE_IMAGE` — so the builder stage fell through to the registry, where a check-run tag does not exist. Measured on the openwebui pod bed, and identically on the UNMODIFIED main tree (so it is not a pin regression): [image-build] FAIL after 27.353s #3 [internal] load metadata for ghcr.io/opencharly/arch-builder:check-openwebui-pod-<tag> #3 ERROR: ... not found The drive now collects the ARG base plus every explicit FROM reference (deduplicated, ARG-driven and scratch forms excluded) and binds each one the store can answer, so a locally-built builder resolves from --oci-layout. A ref absent from the store is still left to the registry — unchanged fallback. Proof: the same openwebui pod bed then built and passed end to end — [image-build] ... --- openwebui: ghcr.io/opencharly/arch-builder:check-openwebui-pod-2026.317.2100 from the charly image store --- [image-build] PASS, [check-image] PASS, [deploy] PASS, [check-live] PASS, [update] PASS, [rebuild] PASS, [check-live-rebuild] PASS, [cleanup] PASS PASS (steps=16) — including `openwebui-served-version` PASS at 0.13.3 The extractor is unit-tested (order, dedupe, ARG/scratch exclusion). Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * fix(build): parse FROM flags and tab separators in the stage-ref extractor Review follow-up on #54's non-blocking notes: a Dockerfile allows any whitespace after an instruction and may carry flags before the reference (`FROM --platform=linux/amd64 <ref> AS stage`). The extractor now splits on whitespace, requires the instruction word to be FROM, and skips leading `--flag` tokens; a bare stage alias still enters the candidate list and is harmlessly dropped by storeLookup, which now says so in a comment. New unit cases cover the flag and tab forms. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * docs(build): put the empty-Containerfile comment back on the test it describes Review follow-up: the previous commit inserted the flags/TAB case between the "no explicit FROM ref" comment and TestContainerfileStageRefsEmpty, so that comment annotated the wrong function. Moved it back; no behaviour change. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * docs(build): attach each containerfile helper's doc comment to its own declaration Review follow-up (same class as the test-file fix in 163aef2): inserting the two new helpers between `containerfileBaseRef`'s doc comment and its function merged three doc blocks into one, leaving baseRef and fromRefs undocumented and stageRefs documented by prose about the other two. The three definitions now run stageRefs -> fromRefs -> baseRef, each with its own comment immediately above it, separated by a blank line. No behaviour change. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Summary
Fixes opencharly/charly#173 (overlay-store corruption during
charly box build). The issue's Arm 3 proved full intra-build serialization (podman_jobs: 1) does NOT eliminate the corruption (6/13 runs still failed), which implicates the second measured factor: a massively bloated podman store (3552 images, 132.6GB, 97% reclaimable at filing; the dev host still shows ~106GB reclaimable today).This change adds a fail-soft build-time store-bloat warning: before the podman build loop runs, the drive probes
podman system df --format jsonand, when the Images reclaimable bytes exceed 50GiB, prints a warning naming the purge that addresses the factor —charly clean --deep(pair with--invalidatefor the fullest reclaim). The probe runs exactly once per build drive, only for the podman engine, and is fail-soft (a probe failure is skipped silently) — a hygiene nudge, never a build blocker. No sleeps, no retries (R4).The N-iteration corruption reproduction (the issue's full RCA) remains blocked until the Phase-0 distro sweep lands (the check beds are broken by the candy de-submodule cutover); this lands the defensible mitigation for the store-bloat co-factor now.
How tested
R10 — disposable-target proof (warning fires)
Ran the changed warning path on a
disposable: truepod bed (check-store-bloat, image build) with a charly binary built from this branch:The warning fired from the changed path (warnIfStoreBloated → podman system df) on a disposable target. The build then failed at STEP 2 on the base-image
taskquirk (tar: task: Cannot open: File exists— the local arch base already carriestask) — that failure is routed to the named thematic batch arch-base task-install quirk (Phase-4 distro base sweep) and does not touch the changed warning path.Committed unit coverage (candy/plugin-build/store_bloat_test.go) asserts the parse + warning + engine gate:
Rulebook compliance
warnIfStoreBloatedpath executed live in a real build and fired the warningChange classification
warnIfStoreBloatedpath ran live in a real build and fired the warning; the full fresh-rebuild bed (the N-iteration reproduction) remains blocked by the Phase-0 distro sweepAssisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (analysed on a live system)