Skip to content

Commit cfd014f

Browse files
authored
refactor(ci): initial work for using flag/arg-based workflow (#2443)
* refactor(ci): initial work for using flag/arg-based workflow The goal of this is to make the buildsystem function like any other CLI program. The only recipes I haven't touched in this PR are the very simple recipes like verify-container, retag-nvidia-ghcr and login-registry. In the future I want to split up this Justfile in multiple smaller ones where it feels right to do that. resolves: #2436 * document minimum just version * build recipe * feat: redo the way we do kernel pins This allows an independent pinning of kernels for future ARM builds regardless of x86. Probably the way we should have done it from the beginning. * get rid of build-ghcr and build-pipeline related things We are not using the build-pipeline recipe anywhere right now. I think a build-rechunk recipe is good enough for now. I think build-ghcr doesn't make any sense anymore as it's now just a single additional flag. The rechunk recipe with chunkah currently doesn't alter any behavior when run in ghcr so we can delete this. But this will likely change when chunkah implements some form of passing a previous manifest. I want to do a recipe at some point which replaces the general idea of the pipeline recipe and is as close to github as possible. Build -> Rechunk -> Secureboot-> tag + push an image to a local registry bootc install. * do deprecated build-chunked-oci recipe * remove build-pipeline parts of ostree-rechunk * export oci * load rootful recipe currently not used in CI as we are running everything as root. * secureboot * generate-point * gen-sbom * package cache * bootc install * some remaining shebangs best practice to use env bash here instead * push recipe * redo generate-build-tags and tag-images I removed the version input here. This has been broken for probably a very long time, this didn't do anything for months at least, oldest log I could find here: ``` Error: no such object: "aurora:latest" Tags for this Action... latest latest-43.20260424 latest-20260424 43 43-43.20260424 43-20260424 ``` Kernel input is now done through just, so no reason to pass that, no idea why we had that here in the first place. * fix kernel pin for build-rechunk This convenience recipe needs to take all the options from the build one
1 parent d267b04 commit cfd014f

5 files changed

Lines changed: 283 additions & 227 deletions

File tree

.github/workflows/build-image-latest-main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
image_flavors: '["main", "nvidia-open"]'
4141
brand_name: ${{ matrix.brand_name }}
4242
stream_name: latest
43-
#kernel_pin: 6.12.15-200.fc41.x86_64
4443
# FIXME: MAIN has no arm builds in ublue-os/akmods yet
4544
# https://github.com/ublue-os/akmods/pull/440
4645
# architecture: '["aarch64","x86_64"]'

.github/workflows/build-image-stable.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
matrix:
3232
brand_name: ["aurora"]
3333
with:
34-
#kernel_pin: 6.14.11-300.fc42.x86_64 ## This is where kernels get pinned.
3534
brand_name: ${{ matrix.brand_name }}
3635
stream_name: stable
3736
# Enable ARM when it makes sense

.github/workflows/build-image-testing.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
image_flavors: '["main", "nvidia-open"]'
3232
brand_name: ${{ matrix.brand_name }}
3333
stream_name: testing
34-
#kernel_pin: 6.12.15-200.fc41.x86_64
3534
# FIXME: MAIN has no arm builds in ublue-os/akmods yet
3635
# https://github.com/ublue-os/akmods/pull/440
3736
# architecture: '["aarch64","x86_64"]'

.github/workflows/reusable-build.yml

Lines changed: 63 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ on:
1515
description: "The Fedora Version: stable, or latest"
1616
required: true
1717
type: string
18-
kernel_pin:
19-
description: "The full kernel version to pin"
20-
type: string
2118
architecture:
2219
description: "JSON string of architectures to build, '[aarch64, x86_64]'"
2320
default: "['x86_64']"
@@ -134,7 +131,11 @@ jobs:
134131
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
135132
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
136133
run: |
137-
IMAGE_NAME="$(just image_name ${MATRIX_BASE_NAME} ${MATRIX_STREAM_NAME} ${MATRIX_IMAGE_FLAVOR})"
134+
IMAGE_NAME="$(just image_name \
135+
--image ${MATRIX_BASE_NAME} \
136+
--tag ${MATRIX_STREAM_NAME} \
137+
--flavor ${MATRIX_IMAGE_FLAVOR})"
138+
138139
echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV
139140
140141
- name: DNF Package Cache Setup
@@ -146,11 +147,12 @@ jobs:
146147
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
147148
GITHUB_EVENT_NAME: ${{ github.event_name }}
148149
run: |
149-
CACHE="$(just setup-cache "${MATRIX_BASE_NAME}" \
150-
"${MATRIX_STREAM_NAME}" \
151-
"${MATRIX_IMAGE_FLAVOR}" \
152-
"1" \
153-
"${GITHUB_EVENT_NAME}")"
150+
CACHE="$(just setup-cache \
151+
--image "${MATRIX_BASE_NAME}" \
152+
--tag "${MATRIX_STREAM_NAME}" \
153+
--flavor "${MATRIX_IMAGE_FLAVOR}" \
154+
--ghcr \
155+
--github-event "${GITHUB_EVENT_NAME}")"
154156
155157
CACHE_NAME="$(echo "${CACHE}" | cut -d' ' -f 1)"
156158
ALLOW_CACHE_WRITE="$(echo "${CACHE}" | cut -d' ' -f 2)"
@@ -173,17 +175,18 @@ jobs:
173175
id: build-image
174176
shell: bash
175177
env:
176-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # ghcurl
177179
MATRIX_BASE_NAME: ${{ matrix.base_name }}
178180
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
179181
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
180-
INPUTS_KERNEL_PIN: ${{ inputs.kernel_pin }}
181182
run: |
182-
sudo -E $(command -v just) repo_organization="${{ github.repository_owner }}" \
183-
build-ghcr "${MATRIX_BASE_NAME}" \
184-
"${MATRIX_STREAM_NAME}" \
185-
"${MATRIX_IMAGE_FLAVOR}" \
186-
"${INPUTS_KERNEL_PIN}"
183+
sudo -E $(command -v just) \
184+
repo_organization="${{ github.repository_owner }}" \
185+
build \
186+
--image "${MATRIX_BASE_NAME}" \
187+
--tag "${MATRIX_STREAM_NAME}" \
188+
--flavor "${MATRIX_IMAGE_FLAVOR}" \
189+
--ghcr
187190
188191
# https://github.com/actions/cache/issues/1533
189192
- name: Hack around permission issue caching
@@ -208,9 +211,10 @@ jobs:
208211
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
209212
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
210213
run: |
211-
sudo -E $(command -v just) rechunk "${MATRIX_BASE_NAME}" \
212-
"${MATRIX_STREAM_NAME}" \
213-
"${MATRIX_IMAGE_FLAVOR}"
214+
sudo -E $(command -v just) rechunk \
215+
--image "${MATRIX_BASE_NAME}" \
216+
--tag "${MATRIX_STREAM_NAME}" \
217+
--flavor "${MATRIX_IMAGE_FLAVOR}"
214218
215219
- name: Setup Syft
216220
id: setup-syft
@@ -226,10 +230,11 @@ jobs:
226230
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
227231
SYFT_CMD: ${{ steps.setup-syft.outputs.cmd }}
228232
run: |
229-
sudo -E $(command -v just) gen-sbom "${MATRIX_BASE_NAME}" \
230-
"${MATRIX_STREAM_NAME}" \
231-
"${MATRIX_IMAGE_FLAVOR}" \
232-
"${SYFT_CMD}"
233+
sudo -E $(command -v just) gen-sbom \
234+
--image "${MATRIX_BASE_NAME}" \
235+
--tag "${MATRIX_STREAM_NAME}" \
236+
--flavor "${MATRIX_IMAGE_FLAVOR}" \
237+
"${SYFT_CMD}"
233238
234239
- name: Secureboot Check
235240
id: secureboot
@@ -239,9 +244,10 @@ jobs:
239244
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
240245
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
241246
run: |
242-
sudo -E $(command -v just) secureboot "${MATRIX_BASE_NAME}" \
243-
"${MATRIX_STREAM_NAME}" \
244-
"${MATRIX_IMAGE_FLAVOR}"
247+
sudo -E $(command -v just) secureboot \
248+
--image "${MATRIX_BASE_NAME}" \
249+
--tag "${MATRIX_STREAM_NAME}" \
250+
--flavor "${MATRIX_IMAGE_FLAVOR}"
245251
246252
- name: Export to OCI Archive
247253
if: github.event_name == 'pull_request'
@@ -251,9 +257,10 @@ jobs:
251257
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
252258
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
253259
run: |
254-
sudo -E $(command -v just) export-oci "${MATRIX_BASE_NAME}" \
255-
"${MATRIX_STREAM_NAME}" \
256-
"${MATRIX_IMAGE_FLAVOR}"
260+
sudo -E $(command -v just) export-oci \
261+
--image "${MATRIX_BASE_NAME}" \
262+
--tag "${MATRIX_STREAM_NAME}" \
263+
--flavor "${MATRIX_IMAGE_FLAVOR}"
257264
258265
- name: Upload OCI Archive as Artifact
259266
if: github.event_name == 'pull_request'
@@ -276,10 +283,11 @@ jobs:
276283
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
277284
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
278285
run: |
279-
sudo -E $(command -v just) disk-image "${MATRIX_BASE_NAME}" \
280-
"${MATRIX_STREAM_NAME}" \
281-
"${MATRIX_IMAGE_FLAVOR}" \
282-
1
286+
sudo -E $(command -v just) disk-image \
287+
--image"${MATRIX_BASE_NAME}" \
288+
--tag "${MATRIX_STREAM_NAME}" \
289+
--flavor "${MATRIX_IMAGE_FLAVOR}" \
290+
--ghcr
283291
284292
- name: PR Testing Instructions
285293
if: github.event_name == 'pull_request'
@@ -299,20 +307,17 @@ jobs:
299307
MATRIX_BASE_NAME: "${{ matrix.base_name }}"
300308
MATRIX_STREAM_NAME: "${{ matrix.stream_name }}"
301309
MATRIX_IMAGE_FLAVOR: "${{ matrix.image_flavor }}"
302-
INPUTS_KERNEL_PIN: "${{ inputs.kernel_pin }}"
303310
IMAGE_NAME: ${{ env.IMAGE_NAME }}
304311
GITHUB_EVENT_NAME: ${{ github.event_name }}
305312
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
306313
run: |
307314
alias_tags="$(just generate-build-tags \
308-
"${MATRIX_BASE_NAME}" \
309-
"${MATRIX_STREAM_NAME}" \
310-
"${MATRIX_IMAGE_FLAVOR}" \
311-
"${INPUTS_KERNEL_PIN}" \
312-
"1" \
313-
"$(podman inspect ${IMAGE_NAME}:${MATRIX_STREAM_NAME} | jq -r '.[].Config.Labels["org.opencontainers.image.version"]')" \
314-
"${GITHUB_EVENT_NAME}" \
315-
"${GITHUB_EVENT_NUMBER}")"
315+
--image "${MATRIX_BASE_NAME}" \
316+
--tag "${MATRIX_STREAM_NAME}" \
317+
--flavor "${MATRIX_IMAGE_FLAVOR}" \
318+
--ghcr \
319+
--github-event "${GITHUB_EVENT_NAME}" \
320+
--github-number "${GITHUB_EVENT_NUMBER}")"
316321
317322
echo "Tags for this Action..."
318323
echo "$alias_tags"
@@ -327,9 +332,10 @@ jobs:
327332
ALIAS_TAGS: ${{ steps.generate-tags.outputs.alias_tags }}
328333
run: |
329334
set -eoux pipefail
330-
sudo -E $(command -v just) tag-images "${IMAGE_NAME}" \
331-
"${MATRIX_STREAM_NAME}" \
332-
"${ALIAS_TAGS}"
335+
sudo -E $(command -v just) tag-images \
336+
--image "${IMAGE_NAME}" \
337+
--default-tag "${MATRIX_STREAM_NAME}" \
338+
--tags "${ALIAS_TAGS}"
333339
334340
- name: Login to GitHub Container Registry
335341
if: inputs.publish
@@ -364,13 +370,13 @@ jobs:
364370
set -euox pipefail
365371
366372
sudo -E $(command -v just) push-image \
367-
"${MATRIX_BASE_NAME}" \
368-
"${MATRIX_STREAM_NAME}" \
369-
"${MATRIX_IMAGE_FLAVOR}" \
370-
"1" \
371-
"${IMAGE_REGISTRY}" \
372-
"1" \
373-
"${TEMP_PUSH_TAG}"
373+
--image "${MATRIX_BASE_NAME}" \
374+
--tag "${MATRIX_STREAM_NAME}" \
375+
--flavor "${MATRIX_IMAGE_FLAVOR}" \
376+
--ghcr \
377+
--registry "${IMAGE_REGISTRY}" \
378+
--temp-push \
379+
--temp-push-tag "${TEMP_PUSH_TAG}"
374380
375381
digest=$(< /tmp/digestfile)
376382
echo "digest=${digest}" >> $GITHUB_OUTPUT
@@ -404,11 +410,11 @@ jobs:
404410
set -euox pipefail
405411
406412
sudo -E $(command -v just) push-image \
407-
"${MATRIX_BASE_NAME}" \
408-
"${MATRIX_STREAM_NAME}" \
409-
"${MATRIX_IMAGE_FLAVOR}" \
410-
"1" \
411-
"${IMAGE_REGISTRY}"
413+
--image "${MATRIX_BASE_NAME}" \
414+
--tag "${MATRIX_STREAM_NAME}" \
415+
--flavor "${MATRIX_IMAGE_FLAVOR}" \
416+
--ghcr \
417+
--registry "${IMAGE_REGISTRY}"
412418
413419
digest=$(< /tmp/digestfile)
414420
echo "digest=${digest}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)