Skip to content

Commit 4c91c48

Browse files
authored
feat(ci): rootless CI (#2496)
* feat(ci): rootless CI 26.04 runners use sudo-rs, which does not support this flag. It doesn't seem to have broken too much, Only thing I could see is the github token not being passed to the build. ``` sudo: preserving the entire environment is not supported, '-E' is ignored ``` So this is a good time to move over to a rootless CI I guess. * chore: unset target-dir for container-storage-action This defaults to the user container storage
1 parent 1d023a7 commit 4c91c48

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

.github/workflows/reusable-build.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373
uses: ublue-os/container-storage-action@25e05be4948f77746938687877829d15c5038036
7474
continue-on-error: true
7575
with:
76-
target-dir: /var/lib/containers
7776
mount-opts: compress-force=zstd:2
7877
loopback-free: '1'
7978

@@ -157,7 +156,7 @@ jobs:
157156
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
158157
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
159158
run: |
160-
sudo -E $(command -v just) \
159+
$(command -v just) \
161160
repo_organization="${{ github.repository_owner }}" \
162161
build \
163162
--image "${MATRIX_BASE_NAME}" \
@@ -170,7 +169,7 @@ jobs:
170169
shell: bash
171170
id: cache-perms
172171
run: |
173-
sudo chmod 777 --recursive /var/tmp/buildah-cache-0
172+
chmod 777 --recursive /var/tmp/buildah-cache-${UID}
174173
175174
- name: Write new DNF package cache
176175
if: steps.setup-cache.outputs.allow_cache_write == 'true'
@@ -188,7 +187,7 @@ jobs:
188187
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
189188
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
190189
run: |
191-
sudo -E $(command -v just) rechunk \
190+
$(command -v just) rechunk \
192191
--image "${MATRIX_BASE_NAME}" \
193192
--tag "${MATRIX_STREAM_NAME}" \
194193
--flavor "${MATRIX_IMAGE_FLAVOR}"
@@ -207,7 +206,7 @@ jobs:
207206
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
208207
SYFT_CMD: ${{ steps.setup-syft.outputs.cmd }}
209208
run: |
210-
sudo -E $(command -v just) gen-sbom \
209+
$(command -v just) gen-sbom \
211210
--image "${MATRIX_BASE_NAME}" \
212211
--tag "${MATRIX_STREAM_NAME}" \
213212
--flavor "${MATRIX_IMAGE_FLAVOR}" \
@@ -221,7 +220,7 @@ jobs:
221220
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
222221
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
223222
run: |
224-
sudo -E $(command -v just) secureboot \
223+
$(command -v just) secureboot \
225224
--image "${MATRIX_BASE_NAME}" \
226225
--tag "${MATRIX_STREAM_NAME}" \
227226
--flavor "${MATRIX_IMAGE_FLAVOR}"
@@ -234,7 +233,7 @@ jobs:
234233
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
235234
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
236235
run: |
237-
sudo -E $(command -v just) export-oci \
236+
$(command -v just) export-oci \
238237
--image "${MATRIX_BASE_NAME}" \
239238
--tag "${MATRIX_STREAM_NAME}" \
240239
--flavor "${MATRIX_IMAGE_FLAVOR}"
@@ -260,7 +259,7 @@ jobs:
260259
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
261260
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
262261
run: |
263-
sudo -E $(command -v just) disk-image \
262+
$(command -v just) disk-image \
264263
--image "${MATRIX_BASE_NAME}" \
265264
--tag "${MATRIX_STREAM_NAME}" \
266265
--flavor "${MATRIX_IMAGE_FLAVOR}" \
@@ -309,7 +308,7 @@ jobs:
309308
ALIAS_TAGS: ${{ steps.generate-tags.outputs.alias_tags }}
310309
run: |
311310
set -eoux pipefail
312-
sudo -E $(command -v just) tag-images \
311+
$(command -v just) tag-images \
313312
--image "${IMAGE_NAME}" \
314313
--default-tag "${MATRIX_STREAM_NAME}" \
315314
--tags "${ALIAS_TAGS}"
@@ -346,7 +345,7 @@ jobs:
346345
run: |
347346
set -euox pipefail
348347
349-
sudo -E $(command -v just) push-image \
348+
$(command -v just) push-image \
350349
--image "${MATRIX_BASE_NAME}" \
351350
--tag "${MATRIX_STREAM_NAME}" \
352351
--flavor "${MATRIX_IMAGE_FLAVOR}" \
@@ -386,7 +385,7 @@ jobs:
386385
run: |
387386
set -euox pipefail
388387
389-
sudo -E $(command -v just) push-image \
388+
$(command -v just) push-image \
390389
--image "${MATRIX_BASE_NAME}" \
391390
--tag "${MATRIX_STREAM_NAME}" \
392391
--flavor "${MATRIX_IMAGE_FLAVOR}" \

Justfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,8 @@ disk-image $image="aurora" $tag="latest" $flavor="main" $ghcr="false" $backend="
841841
BOOTC_INSTALL_ARGS+=("--bootloader systemd" "--composefs-backend")
842842
fi
843843
844+
{{ just }} load-rootful --image "${image}" --tag "${tag}" --flavor "${flavor}"
845+
844846
{{ just }} bootc "${image}" "${tag}" "${flavor}" install to-disk "${BOOTC_INSTALL_ARGS[@]}"
845847
846848
# FIXME: Please consider using podman push in the future for signing as well instead of temporary tag + cosign

0 commit comments

Comments
 (0)