Skip to content
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

gen_depsolve_dnf4: include version/release/arch for kernel #202

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Sep 16, 2024

This is draft with some ideas about the gen-depsolve-dnf4 handling of the kernel package.

The basic ideas:

  • mock more in the gen-manifests so that our mock dnfjson has non-empty version/release too
  • handle the kernel special in gen-depsolve-dnf4 as it is handled special in images too and provide release/version/arch to otk as an API
  • use this data in the grub2 fragment to have a generic way to reference the kernel

This needs osbuild/images#937 and only the last two commits are relevant, the rest is based on #196

mvo5 and others added 21 commits September 16, 2024 15:26
This commit adds a new `normalize_rpm_refs()` helper that will
normalize the rpm file inputs for comparison, i.e. it will sort
the hashes and remove duplicates. This is important because the
"images" library writes duplicated input rpm packages from the
inputs as duplicated hashes into the references.

But in our test we only need to worry about that exactly the right
rpm files got included, the order is not important.
Remove unused subcommands of the `osbuild_external`.

Signed-off-by: Simon de Vlieger <[email protected]>
Externals no longer receive their name within the tree structure that
they get from `otk`.

Signed-off-by: Simon de Vlieger <[email protected]>
This splits out the depsolve external along the lines of the previously
written partition externals. Using the external is now a two-step
process where you run one external in a define and then use its output
to generate stages and sources.

Signed-off-by: Simon de Vlieger <[email protected]>
Use depsolver for the CentOS 9 QCOW and AMI omnifests

Signed-off-by: Simon de Vlieger <[email protected]>
In `images` we mock depsolves so we can run them very fast under test.
This introduces the same functionality to the depsolve external.

Signed-off-by: Simon de Vlieger <[email protected]>
Use a `const.internal` subkey for the dnf4 depsolving external. This
follows the ideas set forth in the partition tables. `.const` means that
the format can be considered un-changing and `.internal` means that this
shouldn't be used directly but only through other externals in the same
group.

Signed-off-by: Simon de Vlieger <[email protected]>
Renames the depsolve externals to fit into the partition externals
naming scheme.

Signed-off-by: Simon de Vlieger <[email protected]>
Bit of a hacky way to copy the (installed) Python externals into the
search path for the manifest tests. Also sets testing environment to
True.

Signed-off-by: Simon de Vlieger <[email protected]>
Signed-off-by: Simon de Vlieger <[email protected]>
Properly output the RPM stage.

Signed-off-by: Simon de Vlieger <[email protected]>
Drop the second GPG key as they are not in the reference manifests.

Signed-off-by: Simon de Vlieger <[email protected]>
Signed-off-by: Simon de Vlieger <[email protected]>
Provide a map keyed by package name of the depsolve result that can be
used by omnifests to look up package information.

Signed-off-by: Simon de Vlieger <[email protected]>
With the rewrite of the depsolver these are not extremely poc anymore.

Signed-off-by: Simon de Vlieger <[email protected]>
When doing a `gen-depsolve-dnf4` export only the kernel name and
version in the result set instead of every package name with the
version. Mainly to limit the API surface we need to support, for
now we know we need to handle the kernel special but it's unclear
if we need to expose details about the other resolved packages.
The `grub2` fragment require the release/version/arch of the kernel
package. Add them to the external so that they can be used inside
otk files.

Also tweak the mocks to follow
osbuild/images#937
so that we have predictable but non-empty version/release numbers.
This commit updates the `fragment/grub2.yaml` to use the newly
available `packages.os.const.kernel.{release,version,arch}` so
that this works for real data and not just the `0-0.noarch` mocks.

Also update the reference manifests based on
osbuild/images#937
@mvo5 mvo5 force-pushed the rewrite-depsolve-limit-to-kernel branch from 9f01ea0 to 24e9347 Compare September 16, 2024 16:39
@mvo5 mvo5 mentioned this pull request Sep 17, 2024
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.

2 participants