Commit db25446
authored
improvement(ci): bound the local Turborepo cache (#7214)
Turborepo's local cache eviction is opt-in until 3.0, so without cacheMaxAge and
cacheMaxSize the filesystem cache grows forever. In CI each cache dir lives on a
Blacksmith sticky disk that is mounted many times a day, so it never idles long
enough for Blacksmith's own 7-day inactivity purge to fire, and one cache-missing
app build writes a ~400 MB artifact. The build cache disk reached 206 GB over 43
days — roughly 4.8 GB/day of sediment — at ~$0.51/GB-month.
Size is the real bound; age is hygiene. A cache hit only happens when a task's
input hash is unchanged, which recurs within hours, not weeks, so nothing written
days ago can ever be read again — the sibling PR-keyed disk does the same job in
30 GB. The cache still earns its keep: the app build hits ~17% of the time and a
hit saves ~7 minutes, so this is a ceiling, not a removal. That distinguishes it
from the Turbopack persistent cache, which was removed because it measured 3.2x
SLOWER; this one is measurably faster, just unbounded.
Set in turbo.json rather than per-step env vars so there is one source of truth
and turbo validates it. Verified against the installed 2.9.14: both keys are in
its schema, turbo parses them, and the task hash is byte-identical with and
without them, so enabling eviction does not invalidate the existing cache.1 parent dca1fd6 commit db25446
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
4 | 21 | | |
5 | 22 | | |
6 | 23 | | |
| |||
0 commit comments