-
Notifications
You must be signed in to change notification settings - Fork 148
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
Use modularity in repoclosure #8231
Use modularity in repoclosure #8231
Conversation
It looks like it still reads the modules.d from |
46645f1
to
01c73ab
Compare
This doesn't work because we use repoclosure on EL7 nodes, which don't understand modularity. |
repoclosure/repoclosure.sh
Outdated
|
||
# repo names must be unique, or yum will get confused between different OSes and URLs | ||
reponame=undertest-$(basename $yumorig .conf)-$(echo $url | cksum | sed 's/ /-/g') | ||
|
||
yumconf=$TEMPDIR/yum.conf | ||
cat $yumorig > $yumconf | ||
cat >> $yumconf << EOF | ||
modulesdir=$MODULESDIR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this in https://github.com/rpm-software-management/libdnf/blob/eff7e688e2f1ad5d10a5ed05948c08141083f316/data/tests/modules/etc/dnf/dnf.conf.in#L6 but looking at https://github.com/rpm-software-management/libdnf/blob/dnf-4-master/libdnf/module/ModulePackageContainer.cpp it is hardcoded to /etc/dnf/modules.d
. I think we have to switch to containers for proper modularity repoclosure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at https://github.com/rpm-software-management/libdnf/blob/eff7e688e2f1ad5d10a5ed05948c08141083f316/libdnf/module/ModulePackageContainer.cpp#L297-L298, you should be able to pass --installroot
to the DNF call and point it at a different "root" that has an /etc/dnf/modules.d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that works. In that case you must also pass --releasever
. However, that info is also quite useful to have anyway.
Another complication is that obal doesn't use this script anyway and has duplicated the logic.
01c73ab
to
dab6edf
Compare
I verified this works: $ ./repoclosure.sh yum.conf 8 --check el8-foreman-nightly --repo el8-baseos
Modular dependency problem:
Problem: conflicting requests
- nothing provides module(postgresql:12) needed by module foreman:el8:999920220718215004:6b5f9578.x86_64
- nothing provides module(ruby:2.7) needed by module foreman:el8:999920220718215004:6b5f9578.x86_64
$ ./repoclosure.sh yum.conf 8 --check el8-foreman-nightly --repo el8-baseos --repo el8-appstream --repo el8-powertools --repo el8-puppet-6 |
stream=el$releasever | ||
profiles= | ||
state=enabled | ||
EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it from this that if the foreman module was the only one in the config, it would not cause its dependencies to get enabled and thus we must hard-code the ruby and postgresql module configs in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct - this is also what dnf module enable foreman:el8
does. If you don't, you get conflicts. I've tried, but sadly we'll have this duplication.
I'm not sure yet how we should deal with Katello, which we don't want to enable unless it should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be possible to run dnf --installroot $TEMPDIR --releasever $releasever module enable foreman
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't possible:
$ dnf --installroot /tmp/repoclosure-RSRkCQ --releasever 8 module enable -y foreman
Error: This command has to be run with superuser privileges (under the root user on most systems).
We always use DNF for repoclosure and that doesn't implement failovermethod. It only causes warnings in the logs.
This is unused and makes the script a lot easier.
DNF generates a correct exit code
Bash should always use tabs. Heredoc indenting doesn't understand spaces.
This removes the module_hotfixes and excludepkgs hack. To use a different modules.d directory, the --installroot parameter must be passed. This in turn requires the releasever to be set. This is actually also useful in determining which module(s) need to be enabled. Passing an installroot also uses a correct cache directory and further isolates dnf from the host system. Additionally a template is passed to mktemp for easier debugging.
dab6edf
to
d61794a
Compare
Closing in favor of #10514 |
This is a test. It's incomplete, but the principle should be testable.