| 1 |
// OxygenHub's pipeline (OxygenFlow, docs in the oxygenflow repository). |
| 2 |
// Every push to a bookmark on OxygenHub runs it in Firecracker microVMs on |
| 3 |
// Earth; the jobs appear as checks on the change. oxygen and oxygenflow come |
| 4 |
// from the pinned subrepos in deps/, which the runner puts in the workspace. |
| 5 |
schema-version 1 |
| 6 |
|
| 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. |
| 12 |
sandbox "rust" { |
| 13 |
runtime "microvm" |
| 14 |
rootfs "cas://blob/836461b613019f62399a960c61a25c482eb74e30054ff2cd44d5594c3305872b" |
| 15 |
memory-limit "8GiB" |
| 16 |
cpu-limit 4 |
| 17 |
// Tests serve and connect on 127.0.0.1; nothing leaves the guest. |
| 18 |
network "loopback" |
| 19 |
// CI builds are thrown away: no incremental state, and no debug info |
| 20 |
// (the release profile keeps line tables for the binary Earth runs, |
| 21 |
// which is built outside CI), so less to compile, link and write. |
| 22 |
env { |
| 23 |
CARGO_INCREMENTAL "0" |
| 24 |
CARGO_PROFILE_DEV_DEBUG "0" |
| 25 |
CARGO_PROFILE_TEST_DEBUG "0" |
| 26 |
CARGO_PROFILE_RELEASE_DEBUG "0" |
| 27 |
// One build identity for every CI state, so a cached target stays |
| 28 |
// fresh from one push to the next (oxygenflow#52); dist sets the |
| 29 |
// release's own. |
| 30 |
OXY_BUILD "ci" |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
sandbox "rust-small" { |
| 35 |
runtime "microvm" |
| 36 |
rootfs "cas://blob/836461b613019f62399a960c61a25c482eb74e30054ff2cd44d5594c3305872b" |
| 37 |
memory-limit "1GiB" |
| 38 |
cpu-limit 1 |
| 39 |
network "isolated" |
| 40 |
} |
| 41 |
|
| 42 |
// The riscv64 build image on narvi-1 (oxygenflow#69): Ubuntu 24.04 riscv64 |
| 43 |
// with Rust 1.97.1 and the same vendored crates, in the syscall tier (the |
| 44 |
// board has no hardware virtualisation, so no microVM). `runs-on` keeps it |
| 45 |
// on a RISC-V runner. |
| 46 |
sandbox "rust-riscv64" { |
| 47 |
runtime "syscall" |
| 48 |
rootfs "cas://blob/b4edba9173ddf63aa1df46222e6a59b265071b19f2815c89d0153b593835c616" |
| 49 |
runs-on "riscv64" |
| 50 |
memory-limit "4GiB" |
| 51 |
cpu-limit 6 |
| 52 |
network "loopback" |
| 53 |
env { |
| 54 |
CARGO_INCREMENTAL "0" |
| 55 |
CARGO_PROFILE_RELEASE_DEBUG "0" |
| 56 |
CARGO_BUILD_JOBS "4" |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
job "fmt" { |
| 61 |
sandbox "rust-small" |
| 62 |
// Only this workspace's packages: --all would also check the path |
| 63 |
// dependencies in deps/, which follow their own formatting. |
| 64 |
exec "cargo" "fmt" "--check" "-p" "oxygenhub" "-p" "hub-api" "-p" "oh" |
| 65 |
} |
| 66 |
|
| 67 |
job "clippy" { |
| 68 |
sandbox "rust" |
| 69 |
depends-on "fmt" |
| 70 |
mount { |
| 71 |
source "ephemeral://disk" |
| 72 |
target "/src/target" |
| 73 |
size "24GiB" |
| 74 |
// Kept from this job's last passing run (oxygenflow#28): cargo |
| 75 |
// builds only what changed since. |
| 76 |
cache "target" |
| 77 |
key "Cargo.lock" |
| 78 |
} |
| 79 |
exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings" |
| 80 |
} |
| 81 |
|
| 82 |
job "test" { |
| 83 |
sandbox "rust" |
| 84 |
depends-on "fmt" |
| 85 |
mount { |
| 86 |
source "ephemeral://disk" |
| 87 |
target "/src/target" |
| 88 |
// 40 GiB (2026-10-20), as test-postgres: its kept target filled 24 GiB. |
| 89 |
size "40GiB" |
| 90 |
// Kept from this job's last passing run (oxygenflow#28): cargo |
| 91 |
// builds only what changed since. |
| 92 |
cache "target" |
| 93 |
key "Cargo.lock" |
| 94 |
} |
| 95 |
// Under cargo-nextest (#307): a JUnit report for the hub's Tests tab, |
| 96 |
// kept whether or not the tests pass. |
| 97 |
exec "sh" ".flow/warm-target.sh" "cargo" "nextest" "run" "--workspace" "--locked" "--profile" "ci" |
| 98 |
output { |
| 99 |
artifact "junit" { |
| 100 |
path "/src/target/nextest/ci/junit.xml" |
| 101 |
when "always" |
| 102 |
} |
| 103 |
} |
| 104 |
} |
| 105 |
|
| 106 |
// Line coverage (#307) for the Coverage tab: the tests again, instrumented, |
| 107 |
// in a job of its own beside `test`, so neither waits for the other and the |
| 108 |
// instrumented build keeps its own cached target. Not a required check. |
| 109 |
job "coverage" { |
| 110 |
sandbox "rust" |
| 111 |
depends-on "fmt" |
| 112 |
mount { |
| 113 |
source "ephemeral://disk" |
| 114 |
target "/src/target" |
| 115 |
size "48GiB" |
| 116 |
cache "coverage-target" |
| 117 |
key "Cargo.lock" |
| 118 |
} |
| 119 |
exec "cargo" "llvm-cov" "nextest" "--workspace" "--locked" "--profile" "ci" "--lcov" "--output-path" "/src/target/lcov.info" |
| 120 |
output { |
| 121 |
artifact "coverage" { |
| 122 |
path "/src/target/lcov.info" |
| 123 |
} |
| 124 |
} |
| 125 |
} |
| 126 |
|
| 127 |
// The hub's tests again on PostgreSQL (#211, docs/postgres.md), against a |
| 128 |
// server the job starts in its own guest. |
| 129 |
job "test-postgres" { |
| 130 |
sandbox "rust" |
| 131 |
depends-on "fmt" |
| 132 |
mount { |
| 133 |
source "ephemeral://disk" |
| 134 |
target "/src/target" |
| 135 |
// 40 GiB (2026-10-20): its kept target holds the postgres-feature test |
| 136 |
// binaries beside older ones, and filled 24 GiB (the linker then dies |
| 137 |
// with SIGBUS writing its mmapped output). |
| 138 |
size "40GiB" |
| 139 |
cache "target" |
| 140 |
key "Cargo.lock" |
| 141 |
} |
| 142 |
exec "sh" ".flow/test-postgres.sh" |
| 143 |
} |
| 144 |
|
| 145 |
job "build" { |
| 146 |
sandbox "rust" |
| 147 |
depends-on "fmt" |
| 148 |
mount { |
| 149 |
source "ephemeral://disk" |
| 150 |
target "/src/target" |
| 151 |
size "24GiB" |
| 152 |
// Kept from this job's last passing run (oxygenflow#28): cargo |
| 153 |
// builds only what changed since. |
| 154 |
cache "target" |
| 155 |
key "Cargo.lock" |
| 156 |
} |
| 157 |
exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked" |
| 158 |
} |
| 159 |
|
| 160 |
// Release files for every platform (oxygen#59): scripts/dist.sh in the |
| 161 |
// build image's cross toolchains. A push runs it only when it touches |
| 162 |
// these paths (a release moves Cargo.toml's version); "Run pipeline" and |
| 163 |
// reruns always do. The files are kept as this run's artifacts, named by |
| 164 |
// its signed receipt, and attached to the release from there, so the |
| 165 |
// release's trust page shows each as built here. |
| 166 |
job "dist" { |
| 167 |
sandbox "rust" |
| 168 |
depends-on "fmt" |
| 169 |
scope "Cargo.toml" "scripts/dist.sh" "packaging/**" |
| 170 |
mount { |
| 171 |
source "ephemeral://disk" |
| 172 |
target "/src/target" |
| 173 |
size "24GiB" |
| 174 |
// Kept from this job's last passing run (oxygenflow#28): cargo |
| 175 |
// builds only what changed since. |
| 176 |
cache "target" |
| 177 |
key "Cargo.lock" |
| 178 |
} |
| 179 |
env { |
| 180 |
DIST_FLAT "/src/target/dist-flat" |
| 181 |
ZIG_GLOBAL_CACHE_DIR "/src/target/zig-cache" |
| 182 |
} |
| 183 |
exec "bash" "scripts/dist.sh" |
| 184 |
output { |
| 185 |
artifact "oh-linux-x86_64.tar.gz" { |
| 186 |
path "/src/target/dist-flat/oh-linux-x86_64.tar.gz" |
| 187 |
} |
| 188 |
artifact "oh-linux-arm64.tar.gz" { |
| 189 |
path "/src/target/dist-flat/oh-linux-arm64.tar.gz" |
| 190 |
} |
| 191 |
artifact "oh-linux-riscv64.tar.gz" { |
| 192 |
path "/src/target/dist-flat/oh-linux-riscv64.tar.gz" |
| 193 |
} |
| 194 |
artifact "oh-macos-x86_64.tar.gz" { |
| 195 |
path "/src/target/dist-flat/oh-macos-x86_64.tar.gz" |
| 196 |
} |
| 197 |
artifact "oh-macos-arm64.tar.gz" { |
| 198 |
path "/src/target/dist-flat/oh-macos-arm64.tar.gz" |
| 199 |
} |
| 200 |
artifact "oh-windows-x86_64.zip" { |
| 201 |
path "/src/target/dist-flat/oh-windows-x86_64.zip" |
| 202 |
} |
| 203 |
artifact "oh_amd64.deb" { |
| 204 |
path "/src/target/dist-flat/oh_amd64.deb" |
| 205 |
} |
| 206 |
artifact "oh_arm64.deb" { |
| 207 |
path "/src/target/dist-flat/oh_arm64.deb" |
| 208 |
} |
| 209 |
artifact "oh_riscv64.deb" { |
| 210 |
path "/src/target/dist-flat/oh_riscv64.deb" |
| 211 |
} |
| 212 |
artifact "oxygenhub-server-linux-x86_64.tar.gz" { |
| 213 |
path "/src/target/dist-flat/oxygenhub-server-linux-x86_64.tar.gz" |
| 214 |
} |
| 215 |
artifact "SHA256SUMS" { |
| 216 |
path "/src/target/dist-flat/SHA256SUMS" |
| 217 |
} |
| 218 |
} |
| 219 |
} |
| 220 |
|
| 221 |
// The native RISC-V check (oxygenflow#69): oh built and run on narvi-1, a |
| 222 |
// real riscv64 board, so each release is known to run there and not only |
| 223 |
// to cross-compile (dist). Like dist, a push runs it only when it touches |
| 224 |
// these paths; "Run pipeline" and reruns always do. Its target directory |
| 225 |
// is cached between passing runs (oxygenflow#70). |
| 226 |
job "riscv64" { |
| 227 |
sandbox "rust-riscv64" |
| 228 |
depends-on "fmt" |
| 229 |
scope "Cargo.toml" "scripts/dist.sh" "packaging/**" ".flow/riscv64-check.sh" |
| 230 |
timeout "3h" |
| 231 |
mount { |
| 232 |
source "ephemeral://disk" |
| 233 |
target "/src/target" |
| 234 |
size "16GiB" |
| 235 |
cache "target" |
| 236 |
key "Cargo.lock" |
| 237 |
} |
| 238 |
exec "sh" ".flow/riscv64-check.sh" |
| 239 |
output { |
| 240 |
artifact "oh-linux-riscv64-native" { |
| 241 |
path "/src/target/release/oh" |
| 242 |
} |
| 243 |
} |
| 244 |
} |