-
Notifications
You must be signed in to change notification settings - Fork 149
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
Custom repos #482
Custom repos #482
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the Leapp Guidelines, pass tests and linter checks before it can be merged. If you want to re-run tests or request review, you can use following commands as a comment:
|
.. network issue?.. retesting |
and py2/py3 pylint false possitive. |
repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py
Outdated
Show resolved
Hide resolved
2bcc869
to
d32a695
Compare
@oamg/developers some parts of the PR are really bad to see even, but we are lack of time now. For that reason I created issue #486, so we will be able to improve some parts later, properly. |
e2e tests |
e2e tests |
repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py
Outdated
Show resolved
Hide resolved
Code wise I am ok with it as is. Michal Reznik is testing it, I will rely on his vote for it. |
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.
Looks good to me, just a couple of text suggestions. Testing it right now...
repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el7toel8/actors/reportsettargetrelease/libraries/library.py
Outdated
Show resolved
Hide resolved
aaef0e3
to
0e9801d
Compare
The development variable LEAPP_DEVEL_SKIP_RHSM is being deprecated and replaced with LEAPP_NO_RHSM, which is going to be officially supported. At the framework level, setting LEAPP_DEVEL_SKIP_RHSM to 1 also sets LEAPP_NO_RHSM to 1. This is intentional not to break existing tests and scripts. Therefore, it makes sense to only check for the latter one in tests. Bump leapp-framework requirement to 1.2 regarding the change in the leapp.
In case the system is subscribed but user wants to use own repositories for the IPU, rhsm on the host could be affected when run any yum/dnf commands inside the container. For that reason, set the container mode for rhsm everytime, despite the skip_rhsm().
The actor scan the custom repo file that user could use to define own repositories that should be used during the IPU as well. The expected path of the file is: /etc/leapp/files/leapp_upgrade_repositories.repo These repositories will be used automatically for the IPU despite the enable/disable settings. It's required the file and defined repositories has to be valid. If the file doesn't exist, nothing happens.
The model is used to share information about custom repo files that should be extra handled during the IPU. Basically we have just one file that we want to use for these purposes now, but I haven't found good library for the constant and I haven't wanted to duplicate the string several times. As well, maybe someone will want to handle own repofile. For that reasons, I rather created the new model. Note: Feel free to drop it and hardcode the path.
…ration Direct reading of LEAPP & LEAPP_DEVEL evars in actors should happen from the IPUConfig using the leapp.libraries.common.config library. Update according to guildelines. As well, I had to do some refactoring because of the change inside checkrhsmku and enablerhsmreposonrhel8 actors, including fix of tests. Co-authored-by: Vinzenz 'evilissimo' Feenstra <evilissimo@gmail.com>
…f rhsm skpped This is part of the scenario, when user wants to use only custom yum/dnf repositories (rhsm is skipped), but the system is subscribed in the same time. YUm by default uses the subscription-manager plugin; DNF uses it when configured. If the plugin is loaded, the redhat.repo file will be regenerated (e.g. it could lead into unexpected duplicated). As well, maybe it could happen that an error will be raised because of troubles to obtain expected data (e.g.). So we disable it).
bumped leapp-framework requirement to 1.2 (regarding the change in the leapp). |
@pirat89 please remove the "WIP" |
f151ddc
to
341b9cb
Compare
Just keep others in picture, there is implemented another way to enable custom repositories during the IPU via the |
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.
Some additional typos found on the way. Will have to test the --enablerepo functionality too...
repos/system_upgrade/el7toel8/actors/checkrhsmsku/libraries/library.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el7toel8/actors/checkrhsmsku/libraries/library.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el7toel8/actors/checkrhsmsku/libraries/library.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py
Outdated
Show resolved
Hide resolved
|
If leapp_upgrade_repositories.repo is empty, we ge this inhibitor:
The text mentions "the referred document" but does not refer any document. How is cust going to know how to add the repos? (Merely |
@AloisMahdal we expect that customer understand the repo file format and we will document it for them. So they are expected e.g. to open editor and write it inside. It's seems that it's broken leapp. The link is really reffered in the code. Have you copied the whole report or just these lines?
|
The content (target repositories) for the target system is supposed to be delivered using RHSM by default. However it is possible to skip it using the --no-rhsm option (or LEAPP_NO_RHSM=1). User should be notified that if problem is encountered around rhsm (e.g. system is not registered), there is possibility to skip RHSM and provide the RHEL 8 content via custom repositories. Modify all related texts and reports.
…target repositories Previously when any custom target repository was not available inside the container (read, was not defined in a repo file), the fact was ignored. Currently, as user is able to proceed the upgrade without RHSM, completely, we should focus more on these values as well, otherwise it could happen we will not be able to create the target userspace (which in such case could end with ugly pretty-long output of errors immadiately after the fail of the bootstrap installation). As well, if rhsm is skipped, check whether there are not duplicate repository definitions inside the container. If so, inhibit the upgrade (as it happens in case when RHSM is used). Regarding the current state, the new issue has been created refactor and modify significantly the actor and related labrares. Issue: oamg#486
The actor produce CustomTargetRepository messages for repoids obtained from the cmdline when user use the --enablerepo option. The values are stored inside LEAPP_ENABLE_REPOS envar now, which is stored inside the configuration of the actor.
Update texts to inform even about the second way how to enable custom target repositories using the --enablerepo option for leapp, and do not produce info report about those new way, when already used this or custom repofile one.
@Rezney typos fixed :) thanks for reading. |
I've only copied the inhibitor section and I'm pretty sure there was no link in that section. I'll double-check today. |
leapp-ci build |
e2e tests |
The PR introduces new way to add custom repositories into the IPU process, with possibility to skip rhsm without need of any devel switch.
The PR covers these possible scenarios:
(but the primary one around RHEL are provided still by RHSM)
To add custom repositories into the IPU process:
--enablerepo
option/etc/leapp/files/leapp_upgrade_repositories.repo
Both solutions can be combined (but it is not so much expected).
In case of the
--enablerepo
option, that one can be specified multiple times and for each obtained repoid is produced theCustomTargetRepository
message. The repo has to be already specified under the/etc/yum.repos.d
otherwise raised errors are later expected.The repofile will be automatically parsed during the scan phase and copied later into the containers. It is possible to use the repofile in combination with RHSM (e.g. get RH repositories via RHSM and add additional ones via the repofile) and without RHSM as well. In the second case, you need the leapp build from the PR 622. Actually, it is possible to test it without the new build as well, but part of the functionality (e.g. --no-rhsm option) and compatibility with the original devel solution is kept only with builds from that PR.
With this PR, the RHSM is set into the container mode inside the containers every time - despite the set of
--no-rhsm
. It's seatbelt to ensure we really will not affect the host by mistake. As well, all calls of yum & dnf includes--disableplugin subscription-manager
when RHSM should be skipped. So we will be pretty sure, that yum/dnf will not fail when used for any reason connected to RHSM. Even the repofile should be kept as it is in such mode. Which is what we want.As well, several other actors and models have been added, to be able to improve checks regarding the official possibility of skip of RHSM. New model:
CustomTargetRepositoryFile
- representing information about the custom repository files. It's expected that most of the time, only the default custom repo file could be defined as that's handled automatically. But in case that users will want to use the mechanism for other repository files, it's possible as well. Just the scanning has to be handled on their own. All such files will be copied into the containers automaticallyRegarding the checks, I tried to effectively minimalized possibility of raised errors, so I created inhibitor(s) that could reduce number of reported "issues". Better solution will be part of future work. See the issue #486 (not only this problem, but big part of it).
All RHSM related texts have been updated to reflect new possibilities.
Part of the PR is fix of the
@with_rhsm
decorator. So the tests are not affected now by the environment variables, as really everything..at least the LEAPP_NO_RHSM... is read from the configuration of the actor. (thanks @vinzenz for big help - Vinnie is practically author of that one).Note: There are still missing many unit-tests. Regarding the situation, I expect to cover everything in following PRs. Now I will spend rather more time with additional testing.
Requries PR #480
Requires Leapp PR oamg/leapp/pull/622