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

Proof of concept for Amazon Linux 2 conversions #1455

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bocekm
Copy link
Member

@bocekm bocekm commented Feb 4, 2025

Steps to get the AL2 converted:

yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/oamg/convert2rhel/repo/epel-7/group_oamg-convert2rhel-epel-7.repo
yum install -y convert2rhel*1455*
yum install -y https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/server/7/7Server/x86_64/os/Packages/p/python-dmidecode-3.12.2-4.el7.x86_64.rpm  # The python-dmidecode version in AL2 repos is older than the RHEL 7 sub-man requires
cat >/etc/convert2rhel.ini <<EOF
[inhibitor_overrides]
allow_unavailable_kmods=true
skip_kernel_currency_check=true
[subscription_manager]
EOF
read -sp "RHSM organization: " org && echo "org = $org" >> /etc/convert2rhel.ini
read -sp "RHSM activation key: " key && echo "activation_key = $key" >> /etc/convert2rhel.ini
convert2rhel -y --debug

What might be causing issues during or after the conversion:

  • kernel 4.14.355 or 5.10.234 (vs 3.10.0 on RHEL 7)
    • AL2 is offered with two different kernel major versions
  • glibc 2.26 (vs 2.17 on RHEL 7)

Especially when it comes to kernel drivers.

Demo:
https://github.com/user-attachments/assets/729c200b-bc33-4a9e-a8b2-4deee5841409

Jira Issues:

Checklist

  • PR has been tested manually in a VM (either author or reviewer)
  • Jira issue has been made public if possible
  • [RHELC-] or [HMS-] is part of the PR title
  • Label depicting the kind of PR it is
  • PR title explains the change from the user's point of view
  • Code and tests are documented properly
  • The commits are squashed to as few commits as possible (without losing data)
  • When merged: Jira issue has been updated to Release Pending if relevant

Steps to get the AL2 converted:
yum install -y https://<CDN mirror>/content/dist/rhel/server/7/7Server/x86_64/os/Packages/p/python-dmidecode-3.12.2-2.el7.x86_64.rpm
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://security.access.redhat.com/data/fd431d51.txt
curl -o /etc/yum.repos.d/client-tools-for-rhel-7-server.repo https://cdn-public.redhat.com/content/public/repofiles/client-tools-for-rhel-7-server.repo
yum -y install subscription-manager
subscription-manager register
rm -f /etc/yum.repos.d/amzn2-extras.repo
yum remove python3-* python2-s3transfer -y
echo "allow_unavailable_kmods=true" >> /etc/convert2rhel.ini
echo "skip_kernel_currency_check=true" >> /etc/convert2rhel.ini
convert2rhel -y --debug
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 96.04%. Comparing base (f21f6cf) to head (1cbc5d4).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...el/actions/system_checks/rhel_compatible_kernel.py 0.00% 1 Missing and 1 partial ⚠️
convert2rhel/pkghandler.py 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1455      +/-   ##
==========================================
- Coverage   96.11%   96.04%   -0.08%     
==========================================
  Files          72       72              
  Lines        5176     5180       +4     
  Branches      895      897       +2     
==========================================
  Hits         4975     4975              
- Misses        119      121       +2     
- Partials       82       84       +2     
Flag Coverage Δ
centos-linux-7 91.56% <20.00%> (-0.08%) ⬇️
centos-linux-8 92.41% <20.00%> (-0.08%) ⬇️
centos-linux-9 92.54% <20.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bocekm bocekm added kind/feature New feature or request tests/sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`. labels Mar 18, 2025
@has-bot
Copy link
Member

has-bot commented Mar 18, 2025

/packit test --labels sanity


Comment generated by an automation.

@bocekm bocekm removed the tests/sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`. label Mar 18, 2025
@bocekm bocekm force-pushed the allow-amazon-linux-2-conversions branch 2 times, most recently from a072a48 to 2d06979 Compare March 18, 2025 20:58
The --setopt=varsdir= option was introduced in dnf. For that reason we
can't pass to yum a directory with yum variable files and instead we
need to ensure that all necessary yum vars are defined in /etc/yum/vars.
@bocekm bocekm force-pushed the allow-amazon-linux-2-conversions branch from 2d06979 to dd002b3 Compare March 18, 2025 21:13
bocekm added 2 commits March 19, 2025 19:39
And update grub settings so that convert2rhel can call grub2-mkconfig.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants