Skip to content

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

@codecov
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 3 times, most recently from 2d06979 to dd002b3 Compare March 18, 2025 21:13
@bocekm bocekm force-pushed the allow-amazon-linux-2-conversions branch 2 times, most recently from 9640f20 to ed602f3 Compare May 5, 2025 22:58
bocekm added 5 commits May 7, 2025 19:06
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
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.
And update grub settings so that convert2rhel can call grub2-mkconfig.
Assisted by GitHub Copilot
@bocekm bocekm force-pushed the allow-amazon-linux-2-conversions branch from ed602f3 to 52fb6ca Compare May 7, 2025 17:06
Without that it's not possible to use caplog or other log capturing
mechanisms in unit tests.

QueueHandler in Child Process:
- The child process uses a QueueHandler to send log messages to the logger
  queue.

QueueListener in Parent Process:
- The parent process uses a QueueListener to listen for log messages from the
  child process and handle them using the parent logger's handlers.

Exception Handling:
- Exceptions raised in the child process are sent back to the parent process
  via the result queue.
- This helps with situations where failing functions executed in a child
  process lead to the last traceback point to be something like:
  ```
  File "/usr/lib/python2.7/site-packages/convert2rhel/utils.py", line 246, in wrapper
    raise process.exception
  ```

Assisted by GitHub Copilot.
@bocekm bocekm force-pushed the allow-amazon-linux-2-conversions branch from 3eb844b to fd5b7be Compare May 8, 2025 00:13
This reverts commit fd5b7be. It was
incomplete and led to a traceback:

File "/usr/lib/python2.7/site-packages/convert2rhel/utils/__init__.py", line 256, in wrapper
        listener = logging.handlers.QueueListener(logger_queue, *logging.getLogger().handlers)
    AttributeError: 'module' object has no attribute 'QueueListener'
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