@@ -9,6 +9,13 @@ name: Parts
99# Each job ends in the verification that belongs to it, so a configuration that lost a device,
1010# a kernel at a fixed address or an image with an identity baked in fails here rather than in a
1111# VM that will not start weeks later.
12+ #
13+ # The builds run on the RunsOn build fleet (spin-stack/ci: 16 vCPU, no nested virtualization,
14+ # which nothing here boots), not GitHub's 4-vCPU runners. There, cold, the kernel job took 21-27
15+ # min, the kernel 10-13 and the traceable kernel 9-12 after it, and QEMU 6-9 (parts runs
16+ # 45254983345, 45267869531, 45272669299). A compile takes nproc inside its RUN and no build
17+ # argument names the runner's size, so the fleet, a laptop and any other runner share one cache.
18+ # `changed` and `parts` compile nothing and stay on GitHub's runners.
1219
1320on :
1421 # No paths: `parts` has to report on every change, and `changed` below is the filter. A path
3845jobs :
3946 # Whether this change can reach each part: what each build is handed (its pins in
4047 # versions.yaml) at the base and here, and the paths it is built from. It errs towards
41- # building. The root Taskfile is deliberately not among the paths: it holds only how many jobs
42- # to compile with and which cache to use, so it would rebuild every part for an edit that
43- # cannot change any of them.
48+ # building. The root Taskfile is deliberately not among the paths: no build is handed anything
49+ # from it, so it would rebuild every part for an edit that cannot change any of them.
4450 changed :
4551 runs-on : ubuntu-latest
4652 timeout-minutes : 10
8389 qemu :
8490 needs : changed
8591 if : needs.changed.outputs.qemu == 'true'
86- runs-on : ubuntu-latest
92+ runs-on : runs-on/fleet=build/env=production
8793 # A cold build is tens of minutes and a warm one is a cache restore, so the spread is
8894 # wide and the ceiling has to sit above the cold case. What it is really for is the
8995 # other end: a `configure` that stops on a prompt would hold a runner for six hours
@@ -129,7 +135,7 @@ jobs:
129135 env :
130136 # main's lanes write the cache back; everything else only reads it.
131137 CACHE_EXPORT : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
132- run : spin-machine-dev build qemu --jobs 4 -- cache-registry --cache-export="$CACHE_EXPORT"
138+ run : spin-machine-dev build qemu --cache-registry --cache-export="$CACHE_EXPORT"
133139
134140 # vhost-vsock is a kernel module, and the machine's vsock device cannot be created
135141 # without /dev/vhost-vsock. The runner has the node and gives the user no access to
@@ -187,7 +193,7 @@ jobs:
187193 kernel :
188194 needs : changed
189195 if : needs.changed.outputs.kernel == 'true'
190- runs-on : ubuntu-latest
196+ runs-on : runs-on/fleet=build/env=production
191197 timeout-minutes : 180
192198 steps :
193199 - name : Checkout
@@ -225,7 +231,7 @@ jobs:
225231 env :
226232 # main's lanes write the cache back; everything else only reads it.
227233 CACHE_EXPORT : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
228- run : spin-machine-dev build kernel --jobs 4 -- cache-registry --cache-export="$CACHE_EXPORT"
234+ run : spin-machine-dev build kernel --cache-registry --cache-export="$CACHE_EXPORT"
229235
230236 # Still named vmlinux-<sha>: lab tree --kernel run:<id> finds a kernel run's artifact by that name.
231237 - name : Upload the kernel
@@ -238,17 +244,46 @@ jobs:
238244 retention-days : 30
239245 if-no-files-found : error
240246
241- # The lab's traceable kernel, as release.yml's traceable job builds it once a release is out:
242- # the release kernel again, from the step above's builder, and a second with lockdown forced
243- # to none, held to the first's config less that option. Here, a change that breaks it fails
244- # before it is released and not after, when the release has no traceable kernel and no
245- # ledger (#558). Its own cache tag, written by main as the release kernel's is, keeps
246- # release.yml's job warm. ~10 min more cold (parts run 45071066129); the version only names
247- # the vmlinux, which nothing here publishes.
247+ # The lab's traceable kernel, as release.yml's traceable job builds it once a release is out: the
248+ # release kernel with lockdown forced to none, its config held to the series' committed file less
249+ # that option. Here, a change that breaks it fails before it is released and not after, when the
250+ # release has no traceable kernel and no ledger (#558). A job of its own, beside `kernel` and not
251+ # after it: since #721 the release kernel's config is the committed file to the line, so this
252+ # compiles nothing of the release kernel's, and in series the two were 9-12 min of the kernel
253+ # job's 21-27. Its own cache tag, written by main as the release kernel's is, keeps release.yml's
254+ # job warm. The version only names the vmlinux, which nothing here publishes.
255+ traceable :
256+ needs : changed
257+ if : needs.changed.outputs.kernel == 'true'
258+ runs-on : runs-on/fleet=build/env=production
259+ timeout-minutes : 180
260+ steps :
261+ - name : Checkout
262+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
263+
264+ - name : Set up Go
265+ uses : actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
266+ with :
267+ go-version-file : go.mod
268+ cache : true
269+
270+ - name : spin-machine-dev
271+ run : go tool task bin
272+
273+ # As the qemu job's: a builder that can export its cache, and the login that reads it.
274+ - uses : docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
275+
276+ - name : Log in to GitHub Packages
277+ uses : docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
278+ with :
279+ registry : ghcr.io
280+ username : ${{ github.actor }}
281+ password : ${{ secrets.GITHUB_TOKEN }}
282+
248283 - name : Build the traceable kernel
249284 env :
250285 CACHE_EXPORT : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
251- run : spin-machine-dev release traceable-kernel --version "$GITHUB_SHA" --jobs 4 -- cache-registry --cache-export="$CACHE_EXPORT"
286+ run : spin-machine-dev release traceable-kernel --version "$GITHUB_SHA" --cache-registry --cache-export="$CACHE_EXPORT"
252287
253288 # The base image: ~1.5 GB of apt against a live archive. The build runs `docker run --cap-add
254289 # SYS_ADMIN` and not `docker buildx build`, because mkosi assembles a root filesystem by
@@ -258,7 +293,7 @@ jobs:
258293 image :
259294 needs : changed
260295 if : needs.changed.outputs.image == 'true'
261- runs-on : ubuntu-latest
296+ runs-on : runs-on/fleet=build/env=production
262297 timeout-minutes : 60
263298 steps :
264299 - name : Checkout
@@ -290,7 +325,7 @@ jobs:
290325 env :
291326 # main's lanes write the cache back; everything else only reads it.
292327 CACHE_EXPORT : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
293- run : spin-machine-dev build e2fsprogs --jobs 4 -- cache-registry --cache-export="$CACHE_EXPORT"
328+ run : spin-machine-dev build e2fsprogs --cache-registry --cache-export="$CACHE_EXPORT"
294329
295330 # image/build.sh asserts what came out on the finished filesystem rather than
296331 # trusting the build that made it: that there is an /sbin/init and a /bin/sh, that
@@ -310,13 +345,13 @@ jobs:
310345 env :
311346 # main's lanes write the cache back; everything else only reads it.
312347 CACHE_EXPORT : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
313- run : spin-machine-dev build image --jobs 4 -- cache-registry --cache-export="$CACHE_EXPORT"
348+ run : spin-machine-dev build image --cache-registry --cache-export="$CACHE_EXPORT"
314349
315350 # Every part the change reaches built and verified: the one check of this workflow a ruleset
316351 # can require. A part the change does not reach is skipped, which is a pass; one that failed or
317352 # was cancelled, or a `changed` that could not say, is not.
318353 parts :
319- needs : [changed, qemu, kernel, image]
354+ needs : [changed, qemu, kernel, traceable, image]
320355 if : ${{ always() }}
321356 runs-on : ubuntu-latest
322357 timeout-minutes : 5
0 commit comments