Skip to content

Commit 1370562

Browse files
committed
ci: rebuild every shipped image on schedule, not just two
build-image.yml's matrix rebuilt only firerunner-4c8g and firerunner-8c16g-docker, but the shipped catalog (examples/tiers.json) now has five rootfs tiers plus the tool-cache drive. The unbuilt images bake actions/runner, so without a monthly rebuild they fall out of GitHub's 30-day runner-agent window and stop registering. Expand the matrix to cover all five rootfs tiers (golden, golden-docker, golden-node, ubuntu full + minimal) via their respective build scripts, plus the toolcache drive. Each entry carries its own build command and a runner_pinned flag so --runner-version is passed only to the rootfs scripts (build-toolcache.sh bakes no runner). Publish dir defaults to /var/lib/firerunner and is overridable via a new image_dir dispatch input. Fix images/README's rebuild policy, which claimed it 'rebuilds the images on a schedule' while covering under half of them.
1 parent e6fb29b commit 1370562

2 files changed

Lines changed: 73 additions & 17 deletions

File tree

.github/workflows/build-image.yml

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
name: build-image
22

3-
# Rebuilds the firerunner golden rootfs images. GitHub only supports self-hosted
4-
# runner agents released in the last 30 days, so we rebuild monthly (well within
5-
# the window) and on demand. Rebuilding also folds in base-OS security updates.
3+
# Rebuilds every shipped firerunner image. GitHub only accepts self-hosted
4+
# runner agents released in the last 30 days, so the rootfs tiers (which bake
5+
# actions/runner) are rebuilt monthly — well within the window — and on demand.
6+
# Rebuilding also folds in base-OS security updates. The tool-cache drive bakes
7+
# no runner agent (it is a pure accelerator), but is rebuilt on the same cadence
8+
# to refresh its toolchains and picked-up CVEs.
9+
#
10+
# Every tier in the shipped catalog (examples/tiers.json) is covered:
11+
# golden.ext4 firerunner / firerunner-8c16g (build-rootfs.sh)
12+
# golden-docker.ext4 firerunner-8c16g-docker (build-rootfs.sh)
13+
# golden-node.ext4 firerunner-node (build-rootfs.sh)
14+
# ubuntu-rootfs-full firerunner-ubuntu (build-ubuntu-rootfs.sh)
15+
# ubuntu-rootfs-minimal firerunner-ubuntu-min (build-ubuntu-rootfs.sh)
16+
# toolcache.ext4 attached via --toolcache (build-toolcache.sh)
617

718
on:
819
schedule:
@@ -14,32 +25,70 @@ on:
1425
description: "actions/runner version to pin (blank = latest)"
1526
required: false
1627
default: ""
28+
image_dir:
29+
description: "Directory to publish the images into"
30+
required: false
31+
default: "/var/lib/firerunner"
1732

1833
permissions:
1934
contents: read
2035

36+
env:
37+
# workflow_dispatch supplies image_dir; the scheduled run has no inputs, so
38+
# fall back to the documented default from examples/tiers.json.
39+
IMAGE_DIR: ${{ inputs.image_dir || '/var/lib/firerunner' }}
40+
2141
jobs:
2242
build:
2343
# Requires a Linux KVM host with loop-mount + mkfs.ext4 (self-hosted).
2444
runs-on: [self-hosted, kvm]
2545
strategy:
2646
fail-fast: false
2747
matrix:
28-
tier:
29-
- firerunner-4c8g
30-
- firerunner-8c16g-docker
48+
include:
49+
- name: golden
50+
out: golden.ext4
51+
runner_pinned: true
52+
build: images/build-rootfs.sh --tier firerunner-4c8g
53+
- name: golden-docker
54+
out: golden-docker.ext4
55+
runner_pinned: true
56+
build: images/build-rootfs.sh --tier firerunner-8c16g-docker
57+
- name: golden-node
58+
out: golden-node.ext4
59+
runner_pinned: true
60+
build: images/build-rootfs.sh --tier firerunner-node
61+
- name: ubuntu-full
62+
out: ubuntu-rootfs-full.ext4
63+
runner_pinned: true
64+
build: images/build-ubuntu-rootfs.sh --toolset full
65+
- name: ubuntu-minimal
66+
out: ubuntu-rootfs-minimal.ext4
67+
runner_pinned: true
68+
build: images/build-ubuntu-rootfs.sh --toolset minimal
69+
- name: toolcache
70+
out: toolcache.ext4
71+
runner_pinned: false
72+
build: images/build-toolcache.sh
3173
steps:
3274
- name: Checkout
3375
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3476

35-
- name: Build golden rootfs (${{ matrix.tier }})
77+
- name: Build ${{ matrix.name }}
78+
env:
79+
RUNNER_VERSION: ${{ inputs.runner_version }}
3680
run: |
37-
sudo images/build-rootfs.sh \
38-
--tier "${{ matrix.tier }}" \
39-
--runner-version "${{ inputs.runner_version }}" \
40-
--out "/var/lib/firerunner/${{ matrix.tier }}.ext4"
81+
set -euo pipefail
82+
out="${IMAGE_DIR%/}/${{ matrix.out }}"
83+
# Only the runner-baking rootfs scripts accept --runner-version; the
84+
# tool-cache drive bakes no runner agent, so never pass it there.
85+
extra=()
86+
if [ "${{ matrix.runner_pinned }}" = "true" ] && [ -n "${RUNNER_VERSION}" ]; then
87+
extra+=(--runner-version "${RUNNER_VERSION}")
88+
fi
89+
sudo ${{ matrix.build }} "${extra[@]}" --out "$out"
4190
42-
# The image is published in place on the host; firerunner reflink-clones it
91+
# Images are published in place on the host; firerunner reflink-clones them
4392
# per job. No artifact upload — these files are large and host-local.
4493
- name: Report
45-
run: ls -lh "/var/lib/firerunner/${{ matrix.tier }}.ext4"
94+
run: ls -lh "${IMAGE_DIR%/}/${{ matrix.out }}"

images/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,14 @@ list to the repos you serve by reading their `go.mod` / `.nvmrc` /
151151
## Rebuild policy
152152

153153
GitHub only supports self-hosted runner agents released within the **last 30
154-
days**. `.github/workflows/build-image.yml` rebuilds the images on a schedule
155-
(monthly, well within the window) and on manual dispatch, pinning the latest
156-
`actions/runner` release. Rebuilding also picks up base-OS security updates so
157-
every microVM starts from a patched image.
154+
days**. `.github/workflows/build-image.yml` rebuilds **every** shipped image on a
155+
schedule (monthly, well within the window) and on manual dispatch, pinning the
156+
latest `actions/runner` release. Its matrix covers all five rootfs tiers —
157+
`golden` (shared by `firerunner` / `firerunner-8c16g`), `golden-docker`,
158+
`golden-node`, and the two `ubuntu-rootfs-*` goldens — so none falls out of the
159+
30-day window. The same run also rebuilds the [`--toolcache` drive](#building-the-tool-cache-drive):
160+
it bakes no runner agent (so it is exempt from the 30-day rule) but is refreshed
161+
on the same cadence to pick up toolchain and base-OS updates. Rebuilding the
162+
rootfs images also folds in OS security updates so every microVM starts patched.
163+
The publish directory defaults to `/var/lib/firerunner` and can be overridden via
164+
the `image_dir` dispatch input.

0 commit comments

Comments
 (0)