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

Use modularity in repoclosure #8231

Closed

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Jul 15, 2022

This is a test. It's incomplete, but the principle should be testable.

@ekohl
Copy link
Member Author

ekohl commented Jul 15, 2022

It looks like it still reads the modules.d from /etc/dnf, since we only specify yum.conf. I'll dig further.

@ekohl ekohl force-pushed the rpm/develop-use-el8-modularity branch from 46645f1 to 01c73ab Compare July 16, 2022 11:08
@ekohl
Copy link
Member Author

ekohl commented Jul 16, 2022

This doesn't work because we use repoclosure on EL7 nodes, which don't understand modularity.


# 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
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

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

Copy link
Member Author

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.

@ekohl ekohl force-pushed the rpm/develop-use-el8-modularity branch from 01c73ab to dab6edf Compare July 19, 2022 12:01
@ekohl
Copy link
Member Author

ekohl commented Jul 19, 2022

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
Copy link
Member

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?

Copy link
Member Author

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.

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 may be possible to run dnf --installroot $TEMPDIR --releasever $releasever module enable foreman instead.

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 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).

ekohl added 6 commits October 2, 2023 11:41
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.
@ekohl ekohl force-pushed the rpm/develop-use-el8-modularity branch from dab6edf to d61794a Compare October 2, 2023 09:42
@ekohl
Copy link
Member Author

ekohl commented Mar 5, 2024

Closing in favor of #10514

@ekohl ekohl closed this Mar 5, 2024
@ekohl ekohl deleted the rpm/develop-use-el8-modularity branch March 5, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants