Commit 5036d22
committed
ci(ocapn-guile-interop): cache the Guix runtime store across runs
Iteration III of the guix-CI resilience pattern. PR #82 (iteration I)
established the two-substitute-server pattern and the installer-tarball
cache; PR #255 (iteration II) reordered the substitute URLs and widened
the polling and timeout windows after a Bordeaux outage exposed the
"first server unreachable" slow path. The 2026-05-14 outage exposed a
third failure mode that neither prior iteration addressed: both
substitute servers degraded simultaneously, with the result that the
daemon could not resolve the runtime closure (guile + fibers + websocket
+ gnutls + gcrypt) from either upstream. Reorder and wider timeouts did
not help because no amount of waiting brings up a server that is down.
The existing cache step amortizes only the installer tarball, not the
runtime store the daemon resolves at runtime. Each run pays the full
substitute-fetch cost end-to-end, and a both-servers-degraded day means
that cost cannot be paid at all.
This change adds a second `actions/cache` step that caches the daemon's
runtime store (`/gnu/store`) together with the daemon database
(`/var/guix/db`). Both paths are root-owned with strict permissions, so
the cache targets a runner-owned staging directory containing a zstd
tarball of the two store paths; paired `sudo tar` shell steps wrap the
actual extract and create, matching the install step's existing
`sudo tar --extract` pattern. On a cache hit the daemon's next
`guix build` finds the resolved closure already on disk and the daemon
DB already records it as valid, so the substitute round-trip is
short-circuited entirely. A degraded-substitute-server day no longer
blocks the workflow's runtime path.
The cache key includes the pinned Guix version (a version bump may
change the on-disk DB schema) and a hash of the workflow file (the
package set and daemon configuration both live in the workflow, so any
change to either forces a fresh snapshot). A `restore-keys` prefix lets
a workflow edit that does not actually invalidate the store (a comment
tweak, a timeout bump) still seed from the prior snapshot and re-save
at job end.
The daemon is stopped across the restore extract so the on-disk store
and the daemon's in-memory view of it cannot diverge mid-flight; a
divergence would surface later as missing-store-item errors from
`guix build`. The snapshot step at the end does not need to stop the
daemon because tar captures the SQLite DB as a point-in-time copy at
the filesystem layer.
The change is additive to iteration II's reorder + widen; both
mitigations stay in place and remain load-bearing for the
one-server-degraded case where the cache key changes (a workflow edit
that flushes the snapshot leaves the daemon dependent on substitute
fetches for the next run).1 parent ba26f4c commit 5036d22
1 file changed
Lines changed: 98 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
101 | 136 | | |
102 | 137 | | |
103 | 138 | | |
| |||
191 | 226 | | |
192 | 227 | | |
193 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
194 | 261 | | |
195 | 262 | | |
196 | 263 | | |
| |||
268 | 335 | | |
269 | 336 | | |
270 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
271 | 369 | | |
272 | 370 | | |
273 | 371 | | |
| |||
0 commit comments