Enable basic bootc-image-builder tests [HMS-10851]#2467
Conversation
683ef5e to
32f8c23
Compare
|
I expect these will still fail. I will separate the bootc-image-builder tests into their own workflow so we can treat them separately. |
d20ed51 to
abf0d09
Compare
61df64e to
efa17bd
Compare
80b363a to
7b816fb
Compare
7b816fb to
6ea0249
Compare
6ea0249 to
a2bef7d
Compare
|
Note that these new tests sort of violate some of the testing principles I try to adhere to:
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. |
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.
be810f2 to
4d58a77
Compare
avitova
left a comment
There was a problem hiding this comment.
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! 🍻
| ### 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` | |
There was a problem hiding this comment.
These things will not be very easy to maintain, can we just suggest users read --help?
There was a problem hiding this comment.
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.
Co-authored-by: Anna Vítová <[email protected]>
8cfdc38 to
cf2ea01
Compare
|
Failing rawhide RPM builds are a known issue. We're working on that and we can merge without them. |
|
Interesting failure here https://gitlab.com/redhat/services/products/image-builder/ci/images/-/jobs/15264156445: I suspect it's because of #2462 because looking at the directory in S3: So we need to update the container pulling in |
8812bbb to
b22db49
Compare
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.
b22db49 to
0be37d3
Compare
Last two commits address this issue. |
tkoscieln
left a comment
There was a problem hiding this comment.
Approving the last two commits that adress the failing ostree build config generation 🚀
Move bootc-image-builder related files, enable them, and clean up duplicate fixtures.
This PR creates a new top-level directory called
bootc-image-builderwhich 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.