Skip to content

Commit fb951bf

Browse files
committed
build-sys: Remove separate integration test image
The previous commit consolidated test content (nushell, cloud-init, etc.) into the base image. This completes that work by removing the separate `build-integration-test-image` target and updating all references. Now `just build` produces the complete test-ready image directly, simplifying the build pipeline and eliminating the intermediate `localhost/bootc-integration` image. Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 7b74293 commit fb951bf

File tree

9 files changed

+32
-42
lines changed

9 files changed

+32
-42
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ jobs:
4242
fi
4343
4444
- name: Build container
45-
run: just build-integration-test-image
45+
# TODO: Also consider building + publishing an image that is just "base + bootc"
46+
# as this implicitly changed to also publish our integration test images.
47+
run: just build
4648

4749
- name: Login to ghcr.io
4850
uses: redhat-actions/podman-login@v1

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ jobs:
8585
--tmpfs /var/lib/containers \
8686
-v /run/dbus:/run/dbus -v /run/systemd:/run/systemd localhost/bootc /src/crates/ostree-ext/ci/priv-integration.sh
8787
# Nondestructive but privileged tests
88-
sudo bootc-integration-tests host-privileged localhost/bootc-integration-install
88+
sudo bootc-integration-tests host-privileged localhost/bootc-install
8989
# Install tests
90-
sudo bootc-integration-tests install-alongside localhost/bootc-integration-install
90+
sudo bootc-integration-tests install-alongside localhost/bootc-install
9191
9292
# system-reinstall-bootc tests
9393
cargo build --release -p system-reinstall-bootc
@@ -97,7 +97,7 @@ jobs:
9797
9898
sudo install -m 0755 target/release/system-reinstall-bootc /usr/bin/system-reinstall-bootc
9999
# These tests may mutate the system live so we can't run in parallel
100-
sudo bootc-integration-tests system-reinstall localhost/bootc-integration --test-threads=1
100+
sudo bootc-integration-tests system-reinstall localhost/bootc --test-threads=1
101101
102102
# And the fsverity case
103103
sudo podman run --privileged --pid=host localhost/bootc-fsverity bootc install to-existing-root --stateroot=other \
@@ -189,9 +189,9 @@ jobs:
189189

190190
- name: Build container
191191
run: |
192-
just build-integration-test-image-from-package target/packages
192+
just build
193193
# Extra cross-check (duplicating the integration test) that we're using the right base
194-
used_vid=$(podman run --rm localhost/bootc-integration bash -c '. /usr/lib/os-release && echo ${ID}-${VERSION_ID}')
194+
used_vid=$(podman run --rm localhost/bootc bash -c '. /usr/lib/os-release && echo ${ID}-${VERSION_ID}')
195195
test ${{ matrix.test_os }} = "${used_vid}"
196196
197197
- name: Unit and container integration tests

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ There's a small set of tests which are designed to run inside a bootc container
129129
and are built into the default container image:
130130

131131
```
132-
$ podman run --rm -ti localhost/bootc bootc-integration-tests container
132+
$ just test-container
133133
```
134134

135135
## Submitting a patch

Justfile

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717

1818
# This image is just the base image plus our updated bootc binary
1919
base_img := "localhost/bootc"
20-
# Derives from the above and adds nushell, cloudinit etc.
21-
integration_img := base_img + "-integration"
2220
# Has a synthetic upgrade
23-
integration_upgrade_img := integration_img + "-upgrade"
21+
upgrade_img := base_img + "-upgrade"
2422

2523
# ostree: The default
2624
# composefs-sealeduki-sdboot: A system with a sealed composefs using systemd-boot
@@ -57,9 +55,13 @@ sealed_buildargs := "--build-arg=variant=" + variant + " --secret=id=secureboot_
5755
#
5856
# This first builds RPMs via the `package` target, then injects them
5957
# into the container image.
60-
build: package _keygen
58+
build: package _keygen && _pull-lbi-images
6159
@just _build-from-package target/packages
6260

