Skip to content

Enable basic bootc-image-builder tests [HMS-10851]#2467

Merged
achilleas-k merged 25 commits into
osbuild:mainfrom
achilleas-k:run-bib-tests
Jul 9, 2026
Merged

Enable basic bootc-image-builder tests [HMS-10851]#2467
achilleas-k merged 25 commits into
osbuild:mainfrom
achilleas-k:run-bib-tests

Conversation

@achilleas-k

@achilleas-k achilleas-k commented Jun 26, 2026

Copy link
Copy Markdown
Member

Move bootc-image-builder related files, enable them, and clean up duplicate fixtures.

This PR creates a new top-level directory called bootc-image-builder which holds anything related to the tool (whenever possible). It now contains the Containerfile, test scripts, and the old bootc-image-builder README.


This PR only enables one test, test_image_is_generated(), for Fedora 44 and CentOS Stream 10 on both x86_64 and aarch64. It's run on GitLab CI on AWS runners for simplicity, since the GitHub actions environment gets a bit too fiddly for image building.

@achilleas-k achilleas-k changed the title Enable bootc-image-builder tests Enable bootc-image-builder tests [HMS-10851] Jun 26, 2026
@achilleas-k achilleas-k force-pushed the run-bib-tests branch 2 times, most recently from 683ef5e to 32f8c23 Compare June 26, 2026 10:28
@achilleas-k

Copy link
Copy Markdown
Member Author

I expect these will still fail. I will separate the bootc-image-builder tests into their own workflow so we can treat them separately.

@achilleas-k achilleas-k force-pushed the run-bib-tests branch 2 times, most recently from d20ed51 to abf0d09 Compare June 26, 2026 13:30
@achilleas-k achilleas-k force-pushed the run-bib-tests branch 5 times, most recently from 61df64e to efa17bd Compare June 26, 2026 19:34
@achilleas-k achilleas-k force-pushed the run-bib-tests branch 6 times, most recently from 80b363a to 7b816fb Compare July 7, 2026 11:51
@achilleas-k achilleas-k requested a review from avitova July 7, 2026 12:13
@achilleas-k achilleas-k marked this pull request as ready for review July 7, 2026 12:14
@achilleas-k achilleas-k requested review from a team and thozza as code owners July 7, 2026 12:14
@achilleas-k achilleas-k requested a review from croissanne July 7, 2026 12:14
@achilleas-k achilleas-k changed the title Enable bootc-image-builder tests [HMS-10851] Enable basic bootc-image-builder tests [HMS-10851] Jul 7, 2026
@achilleas-k

Copy link
Copy Markdown
Member Author

Note that these new tests sort of violate some of the testing principles I try to adhere to:

  • They run every time, even when nothing changes. So the bootc-based disk images will be built on every PR.
  • They depend on external resources (containers on quay.io) without pinning. This means a test might break suddenly on an unrelated PR because the containers changed remotely.

I decided these are acceptable temporarily because they are adapted from a setup in bootc-image-builder that had the same problems. We're starting from the same baseline and intend to work on improving it.

@achilleas-k achilleas-k requested a review from supakeen July 7, 2026 15:04
supakeen
supakeen previously approved these changes Jul 8, 2026

@supakeen supakeen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor stuff only.

Comment thread bootc-image-builder/test/test_build_pxe.py Outdated
Comment thread bootc-image-builder/test/test_build_iso.py
Comment thread test/scripts/test_imgtestlib.py Outdated
Comment thread test/scripts/imgtestlib/__init__.py Outdated
Create a new top-level directory called bootc-image-builder where we
will put all data and configuration files related to the tool when
possible.  Move the Containerfile for bootc-image-builder there and
rename it.
Disable bootc-image-builder boot tests temporarily.
I'd like to set these up to run like the other boot tests on rhos, gcp,
or the new aws runners with kvm [1].  The current setup on GitHub is
having issues and is hard to debug.

[1] osbuild/gitlab-ci-terraform#245
Replace fedora-bootc:42 with fedora-bootc:44.  Another test case still
tests fedora-bootc:43.
Swap out the CentOS Stream 9 container for CentOS Stream 10 in the
multidisk test case.

