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

modularity support #1197

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

modularity support #1197

wants to merge 7 commits into from

Conversation

supakeen
Copy link
Member

@supakeen supakeen commented Feb 6, 2025

Adds modularity support to images. Needs tests.

@supakeen
Copy link
Member Author

supakeen commented Feb 6, 2025

Currently not working as module_hotfixes is false? Nope.

@supakeen supakeen force-pushed the modularity branch 6 times, most recently from 77b98a8 to 2727433 Compare February 7, 2025 09:15
@supakeen
Copy link
Member Author

supakeen commented Feb 7, 2025

Now has a test config; has a (quick) test if stages get injected (thanks to @mvo5) and I'll be adding some stage tests.

@supakeen supakeen marked this pull request as ready for review February 7, 2025 17:02
@supakeen supakeen requested a review from a team as a code owner February 7, 2025 17:02
pkg/dnfjson/dnfjson.go Show resolved Hide resolved
pkg/dnfjson/dnfjson.go Show resolved Hide resolved
pkg/osbuild/dnf_module_config_stage.go Outdated Show resolved Hide resolved
pkg/manifest/os.go Show resolved Hide resolved
Comment on lines +760 to +766
failsafeDir, err := fsnode.NewDirectory("/var/lib/dnf/modulefailsafe", nil, nil, nil, true)

if err != nil {
panic("failed to create module failsafe directory")
}

pipeline.AddStages(osbuild.GenDirectoryNodesStages([]*fsnode.Directory{failsafeDir})...)
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to make this conditional if len(failsafeFiles) > 0 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It could be; but it'd be an error to not have any failsafeFiles when there were modules in the depsolve result.

Comment on lines +3 to +6
"blueprint": {
"packages": [
{
"name": "@nodejs:18"
Copy link
Member

Choose a reason for hiding this comment

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

We will need a way to enable a module in the BP and install a specific package from it in the packages section, right? You could then extend https://github.com/osbuild/images/blob/main/test/scripts/base-host-check.sh to check for the created module files on the OS. I mean, you could do that even in this scenario.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought we were skipping that part of it in favour of doing everything through module names in the packages; if we also want to support the former (probably up to the frontend?) in blueprints then yes it needs to be expanded.

cc @croissanne / @lucasgarfield?

Copy link
Member

Choose a reason for hiding this comment

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

My understanding was that some modules do not have any default profile or any profile at all. If you want to install a specific package from that module and a specific stream, you'd need to enable it explicitly. I thought that was the whole point for adding module-enable-specs to the depsolve request 🤔

What this manifest gen does was possible before the modularity work landed, just the resulting OS image would not have the proper module enabled and the package marked as coming from it. However, this does not change anything from the point of view of what the user can do with modules.

While we can probably hide module enabling when using via CloudAPI, it seems to me that we should somehow test it anyway, even if we end up not exposing it in the BP.

Copy link
Member Author

@supakeen supakeen Feb 10, 2025

Choose a reason for hiding this comment

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

Right, the important part I to me was that the built images know that, and which, modules have content installed which we do through the module configuration and fallback files.


Which bits are enabled here in this PR is entirely up to the workflow the frontend wants to use, in my opinion. If it wants to show available modules and install them directly (the usecase currently satisfied in this PR) or if it'd show available modules and selecting them then allows you to select packages from those modules (the usecase that would need enabled-modules).

I can add the enabled-modules and its testcases but if it's surface area that isn't going to be touched then I'd prefer to not do that (yet).

Copy link
Member

@croissanne croissanne Feb 11, 2025

Choose a reason for hiding this comment

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

So I think in the UI we'll actually avoid installing module packages 'by the (whole) module'. We'll just continue with package search as usual, except for module packages we'll select the latest supported version by default or they can select another version and mark them as supported or not. So that means from composer and images pov we'll be enabling modules by hand and then installing individual packages from them.

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Then I'll be adding/exposing the enabled modules as well.

supakeen and others added 6 commits February 11, 2025 09:16
Signed-off-by: Simon de Vlieger <[email protected]>
Include any module results in the result object for inputs.

Signed-off-by: Simon de Vlieger <[email protected]>
Provide the DNF module configuration stage which allows to write
modularity related configuration files for DNF.

Signed-off-by: Simon de Vlieger <[email protected]>
Generate stages for files and directories based on the data returned by
the dependency solver for the enabled modules.

Signed-off-by: Simon de Vlieger <[email protected]>
Add a modular user-requested package build for the CentOS 9 qcow2 image
to verify that it installs.

Signed-off-by: Simon de Vlieger <[email protected]>
Tests the conditional that if `moduleSpecs` are set the appropriate
module config stage is injected. Can be expanded later.

Co-authored-by: Michael Vogt <[email protected]>
Signed-off-by: Simon de Vlieger <[email protected]>
When modules are installed verify that the modularity related files are
present on a system.

Signed-off-by: Simon de Vlieger <[email protected]>
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.

4 participants