2025-09-19 15:40:44 -04:00
|
|
|
# The default entrypoint to working on this project.
|
|
|
|
|
# Commands here typically wrap e.g. `podman build` or
|
2025-09-22 14:48:13 -04:00
|
|
|
# other tools like `bcvk` which might launch local virtual machines.
|
2025-09-19 15:40:44 -04:00
|
|
|
#
|
2025-09-22 14:48:13 -04:00
|
|
|
# See also `Makefile` and `xtask.rs`. Commands which end in `-local`
|
2025-10-31 17:47:17 -04:00
|
|
|
# skip containerization or virtualization (and typically just proxy `make`).
|
|
|
|
|
#
|
|
|
|
|
# Rules written here are *often* used by the Github Action flows,
|
|
|
|
|
# and should support being configurable where that makes sense (e.g.
|
|
|
|
|
# the `build` rule supports being provided a base image).
|
2025-12-17 07:33:49 -05:00
|
|
|
#
|
|
|
|
|
# By default the layering should be thus:
|
|
|
|
|
# Github Actions -> Justfile -> podman -> make -> rustc
|
|
|
|
|
# -> podman -> dnf|apt ...
|
|
|
|
|
# -> cargo xtask
|
2025-09-22 14:48:13 -04:00
|
|
|
# --------------------------------------------------------------------
|
2025-09-19 15:40:44 -04:00
|
|
|
|
2025-11-20 13:52:45 -05:00
|
|
|
# This image is just the base image plus our updated bootc binary
|
|
|
|
|
base_img := "localhost/bootc"
|
|
|
|
|
# Derives from the above and adds nushell, cloudinit etc.
|
|
|
|
|
integration_img := base_img + "-integration"
|
|
|
|
|
# Has a synthetic upgrade
|
|
|
|
|
integration_upgrade_img := integration_img + "-upgrade"
|
|
|
|
|
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
# ostree: The default
|
|
|
|
|
# composefs-sealeduki-sdboot: A system with a sealed composefs using systemd-boot
|
|
|
|
|
variant := env("BOOTC_variant", "ostree")
|
|
|
|
|
base := env("BOOTC_base", "quay.io/centos-bootc/centos-bootc:stream10")
|
2025-11-28 17:11:07 +08:00
|
|
|
buildroot_base := env("BOOTC_buildroot_base", "quay.io/centos/centos:stream10")
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
|
2025-11-08 10:50:42 -05:00
|
|
|
testimage_label := "bootc.testimage=1"
|
2025-12-02 20:45:40 -05:00
|
|
|
# Images used by hack/lbi; keep in sync
|
|
|
|
|
lbi_images := "quay.io/curl/curl:latest quay.io/curl/curl-base:latest registry.access.redhat.com/ubi9/podman:latest"
|
2025-11-16 14:22:56 -05:00
|
|
|
# We used to have --jobs=4 here but sometimes that'd hit this
|
|
|
|
|
# ```
|
|
|
|
|
# [2/3] STEP 2/2: RUN --mount=type=bind,from=context,target=/run/context <<EORUN (set -xeuo pipefail...)
|
|
|
|
|
# --> Using cache b068d42ac7491067cf5fafcaaf2f09d348e32bb752a22c85bbb87f266409554d
|
|
|
|
|
# --> b068d42ac749
|
|
|
|
|
# + cd /run/context/
|
|
|
|
|
# /bin/sh: line 3: cd: /run/context/: Permission denied
|
|
|
|
|
# ```
|
|
|
|
|
# TODO: Gather more info and file a buildah bug
|
2025-12-02 20:45:40 -05:00
|
|
|
generic_buildargs := ""
|
|
|
|
|
# Args for package building (no secrets needed, just builds RPMs)
|
|
|
|
|
base_buildargs := generic_buildargs + " --build-arg=base=" + base + " --build-arg=variant=" + variant
|
|
|
|
|
buildargs := base_buildargs + " --secret=id=secureboot_key,src=target/test-secureboot/db.key --secret=id=secureboot_cert,src=target/test-secureboot/db.crt"
|
|
|
|
|
# Args for build-sealed (no base arg, it sets that itself)
|
|
|
|
|
sealed_buildargs := "--build-arg=variant=" + variant + " --secret=id=secureboot_key,src=target/test-secureboot/db.key --secret=id=secureboot_cert,src=target/test-secureboot/db.crt"
|
|
|
|
|
|
2025-12-16 13:31:22 -05:00
|
|
|
# Compute SOURCE_DATE_EPOCH and VERSION from git for reproducible builds.
|
|
|
|
|
# Outputs shell variable assignments that can be eval'd.
|
|
|
|
|
_git-build-vars:
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
|
|
|
|
|
# Compute version from git (matching xtask.rs gitrev logic)
|
|
|
|
|
if VERSION=$(git describe --tags --exact-match 2>/dev/null); then
|
|
|
|
|
VERSION="${VERSION#v}"
|
|
|
|
|
VERSION="${VERSION//-/.}"
|
|
|
|
|
else
|
|
|
|
|
COMMIT=$(git rev-parse HEAD | cut -c1-10)
|
|
|
|
|
COMMIT_TS=$(git show -s --format=%ct)
|
|
|
|
|
TIMESTAMP=$(date -u -d @${COMMIT_TS} +%Y%m%d%H%M)
|
|
|
|
|
VERSION="${TIMESTAMP}.g${COMMIT}"
|
|
|
|
|
fi
|
|
|
|
|
echo "SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH}"
|
|
|
|
|
echo "VERSION=${VERSION}"
|
|
|
|
|
|
2025-12-19 17:30:46 +08:00
|
|
|
# Needed by bootc install on ostree
|
|
|
|
|
fedora-coreos := "quay.io/fedora/fedora-coreos:testing-devel"
|
|
|
|
|
|
2025-12-02 20:45:40 -05:00
|
|
|
# The default target: build the container image from current sources.
|
2025-09-19 15:40:44 -04:00
|
|
|
# Note commonly you might want to override the base image via e.g.
|
|
|
|
|
# `just build --build-arg=base=quay.io/fedora/fedora-bootc:42`
|
2025-12-16 13:31:22 -05:00
|
|
|
#
|
|
|
|
|
# The Dockerfile builds RPMs internally in its 'build' stage, so we don't need
|
|
|
|
|
# to call 'package' first. This avoids cache invalidation from external files.
|
|
|
|
|
build: _keygen
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
eval $(just _git-build-vars)
|
|
|
|
|
podman build {{base_buildargs}} --target=final \
|
|
|
|
|
--build-arg=SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
|
|
|
|
|
--build-arg=pkgversion=${VERSION} \
|
|
|
|
|
-t {{base_img}}-bin {{buildargs}} .
|
2025-12-02 20:45:40 -05:00
|
|
|
./hack/build-sealed {{variant}} {{base_img}}-bin {{base_img}} {{sealed_buildargs}}
|
2025-11-26 10:00:33 -05:00
|
|
|
|
2025-12-02 20:45:40 -05:00
|
|
|
# Generate Secure Boot keys (only for our own CI/testing)
|
|
|
|
|
_keygen:
|
|
|
|
|
./hack/generate-secureboot-keys
|
2025-10-02 02:32:52 +02:00
|
|
|
|
2025-11-19 14:19:20 -05:00
|
|
|
# Build a sealed image from current sources.
|
|
|
|
|
build-sealed:
|
|
|
|
|
@just --justfile {{justfile()}} variant=composefs-sealeduki-sdboot build
|
|
|
|
|
|
2025-11-16 11:48:43 -05:00
|
|
|
# Build packages (e.g. RPM) using a container buildroot
|
|
|
|
|
_packagecontainer:
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
2025-12-16 13:31:22 -05:00
|
|
|
eval $(just _git-build-vars)
|
2025-11-16 11:48:43 -05:00
|
|
|
echo "Building RPM with version: ${VERSION}"
|
2025-12-16 13:31:22 -05:00
|
|
|
podman build {{base_buildargs}} --build-arg=SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} --build-arg=pkgversion=${VERSION} -t localhost/bootc-pkg --target=build .
|
2025-11-16 11:48:43 -05:00
|
|
|
|
2025-11-26 10:00:33 -05:00
|
|
|
# Build packages (e.g. RPM) into target/packages/
|
2025-11-16 11:48:43 -05:00
|
|
|
# Any old packages will be removed.
|
|
|
|
|
package: _packagecontainer
|
2025-11-26 10:00:33 -05:00
|
|
|
mkdir -p target/packages
|
|
|
|
|
rm -vf target/packages/*.rpm
|
|
|
|
|
podman run --rm localhost/bootc-pkg tar -C /out/ -cf - . | tar -C target/packages/ -xvf -
|
|
|
|
|
chmod a+rx target target/packages
|
|
|
|
|
chmod a+r target/packages/*.rpm
|
|
|
|
|
podman rmi localhost/bootc-pkg
|
|
|
|
|
|
|
|
|
|
# Copy pre-existing packages from PATH into target/packages/
|
2025-12-16 13:31:22 -05:00
|
|
|
# Note: This is mainly for CI artifact extraction; build-from-package
|
|
|
|
|
# now uses volume mounts directly instead of copying to target/packages/.
|
2025-11-26 10:00:33 -05:00
|
|
|
copy-packages-from PATH:
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
if ! compgen -G "{{PATH}}/*.rpm" > /dev/null; then
|
|
|
|
|
echo "Error: No packages found in {{PATH}}" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
mkdir -p target/packages
|
|
|
|
|
rm -vf target/packages/*.rpm
|
|
|
|
|
cp -v {{PATH}}/*.rpm target/packages/
|
|
|
|
|
chmod a+rx target target/packages
|
|
|
|
|
chmod a+r target/packages/*.rpm
|
2025-11-16 11:48:43 -05:00
|
|
|
|
2025-12-02 20:45:40 -05:00
|
|
|
# Build the container image using pre-existing packages from PATH
|
2025-12-16 13:31:22 -05:00
|
|
|
# Uses the 'final-from-packages' target with a volume mount to inject packages,
|
|
|
|
|
# avoiding Docker context cache invalidation issues.
|
2025-12-02 20:45:40 -05:00
|
|
|
build-from-package PATH: _keygen
|
2025-12-16 13:31:22 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
# Resolve to absolute path for podman volume mount
|
|
|
|
|
# Use :z for SELinux relabeling
|
|
|
|
|
pkg_path=$(realpath "{{PATH}}")
|
|
|
|
|
podman build {{base_buildargs}} --target=final-from-packages -v "${pkg_path}":/run/packages:ro,z -t {{base_img}}-bin {{buildargs}} .
|
2025-12-02 20:45:40 -05:00
|
|
|
./hack/build-sealed {{variant}} {{base_img}}-bin {{base_img}} {{sealed_buildargs}}
|
|
|
|
|
|
|
|
|
|
# Pull images used by hack/lbi
|
|
|
|
|
_pull-lbi-images:
|
|
|
|
|
podman pull -q --retry 5 --retry-delay 5s {{lbi_images}}
|
|
|
|
|
|
2025-06-06 11:11:58 -04:00
|
|
|
# This container image has additional testing content and utilities
|
2025-12-02 20:45:40 -05:00
|
|
|
build-integration-test-image: build _pull-lbi-images
|
2025-11-20 13:52:45 -05:00
|
|
|
cd hack && podman build {{base_buildargs}} -t {{integration_img}}-bin -f Containerfile .
|
2025-12-02 20:45:40 -05:00
|
|
|
./hack/build-sealed {{variant}} {{integration_img}}-bin {{integration_img}} {{sealed_buildargs}}
|
2025-09-11 13:57:46 -04:00
|
|
|
|
2025-11-26 10:00:33 -05:00
|
|
|
# Build integration test image using pre-existing packages from PATH
|
2025-12-02 20:45:40 -05:00
|
|
|
build-integration-test-image-from-package PATH: _pull-lbi-images
|
2025-11-26 10:00:33 -05:00
|
|
|
@just build-from-package {{PATH}}
|
|
|
|
|
cd hack && podman build {{base_buildargs}} -t {{integration_img}}-bin -f Containerfile .
|
2025-12-02 20:45:40 -05:00
|
|
|
./hack/build-sealed {{variant}} {{integration_img}}-bin {{integration_img}} {{sealed_buildargs}}
|
2025-11-26 10:00:33 -05:00
|
|
|
|
2025-11-20 17:02:06 -05:00
|
|
|
# Build+test using the `composefs-sealeduki-sdboot` variant.
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
test-composefs:
|
2025-11-20 17:02:06 -05:00
|
|
|
just variant=composefs-sealeduki-sdboot test-tmt readonly local-upgrade-reboot
|
2025-10-02 02:32:52 +02:00
|
|
|
|
2025-09-11 13:57:46 -04:00
|
|
|
# Only used by ci.yml right now
|
|
|
|
|
build-install-test-image: build-integration-test-image
|
2025-11-20 13:52:45 -05:00
|
|
|
cd hack && podman build {{base_buildargs}} -t {{integration_img}}-install -f Containerfile.drop-lbis
|
2025-06-06 11:11:58 -04:00
|
|
|
|
2025-09-22 14:48:13 -04:00
|
|
|
# These tests accept the container image as input, and may spawn it.
|
2025-07-17 14:38:21 -04:00
|
|
|
run-container-external-tests:
|
2025-11-20 13:52:45 -05:00
|
|
|
./tests/container/run {{base_img}}
|
2025-07-17 14:38:21 -04:00
|
|
|
|
2025-09-22 14:48:13 -04:00
|
|
|
# We build the unit tests into a container image
|
|
|
|
|
build-units:
|
2025-12-16 13:31:22 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
eval $(just _git-build-vars)
|
|
|
|
|
podman build {{base_buildargs}} --build-arg=SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} --build-arg=pkgversion=${VERSION} --target units -t localhost/bootc-units .
|
2025-09-22 14:48:13 -04:00
|
|
|
|
|
|
|
|
# Perform validation (build, linting) in a container build environment
|
|
|
|
|
validate:
|
2025-11-08 10:50:42 -05:00
|
|
|
podman build {{base_buildargs}} --target validate .
|
2025-09-22 14:48:13 -04:00
|
|
|
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
# Run tmt-based test suites using local virtual machines with
|
|
|
|
|
# bcvk.
|
2025-09-22 14:48:13 -04:00
|
|
|
#
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
# To run an individual test, pass it as an argument like:
|
|
|
|
|
# `just test-tmt readonly`
|
2025-12-19 17:30:46 +08:00
|
|
|
#
|
|
|
|
|
# To run the integration tests, execute `just test-tmt integration`
|
2025-11-20 13:52:45 -05:00
|
|
|
test-tmt *ARGS: build-integration-test-image _build-upgrade-image
|
|
|
|
|
@just test-tmt-nobuild {{ARGS}}
|
|
|
|
|
|
|
|
|
|
# Generate a local synthetic upgrade
|
|
|
|
|
_build-upgrade-image:
|
2025-11-20 17:02:06 -05:00
|
|
|
cat tmt/tests/Dockerfile.upgrade | podman build -t {{integration_upgrade_img}}-bin --from={{integration_img}}-bin -
|
2025-12-02 20:45:40 -05:00
|
|
|
./hack/build-sealed {{variant}} {{integration_upgrade_img}}-bin {{integration_upgrade_img}} {{sealed_buildargs}}
|
2025-11-20 13:52:45 -05:00
|
|
|
|
|
|
|
|
# Assume the localhost/bootc-integration image is up to date, and just run tests.
|
|
|
|
|
# Useful for iterating on tests quickly.
|
|
|
|
|
test-tmt-nobuild *ARGS:
|
2025-11-24 16:35:48 -05:00
|
|
|
cargo xtask run-tmt --env=BOOTC_variant={{variant}} --upgrade-image={{integration_upgrade_img}} {{integration_img}} {{ARGS}}
|
2025-09-22 14:48:13 -04:00
|
|
|
|
2025-12-19 17:30:46 +08:00
|
|
|
# Build test container image for testing on coreos with SKIP_CONFIGS=1,
|
|
|
|
|
# without configs and no curl container image
|
|
|
|
|
build-testimage-coreos PATH:
|
|
|
|
|
@just build-from-package {{PATH}}
|
|
|
|
|
cd hack && podman build {{base_buildargs}} --build-arg SKIP_CONFIGS=1 -t {{integration_img}}-coreos -f Containerfile .
|
|
|
|
|
|
|
|
|
|
# Run test bootc install on FCOS
|
|
|
|
|
# BOOTC_target is `bootc-integration-coreos`, it will be used for bootc install.
|
|
|
|
|
# Run `just build-testimage-coreos target/packages` to build test image firstly,
|
|
|
|
|
# then run `just test-tmt-on-coreos plan-bootc-install-on-coreos`
|
|
|
|
|
test-tmt-on-coreos *ARGS:
|
|
|
|
|
cargo xtask run-tmt --env=BOOTC_variant={{variant}} --env=BOOTC_target={{integration_img}}-coreos:latest {{fedora-coreos}} {{ARGS}}
|
|
|
|
|
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
# Cleanup all test VMs created by tmt tests
|
|
|
|
|
tmt-vm-cleanup:
|
|
|
|
|
bcvk libvirt rm --stop --force --label bootc.test=1
|
2025-09-22 14:48:13 -04:00
|
|
|
|
|
|
|
|
# Run tests (unit and integration) that are containerized
|
|
|
|
|
test-container: build-units build-integration-test-image
|
|
|
|
|
podman run --rm --read-only localhost/bootc-units /usr/bin/bootc-units
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
# Pass these through for cross-checking
|
2025-11-20 13:52:45 -05:00
|
|
|
podman run --rm --env=BOOTC_variant={{variant}} --env=BOOTC_base={{base}} {{integration_img}} bootc-integration-tests container
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
|
2025-11-08 10:50:42 -05:00
|
|
|
# Remove all container images built (locally) via this Justfile, by matching a label
|
|
|
|
|
clean-local-images:
|
|
|
|
|
podman images --filter "label={{testimage_label}}"
|
|
|
|
|
podman images --filter "label={{testimage_label}}" --format "{{{{.ID}}" | xargs -r podman rmi -f
|
2025-12-19 17:30:46 +08:00
|
|
|
podman image prune -f
|
|
|
|
|
podman rmi {{fedora-coreos}} -f
|
2025-11-08 10:50:42 -05:00
|
|
|
|
2025-11-27 13:31:31 +08:00
|
|
|
# Print the container image reference for a given short $ID-VERSION_ID for NAME
|
|
|
|
|
# and 'base' or 'buildroot-base' for TYPE (base image type)
|
|
|
|
|
pullspec-for-os TYPE NAME:
|
|
|
|
|
@jq -r --arg v "{{NAME}}" '."{{TYPE}}"[$v]' < hack/os-image-map.json
|
2025-09-04 18:11:14 -04:00
|
|
|
|
2025-09-25 13:42:22 -04:00
|
|
|
build-mdbook:
|
2025-11-08 10:50:42 -05:00
|
|
|
cd docs && podman build {{base_buildargs}} -t localhost/bootc-mdbook -f Dockerfile.mdbook
|
2025-09-25 13:42:22 -04:00
|
|
|
|
|
|
|
|
# Generate the rendered HTML to the target DIR directory
|
|
|
|
|
build-mdbook-to DIR: build-mdbook
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
# Create a temporary container to extract the built docs
|
|
|
|
|
container_id=$(podman create localhost/bootc-mdbook)
|
|
|
|
|
podman cp ${container_id}:/src/book {{DIR}}
|
|
|
|
|
podman rm -f ${container_id}
|
|
|
|
|
|
|
|
|
|
mdbook-serve: build-mdbook
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
podman run --init --replace -d --name bootc-mdbook --rm --publish 127.0.0.1::8000 localhost/bootc-mdbook
|
|
|
|
|
echo http://$(podman port bootc-mdbook 8000/tcp)
|
|
|
|
|
|
2025-09-04 18:11:14 -04:00
|
|
|
# Update all generated files (man pages and JSON schemas)
|
|
|
|
|
#
|
|
|
|
|
# This is the unified command that:
|
|
|
|
|
# - Auto-discovers new CLI commands and creates man page templates
|
|
|
|
|
# - Syncs CLI options from Rust code to existing man page templates
|
|
|
|
|
# - Updates JSON schema files
|
|
|
|
|
#
|
|
|
|
|
# Use this after adding, removing, or modifying CLI options or schemas.
|
|
|
|
|
update-generated:
|
|
|
|
|
cargo run -p xtask update-generated
|
2025-12-16 13:31:22 -05:00
|
|
|
|
|
|
|
|
# Verify build system properties (reproducible builds)
|
|
|
|
|
#
|
|
|
|
|
# This runs `just package` twice and verifies that the resulting RPMs
|
|
|
|
|
# are bit-for-bit identical, confirming SOURCE_DATE_EPOCH is working.
|
|
|
|
|
check-buildsys:
|
|
|
|
|
cargo run -p xtask check-buildsys
|