This commit also deletes the test_testcase_nameing() test.  It wasn't
being run because the filename, testcase.py, doesn't match the test
naming convention and was not being discovered by pytest.
It's not a very useful test anyway.
The anaconda-iso was never fully supported in image-builder.  Disabling
the tests so we can make sure everything else is working until we finish
the transition to building everything in image-builder.
The local registry is used to test signed containers for ISO
installations.  It also takes too long to set up and can fail in certain
cases (parsing the output of 'ip route' to get the address of the
registry container).

Since it's unnecessary in disk images, don't use it there and make it
optional for the build_images() context.

This is a bit dirty, as there's nothing tying the necessity of a
registry to the test case that needs it.  But all of these tests are due
for an overhaul so it's fine for now.
The environment in GitHub actions needs a lot of fiddling to get the
tests working.  Let's run the core image generation test for now in
GitLab CI.  This matches two tests, one for Fedora 44 and one for CentOS
Stream 10, which builds all disk image types and checks that the images
are generated.  For now, this is enough to ensure that
bootc-image-builder works as expected for the main task of building disk
images.  We will expand the matrix later to cover more functionality.

The pytest invocation was copied from the bootc-image-builder tests.
The basetemp ensures that the tests use /var/tmp instead of /tmp, which
would be too small for the artifacts we produce.
The unsetting of XDG_RUNTIME_DIR is a workaround for some podman
failures that aren't explained or fully understood.
I also added the --setup-show option which shows the fixtures that are
set up during a run, since a lot of them can take a while and might
fail.
avitova
avitova previously approved these changes Jul 8, 2026

@avitova avitova left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool. If I understand correctly, this was just moving tests around and enabling them, using them in CI. Ofc I have no comments on the actual parts of test functionality, just found a typo in README. Lots of work, ty! 🍻

Comment on lines +171 to +183
### Detailed description of optional flags

