OXYGENHUB
# 4745b9844987 oxygenhub / .flow / pipeline.kdl
6.0 KiB · last changed CI: the test job gets a 40 GiB disk too (24 GiB filled: ENOSPC, then the linker SIGBUS) 18 days ago source blame history raw
This file is in conflict in this state; the markers below are the conflict. All conflicts
380996db Andy McCall ↶ 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
705d11b0 Andy McCall ↶ 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.
380996db Andy McCall ↶ 12
sandbox "rust" {
13
    runtime "microvm"
913e5ad2 Andy McCall ↶ 14
    rootfs "cas://blob/d2d24c2211f00d6ccf89fbee63095ad2a81d0cc9af92d7a0ede9129e18d46e91"
380996db Andy McCall ↶ 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
}
20
21
sandbox "rust-small" {
22
    runtime "microvm"
913e5ad2 Andy McCall ↶ 23
    rootfs "cas://blob/d2d24c2211f00d6ccf89fbee63095ad2a81d0cc9af92d7a0ede9129e18d46e91"
380996db Andy McCall ↶ 24
    memory-limit "1GiB"
25
    cpu-limit 1
26
    network "isolated"
27
}
28
29
job "fmt" {
30
    sandbox "rust-small"
31
    // Only this workspace's packages: --all would also check the path
32
    // dependencies in deps/, which follow their own formatting.
33
    exec "cargo" "fmt" "--check" "-p" "oxygenhub" "-p" "hub-api"
34
}
35
36
job "clippy" {
37
    sandbox "rust"
38
    depends-on "fmt"
39
    mount {
40
        source "ephemeral://disk"
41
        target "/src/target"
42
        size "24GiB"
bf614c3d Andy McCall ↶ 43
        // Kept from this job's last passing run (oxygenflow#28): cargo
44
        // builds only what changed since.
45
        cache "target"
46
        key "Cargo.lock"
380996db Andy McCall ↶ 47
    }
48
<<<<<<< oxy conflict 1 of 3, side 1 of 2: change 6532b323 "oxygen and oxygenflow as pinned subrepos in deps/ (make pins moves them), and an OxygenFlow pipeline: fmt of this workspace, then clippy, tests and a release build against the pins"
49
    env {
50
        CARGO_INCREMENTAL "0"
705d11b0 Andy McCall ↶ 51
    }
380996db Andy McCall ↶ 52
======= oxy conflict 1 of 3, side 2 of 2: change bce3997c "CI starts from the build image's prebuilt dependencies"
53
    exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
54
>>>>>>> oxy conflict 1 of 3 end
55
}
56
57
job "test" {
58
    sandbox "rust"
59
    depends-on "fmt"
4745b984 Andy McCall ↶ 60
    mount {
61
        source "ephemeral://disk"
bf614c3d Andy McCall ↶ 62
        target "/src/target"
63
        // 40 GiB (2026-10-20), as test-postgres: its kept target filled 24 GiB.
64
        size "40GiB"
65
        // Kept from this job's last passing run (oxygenflow#28): cargo
380996db Andy McCall ↶ 66
        // builds only what changed since.
67
        cache "target"
68
        key "Cargo.lock"
69
    }
705d11b0 Andy McCall ↶ 70
<<<<<<< oxy conflict 2 of 3, side 1 of 2: change 6532b323 "oxygen and oxygenflow as pinned subrepos in deps/ (make pins moves them), and an OxygenFlow pipeline: fmt of this workspace, then clippy, tests and a release build against the pins"
380996db Andy McCall ↶ 71
    env {
72
        CARGO_INCREMENTAL "0"
73
    }
74
======= oxy conflict 2 of 3, side 2 of 2: change bce3997c "CI starts from the build image's prebuilt dependencies"
75
    exec "sh" ".flow/warm-target.sh" "cargo" "test" "--workspace" "--locked"
76
>>>>>>> oxy conflict 2 of 3 end
77
}
78
79
job "build" {
80
    sandbox "rust"
81
    depends-on "fmt"
82
    mount {
bf614c3d Andy McCall ↶ 83
        source "ephemeral://disk"
84
        target "/src/target"
85
        size "24GiB"
86
<<<<<<< oxy conflict 3 of 3, side 1 of 2: change 6532b323 "oxygen and oxygenflow as pinned subrepos in deps/ (make pins moves them), and an OxygenFlow pipeline: fmt of this workspace, then clippy, tests and a release build against the pins"
380996db Andy McCall ↶ 87
    }
705d11b0 Andy McCall ↶ 88
    env {
380996db Andy McCall ↶ 89
        CARGO_INCREMENTAL "0"
913e5ad2 Andy McCall ↶ 90
======= oxy conflict 3 of 3, side 2 of 2: change 5a69f07c "ci: keep each build job's target from its last passing run (refs andymccall/oxygenflow#28)"
91
        // Kept from this job's last passing run (oxygenflow#28): cargo
92
        // builds only what changed since.
93
        cache "target"
94
        key "Cargo.lock"
95
>>>>>>> oxy conflict 3 of 3 end
96
    }
97
    exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked"
98
}
99
100
// Release files for every platform (oxygen#59): scripts/dist.sh in the
101
// build image's cross toolchains. A push runs it only when it touches
102
// these paths (a release moves Cargo.toml's version); "Run pipeline" and
103
// reruns always do. The files are kept as this run's artifacts, named by
104
// its signed receipt, and attached to the release from there, so the
bf614c3d Andy McCall ↶ 105
// release's trust page shows each as built here.
106
job "dist" {
107
    sandbox "rust"
108
    depends-on "fmt"
913e5ad2 Andy McCall ↶ 109
    scope "Cargo.toml" "scripts/dist.sh" "packaging/**"
110
    mount {
111
        source "ephemeral://disk"
112
        target "/src/target"
113
        size "24GiB"
114
        // Kept from this job's last passing run (oxygenflow#28): cargo
115
        // builds only what changed since.
116
        cache "target"
117
        key "Cargo.lock"
118
    }
119
    env {
120
        DIST_FLAT "/src/target/dist-flat"
121
        ZIG_GLOBAL_CACHE_DIR "/src/target/zig-cache"
122
    }
123
    exec "bash" "scripts/dist.sh"
124
    output {
125
        artifact "oh-linux-x86_64.tar.gz" {
126
            path "/src/target/dist-flat/oh-linux-x86_64.tar.gz"
127
        }
128
        artifact "oh-linux-arm64.tar.gz" {
129
            path "/src/target/dist-flat/oh-linux-arm64.tar.gz"
130
        }
131
        artifact "oh-linux-riscv64.tar.gz" {
132
            path "/src/target/dist-flat/oh-linux-riscv64.tar.gz"
133
        }
134
        artifact "oh-macos-x86_64.tar.gz" {
135
            path "/src/target/dist-flat/oh-macos-x86_64.tar.gz"
136
        }
137
        artifact "oh-macos-arm64.tar.gz" {
138
            path "/src/target/dist-flat/oh-macos-arm64.tar.gz"
139
        }
140
        artifact "oh-windows-x86_64.zip" {
141
            path "/src/target/dist-flat/oh-windows-x86_64.zip"
142
        }
143
        artifact "oh_amd64.deb" {
144
            path "/src/target/dist-flat/oh_amd64.deb"
145
        }
146
        artifact "oh_arm64.deb" {
147
            path "/src/target/dist-flat/oh_arm64.deb"
148
        }
149
        artifact "oh_riscv64.deb" {
150
            path "/src/target/dist-flat/oh_riscv64.deb"
151
        }
152
        artifact "SHA256SUMS" {
153
            path "/src/target/dist-flat/SHA256SUMS"
154
        }
155
    }
156
}