CI starts from the build image's prebuilt dependencies 705d11b01a2c
The pipeline pins the build image that holds this workspace's dependencies prebuilt, and .flow/warm-target.sh copies them onto a job's empty target disk before cargo runs, so clippy, the tests and the release build compile only this workspace's crates. Without them (an older image, a failed copy) a job builds everything as before. refs #29
- Author
- Andy McCall @andymccall <[email protected]>
- When
- · 2026-09-29 03:46 UTC
- Signature
- ✔ signed by Andy McCall
- Hash
705d11b01a2cdb600eb543a73fa3eae62acf83df1e95d5ea0327e27e06be4480- Depends on
- 380996db84e5
- Depended on by
- 40a43921ef42 fbd7c8551932 a22ff236b65a 1d9702887eee
- In bookmarks
- api-unknown-fields cancel-landed-runs clear-waiting close-proposal-140 diffusion-pin-bookmark draft-ready image-check job-waits main oh-comment-body-file proposal-list-fast run-one-job wiki-says-so
- In tags
- v0.1.0 v0.2.0 v0.3.0 v0.3.1 v0.4.0 v0.4.1 v0.4.2 v0.5.0 v0.5.1 v0.5.2 v0.6.0 v0.6.1 v0.7.0 v0.8.0 v0.9.0 v0.9.1 v0.9.11 v0.9.15 v0.9.16 v0.9.19 v0.9.2 v0.9.20 v0.9.21 v0.9.22 v0.9.23 v0.9.24 v0.9.3 v0.9.4 v0.9.5 v0.9.6 v0.9.7 v0.9.8 v0.9.9
- Edits
- 8 atoms, 1 tree operation, 2 files
Browse the tree at this change
added .flow/warm-target.sh +19 −0
| 1 | + | #!/bin/sh |
|
| 2 | + | # Start from the build image's prebuilt dependencies, then run the command. |
|
| 3 | + | # OxygenFlow's rust image holds oxygenhub's dependencies built at /src with |
|
| 4 | + | # this pipeline's environment (oxygenflow/images/rust, backlog F6b2); the |
|
| 5 | + | # job's target disk starts empty, so copying them in leaves cargo only this |
|
| 6 | + | # workspace's own crates to compile. Without them (an older image, or a |
|
| 7 | + | # failed copy) the job simply builds everything, as before. |
|
| 8 | + | set -eu |
|
| 9 | + | warm=/opt/warm/oxygenhub |
|
| 10 | + | if [ -d "$warm" ] && [ -z "$(ls -A target 2>/dev/null)" ]; then |
|
| 11 | + | start=$(date +%s) |
|
| 12 | + | if cp -R --preserve=timestamps "$warm/." target/; then |
|
| 13 | + | echo "flow: prebuilt dependencies copied in $(( $(date +%s) - start )) s" |
|
| 14 | + | else |
|
| 15 | + | echo "flow: could not copy the prebuilt dependencies; building them" >&2 |
|
| 16 | + | rm -rf target/* 2>/dev/null || true |
|
| 17 | + | fi |
|
| 18 | + | fi |
|
| 19 | + | exec "$@" |
modified .flow/pipeline.kdl +10 −8
| … | 3 unchanged lines |
||
| 4 | 4 | // from the pinned subrepos in deps/, which the runner puts in the workspace. |
|
| 5 | 5 | schema-version 1 |
|
| 6 | 6 | ||
| 7 | - | // The OxygenFlow build image: Rust with rustfmt and clippy, Node, and every |
|
| 8 | - | // crate of Cargo.lock vendored (oxygenflow/images/rust). Rebuild and re-pin |
|
| 9 | - | // it when Cargo.lock changes. |
|
| 7 | + | // The OxygenFlow build image: Rust with rustfmt and clippy, Node, every |
|
| 8 | + | // crate of Cargo.lock vendored, and this workspace's dependencies prebuilt |
|
| 9 | + | // in /opt/warm/oxygenhub, which .flow/warm-target.sh copies onto a job's |
|
| 10 | + | // target disk (oxygenflow/images/rust). Rebuild and re-pin it when |
|
| 11 | + | // Cargo.lock changes; until then only the changed crates are compiled. |
|
| 10 | 12 | sandbox "rust" { |
|
| 11 | 13 | runtime "microvm" |
|
| 12 | - | rootfs "cas://blob/3ba0779a55b1d66fce10adf5a01585624c9aab089f590d228368c38fd3e65a46" |
|
| 14 | + | rootfs "cas://blob/47b614a6d5d9ca89bfc7d8da37cfbe3b335c28cfd846e08fd2fea8a360e39c0d" |
|
| 13 | 15 | memory-limit "8GiB" |
|
| 14 | 16 | cpu-limit 4 |
|
| 15 | 17 | // Tests serve and connect on 127.0.0.1; nothing leaves the guest. |
|
| … | 2 unchanged lines |
||
| 18 | 20 | ||
| 19 | 21 | sandbox "rust-small" { |
|
| 20 | 22 | runtime "microvm" |
|
| 21 | - | rootfs "cas://blob/3ba0779a55b1d66fce10adf5a01585624c9aab089f590d228368c38fd3e65a46" |
|
| 23 | + | rootfs "cas://blob/47b614a6d5d9ca89bfc7d8da37cfbe3b335c28cfd846e08fd2fea8a360e39c0d" |
|
| 22 | 24 | memory-limit "1GiB" |
|
| 23 | 25 | cpu-limit 1 |
|
| 24 | 26 | network "isolated" |
|
| … | 14 unchanged lines |
||
| 39 | 41 | target "/src/target" |
|
| 40 | 42 | size "24GiB" |
|
| 41 | 43 | } |
|
| 44 | + | exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings" |
|
| 42 | 45 | env { |
|
| 43 | 46 | CARGO_INCREMENTAL "0" |
|
| 44 | 47 | } |
|
| 45 | - | exec "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings" |
|
| 46 | 48 | } |
|
| 47 | 49 | ||
| 48 | 50 | job "test" { |
|
| … | 4 unchanged lines |
||
| 53 | 55 | target "/src/target" |
|
| 54 | 56 | size "24GiB" |
|
| 55 | 57 | } |
|
| 58 | + | exec "sh" ".flow/warm-target.sh" "cargo" "test" "--workspace" "--locked" |
|
| 56 | 59 | env { |
|
| 57 | 60 | CARGO_INCREMENTAL "0" |
|
| 58 | 61 | } |
|
| 59 | - | exec "cargo" "test" "--workspace" "--locked" |
|
| 60 | 62 | } |
|
| 61 | 63 | ||
| 62 | 64 | job "build" { |
|
| … | 7 unchanged lines |
||
| 70 | 72 | env { |
|
| 71 | 73 | CARGO_INCREMENTAL "0" |
|
| 72 | 74 | } |
|
| 73 | - | exec "cargo" "build" "--release" "--locked" |
|
| 75 | + | exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked" |
|
| 74 | 76 | } |