[RFC] many: make bootstrap container usage a manifest option #1293
+96
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[draft as a) it lacks tests b) there are multiple ways of doing this and this outlines the one I like best but that may not match with the others of course]
This PR adds the option to use a bootstrap container when generating the manifest. This allows a seamless experience when using e.g. image-builder:
$ image-builder build --arch=riscv64 minimal-raw --distro fedora-42
(or
--arch=aarch64
etc, as long as there is an upstream container with python3 for the given distro)The approach is to make the distro bootstrap container ref part of the manifest struct just like we set "Distro" there. This is not ideal, it would be much nicer if manifest would hold the full
distro.Distro
and this way we could simply run something likedistro.BootstrapContainerRef()
when needed. However because of circular inputs that is not possible.The other option would be to change the signature of image.ImageKind.InstantiateManifest, e.g.
here it would be either a new
rpmmd.RepoAndBootstrapConfig
with a struct that holds []rpmmd.RepoConfig and BootstrapRef - but that feels a bit out of place in rpmmd (because of the container ref that is unreleated to rpm repos). The RepoAndBootstrapConfig cannot be part of manifest,image or distro because of circular imports.Alternatively:
that just adds a boostrapRef arg. That seems ok but requires a lot of (mechanical) changes.
Note that I think eventually the bootstrap container ref will be part of the "distro.yaml" and the currently (slightly ugly) helper
bootstrapContainerFor()
will go away.The matching and small image-builder-cli changes are in https://github.com/osbuild/image-builder-cli/compare/main...mvo5:cross-arch-for-all-2?expand=1 (and the cross-build test in there passes locally but takes ~30min for all 4 tested arches and it lacks a check that inside the generate container image we actually have binaries of the expected architecture)
Note that cross-arch building will not support selinux in the buildroot yet - see the second commit about how we can still archive this in the future.