Commit f775fe0
authored
improvement(ci): bound docker layer caches and right-size ten runners (#7210)
The Blacksmith sticky disks backing our docker layer caches had no eviction
policy. setup-docker-builder skips pruning entirely unless max-cache-size-mb
is set, and BuildKit's own GC is time-based only (8 days unused), so on a repo
that builds this often nothing ever aged out: app.Dockerfile/linux-amd64 hit
351 GB within a day of being created, and realtime — an image under 300 MB —
sat at 249 GB. Layer caches alone were 920 GB across ten disks.
Cap them per image via a cache_mb matrix field, alongside the bs_runner field
that already encodes per-image sizing. The app image keeps 100 GB (several
generations over its working set of ~34 layers plus monorepo apt/bun cache
mounts); everything else takes the 25 GB default, which is still 4x the
tightest working set in the matrix (pii, whose spaCy models are ~2.2 GB).
The fallback lives in the composite action rather than an input default,
because an unset matrix key arrives as the empty string and would bypass a
default — silently restoring unbounded growth on any row that forgot the field.
Runner sizes follow measured CPU and memory percentiles over 30 days:
- CodeQL splits per language. javascript-typescript peaks at 19.5 GB so it
stays on 8 vCPU; actions peaks at 1.3 GB and averages 22% CPU over a 39s
median run, and drops to 4 vCPU.
- The pii and realtime image builds drop to 2 vCPU. Both already ran on 8 vCPU
earlier in the window, so the 8->4 step is measured, not modelled: realtime
went 52s -> 51s and pii 24s -> 27s.
- Five desktop release jobs drop to 2 vCPU. They peak under 0.4 GB and finish
in 4-13s.
None of these sit on their group's critical path — each has 190-275s of slack
behind an app build that dominates it — so wall-clock is unchanged.
Those five desktop jobs also hardcoded a Blacksmith label with no CI_PROVIDER
fallback, against the invariant stated at the top of ci.yml. In GitHub
break-glass mode they would have sat in `queued` forever; they now fall back
like every other job.
Left alone deliberately: the 16 vCPU app builds (memory-bound, and 16 vCPU
measured 2.1x faster and 6% cheaper than 8 vCPU), Lint and Test (CPU-bound,
62% of the run above 80%), and the push-path Build App (build-amd64 has no
needs:, so it is what stops a migration applying for a build that cannot ship).1 parent 498cdb6 commit f775fe0
3 files changed
Lines changed: 53 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
45 | 64 | | |
46 | 65 | | |
47 | 66 | | |
48 | 67 | | |
49 | 68 | | |
| 69 | + | |
50 | 70 | | |
51 | 71 | | |
52 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
168 | 175 | | |
| 176 | + | |
169 | 177 | | |
170 | 178 | | |
171 | 179 | | |
| |||
176 | 184 | | |
177 | 185 | | |
178 | 186 | | |
179 | | - | |
| 187 | + | |
180 | 188 | | |
181 | 189 | | |
182 | 190 | | |
183 | | - | |
| 191 | + | |
184 | 192 | | |
185 | 193 | | |
186 | 194 | | |
| |||
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
| 225 | + | |
217 | 226 | | |
218 | 227 | | |
219 | 228 | | |
| |||
280 | 289 | | |
281 | 290 | | |
282 | 291 | | |
| 292 | + | |
283 | 293 | | |
284 | 294 | | |
285 | 295 | | |
| |||
293 | 303 | | |
294 | 304 | | |
295 | 305 | | |
296 | | - | |
| 306 | + | |
297 | 307 | | |
298 | 308 | | |
299 | 309 | | |
300 | 310 | | |
301 | | - | |
| 311 | + | |
302 | 312 | | |
303 | 313 | | |
304 | 314 | | |
| |||
382 | 392 | | |
383 | 393 | | |
384 | 394 | | |
| 395 | + | |
385 | 396 | | |
386 | 397 | | |
387 | 398 | | |
| |||
484 | 495 | | |
485 | 496 | | |
486 | 497 | | |
| 498 | + | |
487 | 499 | | |
488 | 500 | | |
489 | 501 | | |
| |||
522 | 534 | | |
523 | 535 | | |
524 | 536 | | |
| 537 | + | |
525 | 538 | | |
526 | 539 | | |
527 | 540 | | |
| |||
675 | 688 | | |
676 | 689 | | |
677 | 690 | | |
678 | | - | |
| 691 | + | |
679 | 692 | | |
680 | 693 | | |
681 | 694 | | |
| |||
724 | 737 | | |
725 | 738 | | |
726 | 739 | | |
727 | | - | |
| 740 | + | |
728 | 741 | | |
729 | 742 | | |
730 | 743 | | |
| |||
813 | 826 | | |
814 | 827 | | |
815 | 828 | | |
816 | | - | |
| 829 | + | |
817 | 830 | | |
818 | 831 | | |
819 | 832 | | |
| |||
837 | 850 | | |
838 | 851 | | |
839 | 852 | | |
840 | | - | |
| 853 | + | |
841 | 854 | | |
842 | 855 | | |
843 | 856 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
74 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
| |||
0 commit comments