OXYGENHUB
◆ v0.7.0 oxygenhub / .flow / pipeline.kdl
7.3 KiB · last changed CI: the test job gets a 40 GiB disk too (24 GiB filled: ENOSPC, then the linker SIGBUS) 16 days ago source blame history raw
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/57aa0b34c0cadd541cfe90ac2711200be46879ac9968778e3a3417eca04357e3"
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/57aa0b34c0cadd541cfe90ac2711200be46879ac9968778e3a3417eca04357e3"
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
    exec "sh" ".flow/warm-target.sh" "cargo" "test" "--workspace" "--locked"
96
}
97
98
// The hub's tests again on PostgreSQL (#211, docs/postgres.md), against a
99
// server the job starts in its own guest.
100
job "test-postgres" {
101
    sandbox "rust"
102
    depends-on "fmt"
103
    mount {
104
        source "ephemeral://disk"
105
        target "/src/target"
106
        // 40 GiB (2026-10-20): its kept target holds the postgres-feature test
107
        // binaries beside older ones, and filled 24 GiB (the linker then dies
108
        // with SIGBUS writing its mmapped output).
109
        size "40GiB"
110
        cache "target"
111
        key "Cargo.lock"
112
    }
113
    exec "sh" ".flow/test-postgres.sh"
114
}
115
116
job "build" {
117
    sandbox "rust"
118
    depends-on "fmt"
119
    mount {
120
        source "ephemeral://disk"
121
        target "/src/target"
122
        size "24GiB"
123
        // Kept from this job's last passing run (oxygenflow#28): cargo
124
        // builds only what changed since.
125
        cache "target"
126
        key "Cargo.lock"
127
    }
128
    exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked"
129
}
130
131
// Release files for every platform (oxygen#59): scripts/dist.sh in the
132
// build image's cross toolchains. A push runs it only when it touches
133
// these paths (a release moves Cargo.toml's version); "Run pipeline" and
134
// reruns always do. The files are kept as this run's artifacts, named by
135
// its signed receipt, and attached to the release from there, so the
136
// release's trust page shows each as built here.
137
job "dist" {
138
    sandbox "rust"
139
    depends-on "fmt"
140
    scope "Cargo.toml" "scripts/dist.sh" "packaging/**"
141
    mount {
142
        source "ephemeral://disk"
143
        target "/src/target"
144
        size "24GiB"
145
        // Kept from this job's last passing run (oxygenflow#28): cargo
146
        // builds only what changed since.
147
        cache "target"
148
        key "Cargo.lock"
149
    }
150
    env {
151
        DIST_FLAT "/src/target/dist-flat"
152
        ZIG_GLOBAL_CACHE_DIR "/src/target/zig-cache"
153
    }
154
    exec "bash" "scripts/dist.sh"
155
    output {
156
        artifact "oh-linux-x86_64.tar.gz" {
157
            path "/src/target/dist-flat/oh-linux-x86_64.tar.gz"
158
        }
159
        artifact "oh-linux-arm64.tar.gz" {
160
            path "/src/target/dist-flat/oh-linux-arm64.tar.gz"
161
        }
162
        artifact "oh-linux-riscv64.tar.gz" {
163
            path "/src/target/dist-flat/oh-linux-riscv64.tar.gz"
164
        }
165
        artifact "oh-macos-x86_64.tar.gz" {
166
            path "/src/target/dist-flat/oh-macos-x86_64.tar.gz"
167
        }
168
        artifact "oh-macos-arm64.tar.gz" {
169
            path "/src/target/dist-flat/oh-macos-arm64.tar.gz"
170
        }
171
        artifact "oh-windows-x86_64.zip" {
172
            path "/src/target/dist-flat/oh-windows-x86_64.zip"
173
        }
174
        artifact "oh_amd64.deb" {
175
            path "/src/target/dist-flat/oh_amd64.deb"
176
        }
177
        artifact "oh_arm64.deb" {
178
            path "/src/target/dist-flat/oh_arm64.deb"
179
        }
180
        artifact "oh_riscv64.deb" {
181
            path "/src/target/dist-flat/oh_riscv64.deb"
182
        }
183
        artifact "oxygenhub-server-linux-x86_64.tar.gz" {
184
            path "/src/target/dist-flat/oxygenhub-server-linux-x86_64.tar.gz"
185
        }
186
        artifact "SHA256SUMS" {
187
            path "/src/target/dist-flat/SHA256SUMS"
188
        }
189
    }
190
}
191
192
// The native RISC-V check (oxygenflow#69): oh built and run on narvi-1, a
193
// real riscv64 board, so each release is known to run there and not only
194
// to cross-compile (dist). Like dist, a push runs it only when it touches
195
// these paths; "Run pipeline" and reruns always do. Its target directory
196
// is cached between passing runs (oxygenflow#70).
197
job "riscv64" {
198
    sandbox "rust-riscv64"
199
    depends-on "fmt"
200
    scope "Cargo.toml" "scripts/dist.sh" "packaging/**" ".flow/riscv64-check.sh"
201
    timeout "3h"
202
    mount {
203
        source "ephemeral://disk"
204
        target "/src/target"
205
        size "16GiB"
206
        cache "target"
207
        key "Cargo.lock"
208
    }
209
    exec "sh" ".flow/riscv64-check.sh"
210
    output {
211
        artifact "oh-linux-riscv64-native" {
212
            path "/src/target/release/oh"
213
        }
214
    }
215
}