Repository navigation
Commit 6597f8e
committed
improvement(ci): measure where the layer-cache disk actually goes
The layer cache cap is enforced against `buildctl du`, and on the busiest disk
that number no longer describes the disk. In the same job, the app image's amd64
sticky disk reports 224.9 GB while du reads 65.87 GB — so the prune correctly
does nothing, being already under its 100 GB cap by its own accounting, and the
disk keeps growing. The same Dockerfile's arm64 disk, which builds far less
often, reads 88.04 GB against an 86.4 GB disk: no gap at all. The divergence
tracks build frequency, not image content.
The mount log ("Filesystem free space after mount") shows the filesystem really
is holding those bytes, so this is not a thin-provisioned volume failing to
release freed blocks — there are real files that du's total does not cover. The
`RUN --mount=type=cache` dirs (apt, bun, npm, next, turbo) are the candidates,
being a different record class from the layer cache `--keep-storage` trims.
Those two causes need opposite fixes, and neither is proven from the logs
available today, so this adds the three readings that separate them rather than
a speculative fix: df for the filesystem's own view, a du summary by record type
for whether cache mounts are accounted at all, and a bounded directory walk to
locate the bytes if they are not.
All best-effort and guarded. Composite steps run under `bash -e -o pipefail`,
where a failing command in an assignment or pipeline aborts the step and fails
the build — the bug that broke an app image build in #7252. Verified by running
this block under those exact flags with every command failing: it reaches the end
and exits 0. Shellcheck clean.1 parent a5badf0 commit 6597f8e
1 file changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
166 | 196 | | |
167 | 197 | | |
168 | 198 | | |
| |||
0 commit comments