|
1 | 1 | name: build-image |
2 | 2 |
|
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) |
6 | 17 |
|
7 | 18 | on: |
8 | 19 | schedule: |
|
14 | 25 | description: "actions/runner version to pin (blank = latest)" |
15 | 26 | required: false |
16 | 27 | default: "" |
| 28 | + image_dir: |
| 29 | + description: "Directory to publish the images into" |
| 30 | + required: false |
| 31 | + default: "/var/lib/firerunner" |
17 | 32 |
|
18 | 33 | permissions: |
19 | 34 | contents: read |
20 | 35 |
|
| 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 | + |
21 | 41 | jobs: |
22 | 42 | build: |
23 | 43 | # Requires a Linux KVM host with loop-mount + mkfs.ext4 (self-hosted). |
24 | 44 | runs-on: [self-hosted, kvm] |
25 | 45 | strategy: |
26 | 46 | fail-fast: false |
27 | 47 | 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 |
31 | 73 | steps: |
32 | 74 | - name: Checkout |
33 | 75 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
34 | 76 |
|
35 | | - - name: Build golden rootfs (${{ matrix.tier }}) |
| 77 | + - name: Build ${{ matrix.name }} |
| 78 | + env: |
| 79 | + RUNNER_VERSION: ${{ inputs.runner_version }} |
36 | 80 | 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" |
41 | 90 |
|
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 |
43 | 92 | # per job. No artifact upload — these files are large and host-local. |
44 | 93 | - name: Report |
45 | | - run: ls -lh "/var/lib/firerunner/${{ matrix.tier }}.ext4" |
| 94 | + run: ls -lh "${IMAGE_DIR%/}/${{ matrix.out }}" |
0 commit comments