[RFC] manifest: use experimentalflags.String("buildroot") #1250
+57
−0
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.
This commit allows to force a container based buildroot as part of images when setting:
and it will replace the buildroot with the given container.
This will allow to do cross-arch building for riscv. The generated manifest can be build with osbuild (as long as qemu-user is installed) and will generate a minimal-raw for riscv64.
Cross-building is useful because qemu-user is a lot faster (and easier to setup) than full riscv system emulation. A minimal raw build on a really fast AWS machine takes about 100 minutes. A full minimal-raw build on my (moderate) PC takes about 20min - which is fast enough so that we can run this in GH workflows as part of the CI.
Long term I would love to see this generalized and that we would (optionally) support container based buildroots for most/all(?) our distro/arch combos. This could be done without too much maintenance burden on our side via e.g. just pointing to the official
ubi
containers for rhel that we then install extra rpms into(like the mkfs.* tools). This would then allow cross-arch image building for e.g. a raspberry pi from a normal PC. But obviously this is all long term stuff that needs more design/discussion (I'm just mentioning it to make clear that this is not a dead-end but has more potential).
This would enable a relatively clean version of https://github.com/osbuild/image-builder-cli/pull/136/files#diff-dd961e42853d4345e2cf6a29f188f80386ed6b583056d7078a38c0c099c97c26R99, i.e. a (relatively) nice integration test that confirms riscv is building and also "image-builder build --arch=riscv64 ..." support (with the right experimental options set)