-
Notifications
You must be signed in to change notification settings - Fork 87
Apply disk or filesystem customization from embedded image customization #932
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
Apply disk or filesystem customization from embedded image customization #932
Conversation
d18fdba
to
a1ab7c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this is great!!
I think this change is important enough to warrant a new test container in CI.
https://github.com/osbuild/bootc-image-builder/blob/main/test/test_manifest.py
Perhaps not a full build, but at least a manifest generation and inspection test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This is a really nice feature, we should probably add it to the README.md as well that this is now possible.
I also wonder if we should error (or warn) if there are most customizations embedded than the filesystem/disk ones. Mostly to avoid surprises when people might think adding extra stuff would work when in fact it does not. Obviously followup material.
I also included tiny suggestions for the go-code but and would love some tests but all of those I can do in a followup, I don't want to slow this (excellent) work down.
I added some tests |
419b468
to
c3b0c68
Compare
Note: The tests fail to set Once we update the blueprint version we should extend these tests to include this, and the new options. |
5d033db
to
0fc92e6
Compare
Yeah, that is probably a good idea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this is very nice!
Some test is failing with:
Doesn't seem related to this PR, but I don't understand how the reference format is invalid in the first place? |
It is not related, I can reproduce this locally with: $ git rev-parse HEAD
66049b592e1e1b8ecbce4d0b06fd6dbb2fead663
$ sudo pytest -s -vv ./test/test_build_disk.py::test_image_boots[container_ref=quay.io/fedora/fedora-bootc:43,disk_config=btrfs,image=raw,rootfs=btrfs,use_librepo=True]
... and get the same error. So I guess we need to investigate the bootc-fedora:43 container, but we can skip the test for now to unblock you, this fedora:43 issue is outside of our controll. |
The other failure seems to be:
|
cb29a3f
to
38fd79e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This lets you load a config from a specific file (only). This will be needed to load embedded customization files.
This loads a blueprint from /usr/lib/bootc-image-builder/ called either config.json or config.toml. It is in a standard blueprint format, but we only extract the "Customization" part of it.
…tomization This allows bootc images to specify more detailed requirements for the partitioning, which is useful to either add extra partitions (like a separate /var), or to override details of the normal partitions (like uuids, labels, etc). This is discussed in bootc-dev/bootc#926
We use a custom copy (ghcr.io/osbuild/bootc-image-builder/registry) of the docker registy image to avoid running into pull rate limits.
38fd79e
to
10fc62a
Compare
I'm now seeing this failure:
Which seem unrelated. I also get from
This also seems unrelated, as we're not doing anything wrt selinux. Also, test_manifest_disk_customization_lvm_swap gets:
Which seems to indicate that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all of this. It's great to finally have this feature!
LGTM
May be related to bootc-dev/bootc#1302 |
This allows bootc images to embed a file in
/usr/lib/bootc-image-builder
in the image calledconfig.json
orconfig.toml
, which specify more detailed requirements for the partitioning. From this (which is in the full blueprint format) we extract (only) the disk and/or filesystem customization part.This is useful to either add extra partitions (like a separate /var), or to override details of the normal partitions (like uuids, labels, etc).
This is discussed in bootc-dev/bootc#926
I used the entire blueprint format so that we can reuse existing docs, and so that we can later use more customization fields if needed.
Note: This (mostly trivially) conflicts with #928