Skip to content

Commit e12b574

Browse files
committed
ci: Add coverage for composefs installs
Signed-off-by: Colin Walters <[email protected]>
1 parent 59d6b11 commit e12b574

File tree

4 files changed

+54
-11
lines changed

4 files changed

+54
-11
lines changed

.github/actions/bootc-ubuntu-setup/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: 'Bootc Ubuntu Setup'
22
description: 'Default host setup'
3+
inputs:
4+
libvirt:
5+
description: 'Install libvirt and virtualization stack'
6+
required: false
7+
default: 'false'
38
runs:
49
using: 'composite'
510
steps:
@@ -45,3 +50,10 @@ runs:
4550
id: set_arch
4651
shell: bash
4752
run: echo "ARCH=$(arch)" >> $GITHUB_ENV
53+
# Install libvirt stack if requested
54+
- name: Install libvirt and virtualization stack
55+
if: ${{ inputs.libvirt == 'true' }}
56+
shell: bash
57+
run: |
58+
set -eux
59+
sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm qemu-utils libvirt-daemon-system

.github/workflows/ci.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ jobs:
131131
- uses: actions/checkout@v4
132132
- name: Bootc Ubuntu Setup
133133
uses: ./.github/actions/bootc-ubuntu-setup
134-
- name: Install qemu-utils
135-
run: sudo apt install -y qemu-utils
134+
with:
135+
libvirt: true
136136

137137
- name: Build container and disk image
138138
run: |
@@ -163,12 +163,10 @@ jobs:
163163
- uses: actions/checkout@v4
164164
- name: Bootc Ubuntu Setup
165165
uses: ./.github/actions/bootc-ubuntu-setup
166-
- name: Install deps
167-
run: |
168-
sudo apt-get update
169-
# see https://tmt.readthedocs.io/en/stable/overview.html#install
170-
sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-kvm qemu-utils libvirt-daemon-system just
171-
pip install --user "tmt[provision-virtual]"
166+
with:
167+
libvirt: true
168+
- name: Install tmt
169+
run: pip install --user "tmt[provision-virtual]"
172170

173171
- name: Create folder to save disk image
174172
run: mkdir -p target
@@ -192,3 +190,29 @@ jobs:
192190
with:
193191
name: tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-${{ matrix.tmt_plan }}
194192
path: /var/tmp/tmt
193+
# This variant does composefs testing
194+
test-integration-cfs:
195+
strategy:
196+
fail-fast: false
197+
matrix:
198+
test_os: [centos-10]
199+
200+
runs-on: ubuntu-24.04
201+
202+
steps:
203+
- uses: actions/checkout@v4
204+
- name: Bootc Ubuntu Setup
205+
uses: ./.github/actions/bootc-ubuntu-setup
206+
with:
207+
libvirt: true
208+
209+
- name: Build container and disk image
210+
run: |
211+
just build-sealed-integration-test-disk
212+
213+
- name: Archive disk image
214+
uses: actions/upload-artifact@v4
215+
with:
216+
name: PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-sealed-disk
217+
path: target/bootc-integration-test.qcow2
218+
retention-days: 1

Dockerfile.cfsuki

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ dnf install -y systemd-ukify sbsigntools systemd-boot-unsigned
1111
dnf clean all
1212
EORUN
1313

14-
# This must be provided and computed via cfs oci compute-id
15-
ARG COMPOSEFS_FSVERITY
16-
1714
FROM buildroot-base as kernel
15+
# Must be passed
16+
ARG COMPOSEFS_FSVERITY
1817
RUN --mount=type=secret,id=key \
1918
--mount=type=secret,id=cert \
2019
--mount=type=bind,from=base,target=/target \
2120
<<EOF
2221
set -eux
2322

23+
# Should be generated externally
24+
test -n "${COMPOSEFS_FSVERITY}"
25+
2426
# Inject the composefs kernel argument and specify a root with the x86_64 DPS UUID.
2527
# TODO: Discoverable partition fleshed out, or drop root UUID as systemd-stub extension
2628
# TODO: https://github.com/containers/composefs-rs/issues/183
@@ -54,6 +56,7 @@ RUN --mount=type=bind,from=kernel,target=/run/kernel <<EOF
5456
# We put the UKI in /boot for now due to composefs verity not being the
5557
# same due to mtime of /usr/lib/modules being changed
5658
cp /run/kernel/boot/$kver.efi /boot/EFI/Linux/$kver.efi
59+
bootc container lint --fatal-warnings
5760
EOF
5861

5962
FROM base as final-final

Justfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ build-sealed-integration-test-image *ARGS:
2929
just build-integration-test-image
3030
cargo xtask build-sealed localhost/bootc-integration localhost/bootc-integration-sealed
3131

32+
build-sealed-integration-test-disk: build-sealed-integration-test-image
33+
mkdir -p target
34+
just build-disk-image localhost/bootc-integration-sealed target/bootc-integration.qcow2
35+
3236
# Only used by ci.yml right now
3337
build-install-test-image: build-integration-test-image
3438
cd hack && podman build -t localhost/bootc-integration-install -f Containerfile.drop-lbis

0 commit comments

Comments
 (0)