Skip to content

Switch distro-specific module streams #15

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

Merged
merged 11 commits into from
Dec 16, 2020

Conversation

mark-au
Copy link
Member

@mark-au mark-au commented Dec 14, 2020

Some dnf modules are named after a distribution('rhel' or 'rhel8'). Switch them to to the 'ol' or 'ol8' equivalents. Resolves #8

An example of CentOS8:

$ dnf module list | grep rhel
container-tools      rhel8 [d]   common [d]                               Common tools and dependencies for container runtimes                        
go-toolset           rhel8 [d]   common [d]                               Go                                                                          
jmc                  rhel8 [d]   common [d], core                         Java Mission Control is a profiling and diagnostics tool for the Hotspot JVM
llvm-toolset         rhel8 [d]   common [d]                               LLVM                                                                        
rust-toolset         rhel8 [d]   common [d]                               Rust                                                                        
virt                 rhel [d][e] common [d]                               Virtualization module

Signed-off-by: Mark Cram [email protected]

@mark-au mark-au requested a review from Djelibeybi December 14, 2020 09:23
@mark-au
Copy link
Member Author

mark-au commented Dec 14, 2020

In draft state while I do a final test

@mark-au mark-au added centos-8 CentOS Linux 8 enhancement New feature or request labels Dec 14, 2020
@Djelibeybi Djelibeybi changed the title Switch module streams which named after distributions Switch distro-specific module streams Dec 14, 2020
Djelibeybi
Djelibeybi previously approved these changes Dec 14, 2020
Signed-off-by: Mark Cram <[email protected]>
@mark-au mark-au marked this pull request as ready for review December 14, 2020 23:50
@mark-au mark-au requested a review from Djelibeybi December 15, 2020 00:26
dnf module install -y "${module}":ol
;;
*)
echo "Unsure how to transform module ${module}"
Copy link
Member

Choose a reason for hiding this comment

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

We should either break here or get user confirmation to continue, instead of just logging the exception.

I would then rewrite this as "Cannot switch enabled module \"${module}\" to Oracle Linux. Continue switching (y/N): with "no" as the default option.

Copy link
Member Author

Choose a reason for hiding this comment

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

At this point in the code the core OS has been switched and we're tidying up the edge cases. We can't easily revert the changes already made so I don't think halting would help. I appreciate it's something that should be strongly highlighted to the user to replace a line that may scroll by.

What do you think of a summary at the end indicating that a module $x couldn't be automatically switched and requires manual intervention?

Copy link
Member

Choose a reason for hiding this comment

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

I think we should move this test to before we do anything that changes the system so that users have the option to abort the switch before any damage is done.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I'll leave this modify code at the end but I'll add a check at the start to see if there are rhel* streams enabled that we aren't familiar with.

Copy link
Member

Choose a reason for hiding this comment

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

Thant seems like a perfectly cromulent solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

Implemented change. I temporarily disabled knowledge of the virt:rhel stream and this is the output:

$ sudo bash up.sh 
Checking for required packages...
Checking your distribution...
Checking for yum lock...
Checking for required python packages...
Identifying dnf modules that are enabled
This tool is unable to automatically switch module 'virt' from a CentOS 'rhel' stream to
an Oracle Linux equivalent. Do you want to continue and resolve it manually?
You may want select No to stop and raise an issue on https://github.com/oracle/centos2ol/ or contact <[email protected]> for advice.
1) Yes
2) No
#? 2
Unsure how to switch module 'virt'. Exiting as requested
For assistance, please email <[email protected]>.

Copy link
Member

Choose a reason for hiding this comment

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

What if there are multiple unknown modules? This format seems very single-module specific.

Also, only provide the GitHub URL, not the email address.

Signed-off-by: Mark Cram <[email protected]>
@mark-au mark-au requested a review from Djelibeybi December 15, 2020 08:06
@Djelibeybi Djelibeybi merged commit 0e3f132 into oracle:main Dec 16, 2020
@mark-au mark-au deleted the feature-switch-modules branch December 16, 2020 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
centos-8 CentOS Linux 8 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem: module rust-toolset:ol8:8030020200807201053:9de6951e-0.x86_64 requires module(llvm-toolset:ol8), but none of the providers can be installed
2 participants