#66 Not clear if a default profile must be declared
Closed 2 years ago by ppisar. Opened 4 years ago by ankursinha.

Must all modules define a default profile? It isn't clear from the docs. Is it a SHOULD or a MUST?


Context:

So, here's what I've ended up with (first modularity experience here, so please forgive the mess).

Fedora non-modular has nest-2.18.0, and we want to provide different versions as modules. Currently, the two versions are 2.16.0 and 2.18.0. So, I built modules for these two.

Now: we want users to use 2.18.0 be default---the non-modular one while it's alive.

So, what should I do? What should the default profile be?


I think you are confusing default streams and default profiles.

A module does not have to have a default stream. However, because we want it to be possible to differentiate between "This has no default stream because we don't want it to have one" and "This has no default stream because we forgot to set it", you still need to have a defaults object in the repodata that lists no default stream.

Now, based on the discussion in the BZ you linked, I think @lruzicka was telling you that your streams have no default profiles, which is different from the default stream.

All streams must identify their default profiles in the YAML defaults object. What this means is that if I type dnf module install nest:2.16 (not specifying a profile such as dnf install nest:2.16/profilename), it would pick this one instead.

Normally, you want the default profile(s) to provide the common set of packages that most users would expect from your module. If your module is purely a "library" module (it's not useful on its own but only as a dependency of other modules), you would want to set an empty list of profiles explicitly. This is for the same reason as the default streams: we want to know that there is no default profile on purpose, rather than having been forgotten.

Yes, I was confusing the two: streams and profiles. I have a better handle on the whole thing now :D

I had used the template on this page, but had removed the optional bits (not being sure enough what they meant):

https://docs.fedoraproject.org/en-US/modularity/making-modules/defining-modules/

Currently, it says:

# === Installation profiles (optional, but encouraged) ===============
# (Helping users with installation by providing predefined groups)

and I think I removed the section as a result. I expect that should be updated to say that profiles are compulsory, right? Also here:

https://docs.fedoraproject.org/en-US/modularity/making-modules/defining-modules/#_installation_profiles_optional_but_encouraged

So, it's a bit of a mixed bag; they're "optional but encouraged" by the modularity technology. However in Fedora packaging guidelines we have made them mandatory (as it allows us to have automated tests that detect whether you've remembered to set them). We probably need to update the documentation to reflect this.

According to the Bugzilla: 1732531, you should be fine with:

document: modulemd-defaults
version: 1
data:
    module: nest
    profiles:        
        2.16.0: [default_profile]  
        2.18.0: [default_profile]

The default_profile will be replaced by the real name of your default profile.

Correct me, if I am wrong, @sgallagh .

@lruzicka That looks correct to me.

I've defined profiles in modulemd and declared the default ones in fedora-module-defaults too now. Should I leave this open as a tracker to tweak the docs as needed?

This is now covered with https://docs.fedoraproject.org/en-US/modularity/policies/packaging-guidelines/#_profiles:
Fedora does not allow default streams.
Fedora does not mandate default profiles: A packager may define profiles. If there is a profile, the packager should set a default profile.

Metadata Update from @ppisar:
- Issue status updated to: Closed (was: Open)

2 years ago

Login to comment on this ticket.

Metadata