-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: dnf module #361
Comments
It functions similarly to The only advantage I see is that we can enable copr repos with simpler command Basically, when we would replace |
I would rather create a new module called |
I'm in for making a new Current structure from Minor recipe format correctionsReposCurrently, in
Replacing packagesCurrently, we use It seems that there is no alternative for replacing packages in
Everything elseEverything else looks relatively native. |
|
|
Moving to |
According to
I also personally didn't notice any difference in this behavior when I tested it a bit.
That's basically what But if there is no alternative, then sure, that can be also used & adjusted to match the replace behavior from recipe, without user noticing any difference.
Interesting, thanks for noting. |
I noticed in this Bazzite's PR: That they are using |
I think we could do this simple change:
|
I think a flaw in this method is support for repo files which are directly provided in So I think that my suggestion of using |
@gmpinder We will probably need to add |
Sounds good, that'll be an easy addition. |
Oh right, I forgot that. If we assume copr repo names don't include the Adding another key would work too I guess, but then we'd have to debate the whole config structure related to that again lol. |
We should hold a bit releasing ublue-os/bluefin#1954 (comment) Draft PR can be made though, to get us more ready. |
I'm still of the opinion that we should have a separate top-level |
I am also with @gmpinder in this one. It's both kind of confusing and having some typing-strict way to check if the repo is a COPR would be much better. Like, I think the best way would be to do something like this # (...)
repos:
- name: "myuser/chongus"
copr: true # or something dunno
- "other-regular-repo.repo"
- anotherone.repo
# (...) |
I thought about adding manipulation flag options to repos, like we have for I think that having distinct For
I think that distinct |
I'd be down with this. Especially if there are flows where you'd want to enable/disable repos. |
I added separate I'll add some manipulation options to |
So for the type: dnf
copr:
enable: # could also be 'add' since `dnf copr enable` is used for both adding and enabling
- some/repo
disable: # use `dnf copr disable $REPO`
- disabled/repo
remove: # use `dnf copr remove $REPO`
- removed/repo That way it matches what is available under the command.
|
As for the type: dnf
repos:
add: # uses `dnf config-manager addrepo`
- https://pkg.earthly.dev/earthly.repo
- https://cli.github.com/packages/rpm/gh-cli.repo
disable: # uses `dnf config-manager setopt "$REPO.enabled=false"`
- earthly-stable
remove: # uses `rm -f "$(dnf repo info --json $REPO | jq -cr '.[0].repo_file_path')"`
- google-cloud-cli
enable: # uses `dnf config-manager setopt "$REPO.enabled=true"`
- fedora-steam
install:
packages:
- earthly
- gh
- google-cloud-cli
- steam For the |
Another question would be, do we want to have removing/disabling of repos be done at the beginning of the script like with adding, or should we do it at the end so that you could:
I personally think it would be cleaner for the kind of flows I've seen to remove/disable after installation of packages so that you could keep all of that logic contained in a single module call. |
It seems repo management is one major pain point to discuss before the implementation of the module can be finished. Here are the features I would definitely like to support:
Here are the features that I am still unsure about:
Here are two solutions I can come up with right now: A: Magictype: dnf
clean-up-repos: true # whether to remove added repos after module call is done
repos: # these repos are added & enabled
- https://example.org/fedora-example.repo # starts with 'http(s)://', treated as URL
- custom/myrepo.repo # ends with '.repo', treated as local file
- username/myrepo # does not match previous, contains one '/', treated as COPR repo B: Straightforward (with nesting)type: dnf
repos:
clean-up: true
copr:
- username/myrepo
file:
- https://example.org/fedora-example.repo # starts with 'http(s)://', treated as URL
- custom/myrepo.repo # does not match previous, treated as local file B.1: All operationstype: dnf
repos:
copr:
- username/myrepo
- name: username/myrepo2
operation: remove B.2: All operationstype: dnf
repos:
copr:
add:
- user/myrepo
disable:
- user/myrepo2 |
Another idea type: dnf
packages:
- repo: fedora
install:
- micro
- repo: terra
install:
- prismlauncher
- repo: myuser/myrepo # COPR (same magic as described above or something ig)
install:
- custompackage1
- custompackage2
replace:
- kernel All repos are cleaned out by default after packages are installed. This feels like an intuitive separation to me, but also an opinionated restriction. |
This feels too complex imho. I'm all for making things easy to the point it feels like "magic", but to make these operations make more sense, we should have the structure map more closely with the commands that are being ran.
This is a lot closer to how I was thinking about it. I wouldn't mind there being a section under
Having something like this, while perfectly valid and a pattern I've seen with other yaml based systems, feels like it could introduce some cognitive complexity for the user. I think we should have a goal of trying to make our schemas relatively simple so that it can be understood by a wider range of users. We shouldn't be targeting just developer minded users.
I think a |
Sure, I didn't like the look of that either that much.
Sure. I still really like the notion of being able to install packages from a specific repo seamlessly. My recipe often has a long list of repos, and a long list of packages, but no way to tell which repo which package comes from. I think it would be nice to be able to tell from the structure of the recipe that these packages are all from rpmfusion, and this kernel is being replaced from this specific copr, and the rest are just from standard fedora repos. I feel like we'd be adding more value by not just wrapping a YAML structure around a CLI interface, and by structuring it in such a way that it's easier to intuitively reason about. But I guess it's up to each user which structure feels more intuitive.
I don't find that clear at all. If I want to add some repos and not clean them up, while cleaning up others, with option A or B I would just use two module calls, or with the Another idea I would integrate that into the config structure. Some of this could be combined together, too, though. type: dnf
repos:
clean-up-after-use: false # these repos i want to keep around (parameter name tbd)
copr: # Array<String> | { enable: Array<String>, disable: Array<String> }
- username/myrepo
file: # Array<String> | { add: Array<String>, remove: Array<String> }
- https://example.org/fedora-example.repo # starts with 'http(s)://', treated as URL
- custom/myrepo.repo # does not match previous, treated as local file
install:
- fedora-package
- copr-package
- myrepo-pacage
remove:
- firefox
# ---
package-sets: # optional, alternative installation method, where repos are specific and cleaned up by default
- repos: fedora # default, may be omitted
install:
- fedora-package
- repos: # "fedora" | "rpmfusion" | "stufflikethat" | { copr: Array<String> }
copr:
- username/mykernelrepo
install:
- kernel
- firmware-blob
- repos: rpmfusion
install:
- nonfree-package A user would choose to use whatever bits make most sense to them. Everything would work together, though, but one could choose not to learn how to use package sets if they so please. This is all brainstorming, all ideas are appreciated. |
How would this even work? If it's disabling the repo that's defined, wouldn't that be bad for the standard Fedora repos? If they don't, the extra information isn't used for anything and is just extra fluff. If the repo is wrong, does the build fail?
Sure, but the information the user provides in the yaml SHOULD be used directly and have a purpose. If a user wants to track for themselves which repo a package is from, they can add a comment in their recipe. That's why I'm advocating for keeping the schema simple and much more closely related to what is used to call |
Regarding how it works? I don't know the specifics, but the general idea I guess is that we'd install packages with If the specified repo is unavailable, or the packages specified don't exist in said repo, of course the build would then fail.
I think I covered covered this already above.
And I'm not saying that's the wrong approach, we should probably support and keep supporting that. My additional proposal isn't really high-stakes, but it could be a useful way to structure package installations for some. |
Ok I've come around on some things after seeing this message from one of our users.
So I think rather than having a separate section like type: dnf
install:
install-weak-dependencies: false
packages:
- name: earthly # package name
repo: earthly-stable # repo to install from using `--repo`
- neovim # Install based on priorities in .repo files While I did say earlier
I think that this schema style would be relatively easy to understand. We would then continue with the usual top-level properties of
I think this is a good schema for handling repos. |
I like this, I approve.
I like this schema also, just wondering how to handle |
Delete the file that was downloaded? Isn't there some way to store that filename?
Sure, but then if you have to install multiple related packages from a specific repo there's duplication again. If you're open to it being type: dnf
install:
install-weak-dependencies: false
packages:
- repo: mycustom-repo # repo to install from using `--repo`
packages:
- kernel
- driver-package
- neovim # Install based on priorities in .repo files And one thing I'm confused about here is if the specified repo is installed with the install step like I proposed or if it also has to be added under Also, if we're already making install:
- group: XFCE Desktop I guess this goes back in a more complicated direction in exchange for all the power... |
I'll check
Makes sense, I approve.
It needs to be added under
I'm all in to have all the power! |
I think it would be nicer if this wasn't the case, but I guess it would make more sense implementation-wise. |
OK, I just got done converting the existing changes to nushell. Now I'll work on setting everything up with the agreed upon schema. |
A
dnf
module will eventually replace therpm-ostree
module. We should start investigating usage ofdnf5
on atomic Fedora systems to determine a reasonable timeline for development of such a module.https://fedoramagazine.org/whats-new-for-fedora-atomic-desktops-in-fedora-41/#first-step-towards-bootable-containers-dnf5-and-bootc
The text was updated successfully, but these errors were encountered: