Skip to content

Conversation

@mvo5
Copy link
Contributor

@mvo5 mvo5 commented Nov 12, 2025

This PR moves all the logic for anaconda-iso bootc ISO generation into the images library and extends manifestgen.Depsolve() so that we can pass a custom depsolver (which is needed for the bootc anaconda isos as they use a custom solver that point to the mounted container)

This is working end-to-end in osbuild/bootc-image-builder#1131 - all existing tests pass (might be good to do a manual test with a rhel container on a rhel system, this part is not well tested).

@mvo5 mvo5 force-pushed the bootc-anaconda-iso-2 branch 3 times, most recently from 1e85415 to c02ed88 Compare November 17, 2025 10:35
@mvo5 mvo5 marked this pull request as ready for review November 17, 2025 10:35
@mvo5 mvo5 requested a review from a team as a code owner November 17, 2025 10:35
@mvo5 mvo5 requested review from achilleas-k, bcl and lzap November 17, 2025 10:35
# - its "indirect" in the sense that it pulls the RPMs from a
# "real" distro, i.e. if a bootc centos-10 is found it will
# load the imagetypes.yaml for that to load the
# bootc-rpm-installer
Copy link
Member

Choose a reason for hiding this comment

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

This is a very important comment ❤️.

if err := cnt.InitDNF(); err != nil {
// Not all bootc container have dnf, so check if it can
// be run here and if not just return nil which will
// ensure the depsolver of the host is used
Copy link
Member

Choose a reason for hiding this comment

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

Not all hosts have DNF either, do we need to verify that as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If dnf is missing on the host images should already DTRT, i.e. if its not needed (like for pure bootc types) it will just continue and for rpm based ones it will print an error.

rng := rand.New(rand.NewSource(seed))

switch {
// XXX: make this a yaml property
Copy link
Member

Choose a reason for hiding this comment

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

Follow-up or will you update this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have not fully made up my mind yet, followup might be nice but maybe its enough to update the comment, given that its extremely unlikely that we ever add another legacy rpm based rpm installer we might keep hardcoding it. But making it YAML is slightly nicer (but maybe extra work)

mvo5 added a commit to mvo5/images that referenced this pull request Nov 18, 2025
This commit tries to address the concern from Achilleas in
osbuild#2010 (comment)

When using a custom Depsolve function it is now mandatory
to pass a valid `depsolvednf.Solver` instance. So the
custom depsolve function will no longer create it on its own
as this is no longer feasiable. With the bootc distro that
requires a different depsolvednf.Solver it is no longer
something that a user can override.

The commit also renames the function from Depsolver to
Depsolve as its doing the (dep) solving with an existing
"solver". Getting the terminology more disentangled would
be nice but I couldn't come up with better terms, maybe
`DepsolveRun` ?
achilleas-k
achilleas-k previously approved these changes Nov 18, 2025
mvo5 added 6 commits November 18, 2025 16:01
The bootc based distros need a custom depsolver because
they need to use the dnf from the container to ensure
that all the plugins/custom config is used.

So manifestgen now checks if the distro defines its own
way to create a depsovler and if so passes it into the
manifestgen.Depsolver.

With that bootc ISOs (that require rpms) are compatible with
custom depsolve helpers and we can use a custom depsolver
to catpure the mTLS keys for the rpms that are required
by bootc.
This commit moves the code to generate the rpm anaconda-iso
installer type into the images library. This is possible
because we use the distro specific depsolver. In bib we
need to define a custom depsolver function that wraps the
`manifestgen.DefaultDepsolver()` so that we can captures the
repositories and extract the mTLS keys from there.

The image type is ugly as it violates our layering, i.e.
it will first inspect the bootc container to find the distro
id and then look into our "regular" imagetypes.yaml for the
found distro for the rpms to install. This is convenient as
we maintain our rpms all in the same place but its also
annyoing. Ideally we would get rid of this image type and
use the container based bootc-installer type [0] but we
will probably need this RPM one for a while still.

[0] osbuild#1906
Ideally we would just use `name_aliases` but in the bib/ibcli
code we use the low-level interface of the loader to get the
image which does not look at name_alises. As this is quite
a special case lets just be pragmatic and define "iso" via
a YAML alias/anchor.
Not all bootc container have dnf, so check if it can
be run here and if not just return nil which will
ensure the depsolver of the host is used.
Now that the `anaconda-iso` image type for bootc is part of the
image library we can (re)use the existing manifest testing system
to generate fake manifests that validate that our images do not
change accidentially.

This commit adds: rhel-10.1, centos-9, fedora-43, fedora-42
which should be a good sample.
mvo5 added a commit to mvo5/images that referenced this pull request Nov 18, 2025
This commit tries to address the concern from Achilleas in
osbuild#2010 (comment)

When using a custom Depsolve function it is now mandatory
to pass a valid `depsolvednf.Solver` instance. So the
custom depsolve function will no longer create it on its own
as this is no longer feasiable. With the bootc distro that
requires a different depsolvednf.Solver it is no longer
something that a user can override.

The commit also renames the function from Depsolver to
Depsolve as its doing the (dep) solving with an existing
"solver". Getting the terminology more disentangled would
be nice but I couldn't come up with better terms, maybe
`DepsolveRun` ?
@mvo5 mvo5 force-pushed the bootc-anaconda-iso-2 branch from 9a7af45 to c1ce9a0 Compare November 18, 2025 15:03
@mvo5
Copy link
Contributor Author

mvo5 commented Nov 18, 2025

Had to force push because of conflicts, sorry.

achilleas-k
achilleas-k previously approved these changes Nov 18, 2025
@achilleas-k
Copy link
Member

Linties

This commit tries to address the concern from Achilleas in
osbuild#2010 (comment)

When using a custom Depsolve function it is now mandatory
to pass a valid `depsolvednf.Solver` instance. So the
custom depsolve function will no longer create it on its own
as this is no longer feasiable. With the bootc distro that
requires a different depsolvednf.Solver it is no longer
something that a user can override.

The commit also renames the function from Depsolver to
Depsolve as its doing the (dep) solving with an existing
"solver". Getting the terminology more disentangled would
be nice but I couldn't come up with better terms, maybe
`DepsolveRun` ?
@supakeen supakeen enabled auto-merge November 18, 2025 16:12
@supakeen supakeen added this pull request to the merge queue Nov 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 18, 2025
@supakeen supakeen added this pull request to the merge queue Nov 19, 2025
Merged via the queue into osbuild:main with commit 92cb4e7 Nov 19, 2025
23 checks passed
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