| Argument | Description | Default Value |
|-------------------|-----------------------------------------------------------------------------------------------------------|:-------------:|
| --chown | chown the output directory to match the specified UID:GID | ❌ |
| --output | output the artifact into the given output directory | `.` |
| --progress | Show progress in the given format, supported: verbose,term,debug. If empty it is auto-detected | `auto` |
| **--rootfs** | Root filesystem type. Overrides the default from the source container. Supported values: ext4, xfs, btrfs | ❌ |
| **--type** | [Image type](#-image-types) to build (can be passed multiple times) | `qcow2` |
| --target-arch | [Target arch](#-target-architecture) to build | ❌ |
| --log-level | Change log level (debug, info, error) | `error` |
| -v,--verbose | Switch output/progress to verbose mode (implies --log-level=info) | `false` |
| --use-librepo | Download rpms using librepo (faster and more robust) | `false` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These things will not be very easy to maintain, can we just suggest users read --help?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README could definitely use some love, I agree. I didn't want to go through it as it was just a copy from the one in the bootc-image-builder repository. My thinking was it is still a useful reference for as long as the container is around. I'll make a note to review it at a later time.

Comment thread bootc-image-builder/README.md Outdated
Comment thread bootc-image-builder/README.md Outdated
@achilleas-k

Copy link
Copy Markdown
Member Author

Failing rawhide RPM builds are a known issue. We're working on that and we can merge without them.

@achilleas-k

Copy link
Copy Markdown
Member Author

Interesting failure here https://gitlab.com/redhat/services/products/image-builder/ci/images/-/jobs/15264156445:

⬇️ Downloading container archive from s3://images-ci-cache/images/builds/osbuild-ref-81b34a84e7eb01b8fef147cd5f9f04b5cd06d1a7/runner-fedora-44/fedora-44/aarch64/manifest-id-f8e901258a0d78a6606fcb4641691456229a4f71fa9c061ba625ad2f3092a4be/container/container.tar
fatal error: An error occurred (404) when calling the HeadObject operation: Key "images/builds/osbuild-ref-81b34a84e7eb01b8fef147cd5f9f04b5cd06d1a7/runner-fedora-44/fedora-44/aarch64/manifest-id-f8e901258a0d78a6606fcb4641691456229a4f71fa9c061ba625ad2f3092a4be/container/container.tar" does not exist
❌ Command failed: ['aws', 's3', 'cp', '--no-progress', 's3://images-ci-cache/images/builds/osbuild-ref-81b34a84e7eb01b8fef147cd5f9f04b5cd06d1a7/runner-fedora-44/fedora-44/aarch64/manifest-id-f8e901258a0d78a6606fcb4641691456229a4f71fa9c061ba625ad2f3092a4be/container/container.tar', '/tmp/tmpdx8yss7u/container.tar']

I suspect it's because of #2462 because looking at the directory in S3:

› aws s3 ls s3://images-ci-cache/images/builds/osbuild-ref-81b34a84e7eb01b8fef147cd5f9f04b5cd06d1a7/runner-fedora-44/fedora-44/aarch64/manifest-id-f8e901258a0d78a6606fcb4641691456229a4f71fa9c061ba625ad2f3092a4be/
2026-07-08 19:27:31     323886 fedora_44-aarch64-iot_container-empty.osbuild-manifest.json
2026-07-08 19:27:31 1378119680 fedora_44-aarch64-iot_container-empty.tar
2026-07-08 19:27:31        397 info.json
2026-07-08 19:27:31     323886 manifest.json

So we need to update the container pulling in generate-ostree-build-config to use the new filenames.

@achilleas-k achilleas-k force-pushed the run-bib-tests branch 2 times, most recently from 8812bbb to b22db49 Compare July 9, 2026 14:02
We will need this for the transition period where we have both old and
new image names in the cache.
While we transition to using image-builder to build images, which
produces images with different filenames, let's rely on listing the
contents of the prefix in the S3 bucket and downloading the image based
on the filename extension.
@achilleas-k

Copy link
Copy Markdown
Member Author

Interesting failure here https://gitlab.com/redhat/services/products/image-builder/ci/images/-/jobs/15264156445:

⬇️ Downloading container archive from s3://images-ci-cache/images/builds/osbuild-ref-81b34a84e7eb01b8fef147cd5f9f04b5cd06d1a7/runner-fedora-44/fedora-44/aarch64/manifest-id-f8e901258a0d78a6606fcb4641691456229a4f71fa9c061ba625ad2f3092a4be/container/container.tar
fatal error: An error occurred (404) when calling the HeadObject operation: Key "images/builds/osbuild-ref-81b34a84e7eb01b8fef147cd5f9f04b5cd06d1a7/runner-fedora-44/fedora-44/aarch64/manifest-id-f8e901258a0d78a6606fcb4641691456229a4f71fa9c061ba625ad2f3092a4be/container/container.tar" does not exist
❌ Command failed: ['aws', 's3', 'cp', '--no-progress', 's3://images-ci-cache/images/builds/osbuild-ref-81b34a84e7eb01b8fef147cd5f9f04b5cd06d1a7/runner-fedora-44/fedora-44/aarch64/manifest-id-f8e901258a0d78a6606fcb4641691456229a4f71fa9c061ba625ad2f3092a4be/container/container.tar', '/tmp/tmpdx8yss7u/container.tar']

I suspect it's because of #2462 because looking at the directory in S3:

› aws s3 ls s3://images-ci-cache/images/builds/osbuild-ref-81b34a84e7eb01b8fef147cd5f9f04b5cd06d1a7/runner-fedora-44/fedora-44/aarch64/manifest-id-f8e901258a0d78a6606fcb4641691456229a4f71fa9c061ba625ad2f3092a4be/
2026-07-08 19:27:31     323886 fedora_44-aarch64-iot_container-empty.osbuild-manifest.json
2026-07-08 19:27:31 1378119680 fedora_44-aarch64-iot_container-empty.tar
2026-07-08 19:27:31        397 info.json
2026-07-08 19:27:31     323886 manifest.json

So we need to update the container pulling in generate-ostree-build-config to use the new filenames.

Last two commits address this issue.

@tkoscieln tkoscieln left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the last two commits that adress the failing ostree build config generation 🚀

@achilleas-k achilleas-k added this pull request to the merge queue Jul 9, 2026
Merged via the queue into osbuild:main with commit 9645f0d Jul 9, 2026
45 of 49 checks passed
@achilleas-k achilleas-k deleted the run-bib-tests branch July 9, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants