Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: rebuild disks from bootable containers when the BIB container changes #405

Merged
merged 6 commits into from
Feb 10, 2024

Conversation

achilleas-k
Copy link
Member

Write the bootc-image-builder container ID that we used to build a disk image and boot test bootable containers. We use this ID to retest bootable container images when the bib container changes to ensure we maintain compatibility.

ondrejbudai
ondrejbudai previously approved these changes Jan 26, 2024
Copy link
Member

@ondrejbudai ondrejbudai left a comment

Choose a reason for hiding this comment

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

Yay!

@achilleas-k
Copy link
Member Author

Requested review from @mvo5 because tests ^_^

@achilleas-k achilleas-k force-pushed the test/log-bib-image-id branch 6 times, most recently from e13c028 to 5323a15 Compare January 26, 2024 21:46
@achilleas-k
Copy link
Member Author

Okay, the bib test failed. This is good :)

@achilleas-k
Copy link
Member Author

Current status: The image doesn't build with BIB since we switched to using bootupd. The metadata isn't part of our base image. This was expected (and the reason I added the test in the first place). Working on adding this now.

@achilleas-k
Copy link
Member Author

Rebased. Should be good to go!

skopeo_inspect_id() can inspect a container image (local or remote) and
return the image ID for a given architecture.
When inspecting local containers, it uses sudo to access the root
container registry, which is what we use in tests for the bib container.

The host_container_arch() function returns a string that matches the
expected arch name for the host.
The tests check the manifest-list test container we keep in the gitlab
registry for tests in osbuild-composer and in this repository.
Test that:
- Inspecting the manifest list at :latest returns the expected image ID.
- Inspecting the manifest digest for a given architecture returns the
  expected image ID.
- Pulling a container and inspecting the local storage for a given
  architecture returns the expected image ID.

The local storage inspection will run 'skopeo inspect' with sudo, so the
test only runs when sudo can be run non-interactively (sudo -n).
We will use this ID to retest bootable container images when the bib
container changes to ensure we maintain compatibility.
If the container image ID changes, rebuilds and retest bootable
container images.
The test fails in github actions but it's useful to keep until we fix
it.  Mark it as disabled and keep a comment to investigate.
Copy link
Member

@ondrejbudai ondrejbudai left a comment

Choose a reason for hiding this comment

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

Awesome! I think we can resolve my comment in a follow-up, the test is disabled nevertheless.

transport = "containers-storage:"
image = "registry.gitlab.com/redhat/services/products/image-builder/ci/osbuild-composer/manifest-list-test:latest"
with tempfile.TemporaryDirectory() as tmpdir:
testlib.runcmd(["sudo", "podman", "pull", f"--arch={arch}", "--storage-driver=vfs", f"--root={tmpdir}", image])
Copy link
Member

Choose a reason for hiding this comment

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

--storage-driver=vfs is so we can run the test in a container, right? It might be worth leaving a small note about that here, it might not be obvious to future readers.

EDIT from future Ondrej who read all commits: So it apparently doesn't work in a container... weird...

@ondrejbudai ondrejbudai added this pull request to the merge queue Feb 10, 2024
Merged via the queue into osbuild:main with commit 315825e Feb 10, 2024
12 checks passed
@achilleas-k achilleas-k deleted the test/log-bib-image-id branch February 10, 2024 11:17
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.

3 participants