61+
# Pull images used by hack/lbi
62+
_pull-lbi-images:
63+
podman pull -q --retry 5 --retry-delay 5s {{lbi_images}}
64+
6365
# Compute SOURCE_DATE_EPOCH and VERSION from git for reproducible builds.
6466
# Outputs shell variable assignments that can be eval'd.
6567
_git-build-vars:
@@ -115,28 +117,13 @@ package: _packagecontainer
115117
chmod a+r target/packages/*.rpm
116118
podman rmi localhost/bootc-pkg
117119

118-
# Pull images used by hack/lbi
119-
_pull-lbi-images:
120-
podman pull -q --retry 5 --retry-delay 5s {{lbi_images}}
121-
122-
# This container image has additional testing content and utilities
123-
build-integration-test-image: build _pull-lbi-images
124-
cd hack && podman build {{base_buildargs}} -t {{integration_img}}-bin -f Containerfile .
125-
./hack/build-sealed {{variant}} {{integration_img}}-bin {{integration_img}} {{sealed_buildargs}}
126-
127-
# Build integration test image using pre-existing packages from PATH
128-
build-integration-test-image-from-package PATH: _keygen _pull-lbi-images
129-
@just _build-from-package {{PATH}}
130-
cd hack && podman build {{base_buildargs}} -t {{integration_img}}-bin -f Containerfile .
131-
./hack/build-sealed {{variant}} {{integration_img}}-bin {{integration_img}} {{sealed_buildargs}}
132-
133120
# Build+test using the `composefs-sealeduki-sdboot` variant.
134121
test-composefs:
135122
just variant=composefs-sealeduki-sdboot test-tmt readonly local-upgrade-reboot
136123

137124
# Only used by ci.yml right now
138-
build-install-test-image: build-integration-test-image
139-
cd hack && podman build {{base_buildargs}} -t {{integration_img}}-install -f Containerfile.drop-lbis
125+
build-install-test-image: build
126+
cd hack && podman build {{base_buildargs}} -t {{base_img}}-install -f Containerfile.drop-lbis
140127

141128
# These tests accept the container image as input, and may spawn it.
142129
run-container-external-tests:
@@ -158,28 +145,29 @@ validate:
158145
#
159146
# To run an individual test, pass it as an argument like:
160147
# `just test-tmt readonly`
161-
test-tmt *ARGS: build-integration-test-image _build-upgrade-image
148+
test-tmt *ARGS: build
149+
@just _build-upgrade-image
162150
@just test-tmt-nobuild {{ARGS}}
163151

164152
# Generate a local synthetic upgrade
165153
_build-upgrade-image:
166-
cat tmt/tests/Dockerfile.upgrade | podman build -t {{integration_upgrade_img}}-bin --from={{integration_img}}-bin -
167-
./hack/build-sealed {{variant}} {{integration_upgrade_img}}-bin {{integration_upgrade_img}} {{sealed_buildargs}}
154+
cat tmt/tests/Dockerfile.upgrade | podman build -t {{upgrade_img}}-bin --from={{base_img}}-bin -
155+
./hack/build-sealed {{variant}} {{upgrade_img}}-bin {{upgrade_img}} {{sealed_buildargs}}
168156

169-
# Assume the localhost/bootc-integration image is up to date, and just run tests.
157+
# Assume the localhost/bootc image is up to date, and just run tests.
170158
# Useful for iterating on tests quickly.
171159
test-tmt-nobuild *ARGS:
172-
cargo xtask run-tmt --env=BOOTC_variant={{variant}} --upgrade-image={{integration_upgrade_img}} {{integration_img}} {{ARGS}}
160+
cargo xtask run-tmt --env=BOOTC_variant={{variant}} --upgrade-image={{upgrade_img}} {{base_img}} {{ARGS}}
173161

174162
# Cleanup all test VMs created by tmt tests
175163
tmt-vm-cleanup:
176164
bcvk libvirt rm --stop --force --label bootc.test=1
177165

178166
# Run tests (unit and integration) that are containerized
179-
test-container: build-units build-integration-test-image
167+
test-container: build build-units
180168
podman run --rm --read-only localhost/bootc-units /usr/bin/bootc-units
181169
# Pass these through for cross-checking
182-
podman run --rm --env=BOOTC_variant={{variant}} --env=BOOTC_base={{base}} {{integration_img}} bootc-integration-tests container
170+
podman run --rm --env=BOOTC_variant={{variant}} --env=BOOTC_base={{base}} {{base_img}} bootc-integration-tests container
183171

184172
# Remove all container images built (locally) via this Justfile, by matching a label
185173
clean-local-images:

crates/xtask/src/xtask.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ enum Commands {
5858
/// Arguments for run-tmt command
5959
#[derive(Debug, Args)]
6060
pub(crate) struct RunTmtArgs {
61-
/// Image name (e.g., "localhost/bootc-integration")
61+
/// Image name (e.g., "localhost/bootc")
6262
pub(crate) image: String,
6363

6464
/// Test plan filters (e.g., "readonly")
@@ -73,7 +73,7 @@ pub(crate) struct RunTmtArgs {
7373
#[clap(long)]
7474
pub(crate) env: Vec<String>,
7575

76-
/// Upgrade image to use when bind-storage-ro is available (e.g., localhost/bootc-integration-upgrade)
76+
/// Upgrade image to use when bind-storage-ro is available (e.g., localhost/bootc-upgrade)
7777
#[clap(long)]
7878
pub(crate) upgrade_image: Option<String>,
7979

@@ -85,7 +85,7 @@ pub(crate) struct RunTmtArgs {
8585
/// Arguments for tmt-provision command
8686
#[derive(Debug, Args)]
8787
pub(crate) struct TmtProvisionArgs {
88-
/// Image name (e.g., "localhost/bootc-integration")
88+
/// Image name (e.g., "localhost/bootc")
8989
pub(crate) image: String,
9090

9191
/// VM name (defaults to "bootc-tmt-manual-<timestamp>")

hack/Containerfile.drop-lbis

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM localhost/bootc-integration
1+
FROM localhost/bootc
22
# Workaround for https://github.com/bootc-dev/bootc/issues/1618
33
RUN rm -rf /usr/lib/bootc/bound-images.d/*

hack/provision-packit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ cp /etc/yum.repos.d/test-artifacts.repo "$BOOTC_TEMPDIR"
8686
ls -al "$BOOTC_TEMPDIR"
8787

8888
# Do not use just because it's only available on Fedora, not on CS and RHEL
89-
podman build --jobs=4 --from "$BASE" -v "$BOOTC_TEMPDIR":/bootc-test:z -t localhost/bootc-integration -f "${BOOTC_TEMPDIR}/Containerfile.packit" "$BOOTC_TEMPDIR"
89+
podman build --jobs=4 --from "$BASE" -v "$BOOTC_TEMPDIR":/bootc-test:z -t localhost/bootc -f "${BOOTC_TEMPDIR}/Containerfile.packit" "$BOOTC_TEMPDIR"
9090

9191
# Keep these in sync with what's used in hack/lbi
9292
podman pull -q --retry 5 --retry-delay 5s quay.io/curl/curl:latest quay.io/curl/curl-base:latest registry.access.redhat.com/ubi9/podman:latest

hack/system-reinstall-bootc.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Set a timeout
44
set timeout 600
55

6-
spawn system-reinstall-bootc localhost/bootc-integration
6+
spawn system-reinstall-bootc localhost/bootc
77

88
expect {
99
"Then you can login as * using those keys. \\\[Y/n\\\]" {

tmt/tests/Dockerfile.upgrade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Just creates a file as a new layer for a synthetic upgrade test
2-
FROM localhost/bootc-integration
2+
FROM localhost/bootc
33
RUN touch --reference=/usr/bin/bash /usr/share/testing-bootc-upgrade-apply

0 commit comments

Comments
 (0)