-
Notifications
You must be signed in to change notification settings - Fork 87
[WIP] many: switch to bootc based anaconda (away from rpm) (HMS-9392) #1059
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
base: main
Are you sure you want to change the base?
Conversation
The links in the beginning are broken/wrong :) |
"quay.io/fedora/fedora-bootc:42", | ||
"quay.io/centos-bootc/centos-bootc:stream9", | ||
]) | ||
def test_container_iso_installs(tmp_path, build_container, container_ref): |
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.
Running this locally:
======================== 3 passed in 1340.54s (0:22:20) ========================
:)
I commented on something related to this before but can someone (an the anaconda developer?) explain why this is not just |
I think that Quoting spec
Maybe |
Sadly the support for a single custom `efi_src_dir` [0] to look for EFI binaries is not enough for the anaconda-bootc work: The default shim on a bootc system is diverted from `/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`. We also need to install "grub2-iso-x64-cdboot" for a booting iso from the base bootc container. This will be put under the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location. So the `org.osbuild.grub2.iso` stage will need to be able to lookup the required binaries in both places. Hence this commit tweaks the option to allow an array of paths for the `efi_src_dirs` so that this can be supported. The images library will then set this to: ``go bootTreePipeline.EfiSrcDirs = []string{ "/boot/efi/EFI/", "/usr/lib/bootupd/updates/EFI/", } ``` Note that this could have also been solved with something like `efi_fallback_dir` or even hardcoding the fallback here but an array feels more extensible (even though I don't foresee even more locations). But YAGNI, I'm open for ideas and we could also just hardcode the fallback here and drop the `efi_src_dir` option entirely. This is needed for osbuild/bootc-image-builder#1059 [0] osbuild#2202
Sadly the support for a single custom `efi_src_dir` [0] to look for EFI binaries is not enough for the anaconda-bootc work: The default shim on a bootc system is diverted from `/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`. We also need to install "grub2-iso-x64-cdboot" for a booting iso from the base bootc container. This will be put under the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location. So the `org.osbuild.grub2.iso` stage will need to be able to lookup the required binaries in both places. Hence this commit tweaks the option to allow an array of paths for the `efi_src_dirs` so that this can be supported. The images library will then set this to: ```go bootTreePipeline.EfiSrcDirs = []string{ "/boot/efi/EFI/", "/usr/lib/bootupd/updates/EFI/", } ``` Note that this could have also been solved with something like `efi_fallback_dir` or even hardcoding the fallback here but an array feels more extensible (even though I don't foresee even more locations). But YAGNI, I'm open for ideas and we could also just hardcode the fallback here and drop the `efi_src_dir` option entirely. This is needed for osbuild/bootc-image-builder#1059 [0] osbuild#2202
Sadly the support for a single custom `efi_src_dir` [0] to look for EFI binaries is not enough for the anaconda-bootc work: The default shim on a bootc system is diverted from `/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`. We also need to install "grub2-iso-x64-cdboot" for a booting iso from the base bootc container. This will be put under the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location. So the `org.osbuild.grub2.iso` stage will need to be able to lookup the required binaries in both places. Hence this commit tweaks the option to allow an array of paths for the `efi_src_dirs` so that this can be supported. The images library will then set this to: ```go bootTreePipeline.EfiSrcDirs = []string{ "/boot/efi/EFI/", "/usr/lib/bootupd/updates/EFI/", } ``` Note that this could have also been solved with something like `efi_fallback_dir` or even hardcoding the fallback here but an array feels more extensible (even though I don't foresee even more locations). But YAGNI, I'm open for ideas and we could also just hardcode the fallback here and drop the `efi_src_dir` option entirely. This is needed for osbuild/bootc-image-builder#1059 [0] osbuild#2202
Sadly the support for a single custom `efi_src_dir` [0] to look for EFI binaries is not enough for the anaconda-bootc work: The default shim on a bootc system is diverted from `/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`. We also need to install "grub2-iso-x64-cdboot" for a booting iso from the base bootc container. This will be put under the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location. So the `org.osbuild.grub2.iso` stage will need to be able to lookup the required binaries in both places. Hence this commit tweaks the option to allow an array of paths for the `efi_src_dirs` so that this can be supported. The images library will then set this to: ```go bootTreePipeline.EfiSrcDirs = []string{ "/boot/efi/EFI/", "/usr/lib/bootupd/updates/EFI/", } ``` This is needed for osbuild/bootc-image-builder#1059 [0] osbuild#2202
Sadly the support for a single custom `efi_src_dir` [0] to look for EFI binaries is not enough for the anaconda-bootc work: The default shim on a bootc system is diverted from `/boot/efi/EFI/` to `/usr/lib/bootupd/updates/EFI/`. We also need to install "grub2-iso-x64-cdboot" for a booting iso from the base bootc container. This will be put under the regular `/boot/efi/EFI/<vendor>/gcdx64.efi` location. So the `org.osbuild.grub2.iso` stage will need to be able to lookup the required binaries in both places. Hence this commit tweaks the option to allow an array of paths for the `efi_src_dirs` so that this can be supported. The images library will then set this to: ```go bootTreePipeline.EfiSrcDirs = []string{ "/boot/efi/EFI/", "/usr/lib/bootupd/updates/EFI/", } ``` This is needed for osbuild/bootc-image-builder#1059 [0] osbuild#2202
30d566c
to
b03ab2f
Compare
I think this spike is at a point where it would be good to brainstorm/discuss in what direction we should do with regards of the Containerfile. I created https://github.com/orgs/osbuild/discussions/45 so that we can talk about we we want to expose it to our users (assuming we want to do that :) - I would especially appreciated the feedback from @cgwalters here of course. |
d23d40e
to
f55cc28
Compare
…mvo5/images@bib-anaconda-2
As suggested by Pawel (thanks!) - but there are still quite a few we need to manually install and no graphical install yet.
The images library now has a lot of the helper we used to have in bib as its also required for the new booc-installer image type. So this commit drops our (duplicated) copy and (re)uses the helpers from images.
[build on top of https://github.com//pull/1058, much improved version of https://github.com//pull/1053 with support for "legacy" rpm based image types]
This spike show how we could use bootc based containers with anaconda. So instead of building our iso from rpm packages and just putting the bootc container into the rpm generated ISO this spike builds the ISO from a bootc container.
This requires that the container has the right content of course (i.e. anaconda). We would move some of the responsibility to the user (or to a tool that helps the user and hides the complexity here like bootc-iso-imagectl or something) to ensure that.
The
Containerfile
to generate an installer looks something like:this basic template works for cs9,cs10,f42 (Note that the goal here is to essentially remove all quirks
and hide them in images/, ideally the containerfile would be just a "FROM \ndnf install anaconda...").
This branch also has a "--installer-payload" switch so to use this one would essentially write:
bib --type iso --installer-payload quay.io/centos-bootc/centos-bootc:stream9 quay.io/centos-bootc-anaconda:stream9
(as currently the containerfile changes things like /root which makes it no longer a proper bootc container). We could of course explore making this more user friendly, either by a convention like "suffix -installer" for type iso or by creating a derrived constainer locally ourselfs with the above containerfile or helper or by fixing the issues that require /root to be a real dir (but even with that it would probably be undesired to install a container that contains a full anaconda env so something like installer-payload is probably still be needed).Note that this is big departure from our current approach and we would need to think about a transition strategy/communication if we go down this route.
Thanks to Ondrej, Colin for their help/inputs in this, I hope it captures what they suggested to explore.
/jira-epic HMS-8839
JIRA: HMS-9392