ref:0309aab6f5cccf63a1ba7843d93b18e8cf933829

Wire prepare block into release runner binary (#7)

## Summary - Commit `src/runner/prepare.rs` (previously untracked) and declare `pub mod prepare` in `src/runner/mod.rs`. - In `execute_job`, read the `prepare` array from the job JSON; when non-empty, call `prepare::prepare_image(image, &prepare, &log_reporter)` and use the returned tag for `executor::execute`. - Fail loudly if prepare is requested but can't run (e.g. prepare without image, or docker commit error). Silent fallback to the bare base image is what produced the exit-127 failure on main. - Call `prepare::prune_prepared_images(30, 10)` once at runner start to keep cached images under control. ## Why The server has been sending `prepare: [...]` in every job JSON, and the pipeline parser has validated the block since Mar 14. The runner never implemented the counterpart — the prepare field was read nowhere. Production CI only worked because carl had a locally-built binary with an uncommitted `prepare.rs` wired in. `install.sh` migrating carl to the latest CalVer release silently traded that away, and the next main run failed with exit 127 because `git config` couldn't run in the bare `hexpm/elixir` image. ## Test plan - [x] cargo build --release — clean - [x] cargo test — 6 passed (4 new prepare tests) - [x] cargo clippy --all-targets -- -D warnings — clean - [x] cargo fmt -- --check — clean - [ ] Cut a new CalVer release from this branch. - [ ] Reinstall runner on carl and re-run the failing deps job for main — deps should now pass via a freshly-built prepared image. Closes #49
SHA: 0309aab6f5cccf63a1ba7843d93b18e8cf933829
Author: Anvil <noreply@anvil.fangorn.io>
Date: 2026-04-17 20:19
Parents: 12ff11a
5 files changed +396 -1
Type
Cargo.lock +72 −0
@@ -77,6 +77,7 @@
"reqwest",
"serde",
"serde_json",
"sha2",
"tabled",
"thiserror 2.0.18",
"tokio",
@@ -115,6 +116,15 @@
checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af"
[[package]]
name = "block-buffer"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
"generic-array",
]
[[package]]
name = "bumpalo"
version = "3.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -243,6 +253,25 @@
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "cpufeatures"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
dependencies = [
"libc",
]
[[package]]
name = "crypto-common"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
dependencies = [
"generic-array",
"typenum",
]
[[package]]
name = "dialoguer"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -256,6 +285,16 @@
]
[[package]]
name = "digest"
version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
"block-buffer",
"crypto-common",
]
[[package]]
name = "dirs"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -431,6 +470,16 @@
]
[[package]]
name = "generic-array"
version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
]
[[package]]
name = "getrandom"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1336,6 +1385,17 @@
]
[[package]]
name = "sha2"
version = "0.10.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
dependencies = [
"cfg-if",
"cpufeatures",
"digest",
]
[[package]]
name = "shell-words"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1662,6 +1722,12 @@
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "typenum"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
[[package]]
name = "unicase"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1714,6 +1780,12 @@
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "version_check"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
name = "want"
Cargo.toml +1 −0
@@ -27,3 +27,4 @@
libc = "0.2"
futures = "0.3"
glob = "0.3"
sha2 = "0.10"