Commit f39b072
committed
[CELL-293]
- feat(cli): add `cell nix-store push` + `cell nix-store pull` — streams a /nix volume to/from an OCI registry as a single tar+gzip layer. Push uses `pkg/v1/stream.NewLayer` to upload uncompressed-tar stdin straight to the registry's chunked-upload API with the digest computed incrementally (no temp file, no disk staging — peak runner disk drops from ~11 GB to ~64 KB). Pull resolves the manifest, streams the last layer's gunzipped bytes, and extracts into either a Docker volume (`--volume`) or a host directory (`--dir`), with `--strip-components` matching `tar --strip-components=N` (defaults to 1 — workflow's prior behavior). The on-wire layer is always single-gzipped: deterministic regardless of base-image schema, eliminates the `crane append --new_layer -` double-gzip + disk-buffer failure modes that caused six CELL-292 iterations
- fix(infra): rewrite the cache-publish step in `.github/workflows/build.dev.yml` to pipe uncompressed tar into `./bin/cell nix-store push` instead of staging an 11 GB tarball to `$RUNNER_TEMP` for `crane append --new_layer FILE`. Workflow now publishes via the same Go binary the local test invokes, so a green `task test:cache` is a faithful regression net for this step
- fix(infra): rewrite both pull paths in `.github/workflows/build.dev.yml` (docker-build warm-start + docker-test stream-pull) to use `./bin/cell nix-store pull --volume VOL` instead of `crane blob | gunzip | docker run alpine tar -x --strip-components=1`. The docker-test job now builds the cell binary too (matching docker-build), so push and pull go through identical bytes-on-disk code
- fix(infra): port the same cache pipeline to `.github/workflows/build.release.yml` — replace the broken `actions/cache@v4` step (the v1 design CELL-292 abandoned because `_data` is root-owned and the cache action silently saved an empty archive) with `cell nix-store pull` hydrate + `cell nix-store push` republish. Release builds now share the `nix-cache2-${arch}-${HASH}` tag with dev builds, so any release that runs after a green dev build hits a populated cache instead of starting from an empty /nix volume
- test(nixstore): table-driven unit tests against go-containerregistry's in-memory OCI registry (`internal/nixstore/{pull,push}_test.go`) — covers byte-for-byte round-trip, last-layer-only extraction, error paths on bad refs, and explicit assertion that the pushed layer is single-gzipped (`raw[0:2] == 1f8b` and `gunzip(layer)[0:4] != 1f8b`). 6/6 PASS
- test(integration): `test/cache_roundtrip_test.go` invokes `./bin/cell nix-store push|pull` via `exec.Command` instead of shell-piping `crane append`/`crane blob` — same binary as the CI workflow, so test ≡ production. End-to-end PASS: 198,643 files round-tripped byte-for-byte through the actual subcommandscell nix-store push|pull — replace crane CLI in the cache pipeline with native Go subcommands so the local test and CI workflow share one code path; encoding regressions can't recur silently1 parent 40df48e commit f39b072
8 files changed
Lines changed: 1101 additions & 157 deletions
File tree
- .github/workflows
- cmd
- internal/nixstore
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
169 | 167 | | |
170 | 168 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
176 | 172 | | |
177 | 173 | | |
178 | 174 | | |
| |||
264 | 260 | | |
265 | 261 | | |
266 | 262 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
299 | 280 | | |
300 | 281 | | |
301 | 282 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | 283 | | |
322 | | - | |
| 284 | + | |
323 | 285 | | |
324 | 286 | | |
325 | 287 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
333 | 294 | | |
334 | 295 | | |
335 | 296 | | |
| |||
383 | 344 | | |
384 | 345 | | |
385 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
386 | 359 | | |
387 | 360 | | |
388 | 361 | | |
| |||
396 | 369 | | |
397 | 370 | | |
398 | 371 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
405 | 376 | | |
406 | 377 | | |
407 | 378 | | |
| |||
429 | 400 | | |
430 | 401 | | |
431 | 402 | | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | 403 | | |
438 | 404 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
444 | 408 | | |
445 | 409 | | |
446 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
0 commit comments