Allow AlmaLinux 10 x86-64-v2 targets in checkmicroarchitecture #34
@ -4505,19 +4505,37 @@ index 79158dc6..38ddfa33 100644
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(api, 'consume', lambda x: iter([MemoryInfo(mem_total=129)]))
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmicroarchitecture/actor.py b/repos/system_upgrade/common/actors/checkmicroarchitecture/actor.py
|
||||
index bb342f2f..6c11a244 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmicroarchitecture/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmicroarchitecture/actor.py
|
||||
@@ -20,6 +20,10 @@ class CheckMicroarchitecture(Actor):
|
||||
CPU compatible with ``x86-64-v2`` instruction set or higher. Similarly,
|
||||
RHEL10 requires at least ``x86-64-v3`` instruction set.
|
||||
|
||||
+ AlmaLinux 10 is additionally built for the ``x86-64-v2`` microarchitecture
|
||||
+ level, so when the upgrade target distro is AlmaLinux the requirement for
|
||||
+ the target major version 10 is kept at ``x86-64-v2``.
|
||||
+
|
||||
.. table:: Required CPU features by microarchitecure level with a
|
||||
corresponding flag as shown by ``lscpu``.
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmicroarchitecture/libraries/checkmicroarchitecture.py b/repos/system_upgrade/common/actors/checkmicroarchitecture/libraries/checkmicroarchitecture.py
|
||||
index a063b534..3011f906 100644
|
||||
index a063b534..cce457a0 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmicroarchitecture/libraries/checkmicroarchitecture.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmicroarchitecture/libraries/checkmicroarchitecture.py
|
||||
@@ -3,6 +3,7 @@ from collections import namedtuple
|
||||
@@ -1,8 +1,10 @@
|
||||
from collections import namedtuple
|
||||
|
||||
from leapp import reporting
|
||||
+from leapp.libraries.common.config import get_target_distro_id
|
||||
from leapp.libraries.common.config.architecture import ARCH_X86_64, matches_architecture
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import CPUInfo
|
||||
|
||||
@@ -13,11 +14,11 @@ X86_64_V3_FLAGS = ['avx2', 'bmi1', 'bmi2', 'f16c', 'fma', 'abm', 'movbe', 'xsave
|
||||
@@ -13,11 +15,11 @@ X86_64_V3_FLAGS = ['avx2', 'bmi1', 'bmi2', 'f16c', 'fma', 'abm', 'movbe', 'xsave
|
||||
MicroarchInfo = namedtuple('MicroarchInfo', ('required_flags', 'extra_report_fields', 'microarch_ver'))
|
||||
|
||||
|
||||
@ -4532,7 +4550,7 @@ index a063b534..3011f906 100644
|
||||
|
||||
report_fields = [
|
||||
reporting.Title(title),
|
||||
@@ -28,7 +29,8 @@ def _inhibit_upgrade(missing_flags, target_rhel, microarch_ver, extra_report_fie
|
||||
@@ -28,7 +30,8 @@ def _inhibit_upgrade(missing_flags, target_rhel, microarch_ver, extra_report_fie
|
||||
reporting.Remediation(hint=('If a case of using virtualization, virtualization platforms often allow '
|
||||
'configuring a minimum denominator CPU model for compatibility when migrating '
|
||||
'between different CPU models. Ensure that minimum requirements are not below '
|
||||
@ -4542,9 +4560,44 @@ index a063b534..3011f906 100644
|
||||
]
|
||||
|
||||
if extra_report_fields:
|
||||
@@ -69,14 +71,15 @@ def process():
|
||||
@@ -58,25 +61,40 @@ def process():
|
||||
url='https://red.ht/rhel-10-intel-microarchitectures'
|
||||
)
|
||||
|
||||
microarch_info = rhel_major_to_microarch_reqs.get(get_target_major_version())
|
||||
- rhel_major_to_microarch_reqs = {
|
||||
- '9': MicroarchInfo(microarch_ver='x86-64-v2',
|
||||
- required_flags=(X86_64_BASELINE_FLAGS + X86_64_V2_FLAGS),
|
||||
- extra_report_fields=[rhel9_microarch_article]),
|
||||
- '10': MicroarchInfo(microarch_ver='x86-64-v3',
|
||||
- required_flags=(X86_64_BASELINE_FLAGS + X86_64_V2_FLAGS + X86_64_V3_FLAGS),
|
||||
- extra_report_fields=[rhel10_microarch_article]),
|
||||
- }
|
||||
-
|
||||
- microarch_info = rhel_major_to_microarch_reqs.get(get_target_major_version())
|
||||
+ # AlmaLinux 10 is additionally built for the x86-64-v2 microarchitecture
|
||||
+ # level, so the baseline requirement for AlmaLinux targets stays at v2
|
||||
+ # regardless of the major version. For RHEL/CentOS Stream 10 the
|
||||
+ # requirement is x86-64-v3 (RHEL 10 dropped support for v2).
|
||||
+ if get_target_distro_id() == 'almalinux':
|
||||
+ major_to_microarch_reqs = {
|
||||
+ '9': MicroarchInfo(microarch_ver='x86-64-v2',
|
||||
+ required_flags=(X86_64_BASELINE_FLAGS + X86_64_V2_FLAGS),
|
||||
+ extra_report_fields=[rhel9_microarch_article]),
|
||||
+ '10': MicroarchInfo(microarch_ver='x86-64-v2',
|
||||
+ required_flags=(X86_64_BASELINE_FLAGS + X86_64_V2_FLAGS),
|
||||
+ extra_report_fields=[]),
|
||||
+ }
|
||||
+ else:
|
||||
+ major_to_microarch_reqs = {
|
||||
+ '9': MicroarchInfo(microarch_ver='x86-64-v2',
|
||||
+ required_flags=(X86_64_BASELINE_FLAGS + X86_64_V2_FLAGS),
|
||||
+ extra_report_fields=[rhel9_microarch_article]),
|
||||
+ '10': MicroarchInfo(microarch_ver='x86-64-v3',
|
||||
+ required_flags=(X86_64_BASELINE_FLAGS + X86_64_V2_FLAGS + X86_64_V3_FLAGS),
|
||||
+ extra_report_fields=[rhel10_microarch_article]),
|
||||
+ }
|
||||
+
|
||||
+ microarch_info = major_to_microarch_reqs.get(get_target_major_version())
|
||||
if not microarch_info:
|
||||
- api.current_logger().info('No known microarchitecture requirements are known for target RHEL%s.',
|
||||
- get_target_major_version())
|
||||
@ -4561,6 +4614,71 @@ index a063b534..3011f906 100644
|
||||
+ '{target_distro} {version}'.format(**DISTRO_REPORT_NAMES, version=get_target_major_version()),
|
||||
microarch_info.microarch_ver,
|
||||
extra_report_fields=microarch_info.extra_report_fields)
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmicroarchitecture/tests/test_checkmicroarchitecture.py b/repos/system_upgrade/common/actors/checkmicroarchitecture/tests/test_checkmicroarchitecture.py
|
||||
index eeca8be0..949a731f 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmicroarchitecture/tests/test_checkmicroarchitecture.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmicroarchitecture/tests/test_checkmicroarchitecture.py
|
||||
@@ -30,13 +30,17 @@ ENTIRE_V3_FLAG_SET = ENTIRE_V2_FLAG_SET + checkmicroarchitecture.X86_64_V3_FLAGS
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
- ('target_ver', 'cpu_flags'),
|
||||
+ ('target_ver', 'cpu_flags', 'dst_distro'),
|
||||
[
|
||||
- ('9.0', ENTIRE_V2_FLAG_SET),
|
||||
- ('10.0', ENTIRE_V3_FLAG_SET)
|
||||
+ ('9.0', ENTIRE_V2_FLAG_SET, 'rhel'),
|
||||
+ ('10.0', ENTIRE_V3_FLAG_SET, 'rhel'),
|
||||
+ ('9.0', ENTIRE_V2_FLAG_SET, 'almalinux'),
|
||||
+ # AlmaLinux 10 is built for x86-64-v2 as well, so v2 flags are enough
|
||||
+ ('10.0', ENTIRE_V2_FLAG_SET, 'almalinux'),
|
||||
+ ('10.0', ENTIRE_V3_FLAG_SET, 'almalinux'),
|
||||
]
|
||||
)
|
||||
-def test_valid_microarchitecture(monkeypatch, target_ver, cpu_flags):
|
||||
+def test_valid_microarchitecture(monkeypatch, target_ver, cpu_flags, dst_distro):
|
||||
"""
|
||||
Test no report is generated on a valid microarchitecture
|
||||
"""
|
||||
@@ -45,6 +49,7 @@ def test_valid_microarchitecture(monkeypatch, target_ver, cpu_flags):
|
||||
monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(arch=ARCH_X86_64, dst_ver=target_ver,
|
||||
+ dst_distro=dst_distro,
|
||||
msgs=[CPUInfo(flags=cpu_flags)]))
|
||||
|
||||
checkmicroarchitecture.process()
|
||||
@@ -54,13 +59,16 @@ def test_valid_microarchitecture(monkeypatch, target_ver, cpu_flags):
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
- ('target_ver', 'cpu_flags'),
|
||||
+ ('target_ver', 'cpu_flags', 'dst_distro'),
|
||||
(
|
||||
- ('9.0', checkmicroarchitecture.X86_64_BASELINE_FLAGS),
|
||||
- ('10.0', ENTIRE_V2_FLAG_SET),
|
||||
+ ('9.0', checkmicroarchitecture.X86_64_BASELINE_FLAGS, 'rhel'),
|
||||
+ ('10.0', ENTIRE_V2_FLAG_SET, 'rhel'),
|
||||
+ ('9.0', checkmicroarchitecture.X86_64_BASELINE_FLAGS, 'almalinux'),
|
||||
+ # AlmaLinux 10 still requires v2 as the baseline
|
||||
+ ('10.0', checkmicroarchitecture.X86_64_BASELINE_FLAGS, 'almalinux'),
|
||||
)
|
||||
)
|
||||
-def test_invalid_microarchitecture(monkeypatch, target_ver, cpu_flags):
|
||||
+def test_invalid_microarchitecture(monkeypatch, target_ver, cpu_flags, dst_distro):
|
||||
"""
|
||||
Test report is generated on x86-64 architecture with invalid microarchitecture and the upgrade is inhibited
|
||||
"""
|
||||
@@ -68,7 +76,8 @@ def test_invalid_microarchitecture(monkeypatch, target_ver, cpu_flags):
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
monkeypatch.setattr(api, 'current_actor',
|
||||
- CurrentActorMocked(arch=ARCH_X86_64, msgs=[cpu_info], dst_ver=target_ver))
|
||||
+ CurrentActorMocked(arch=ARCH_X86_64, msgs=[cpu_info], dst_ver=target_ver,
|
||||
+ dst_distro=dst_distro))
|
||||
|
||||
checkmicroarchitecture.process()
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkosrelease/actor.py b/repos/system_upgrade/common/actors/checkosrelease/actor.py
|
||||
index 7747eb9b..8c60d968 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkosrelease/actor.py
|
||||
|
||||
@ -53,7 +53,7 @@ py2_byte_compile "%1" "%2"}
|
||||
Epoch: 1
|
||||
Name: leapp-repository
|
||||
Version: 0.24.0
|
||||
Release: 1%{?dist}.elevate.6
|
||||
Release: 1%{?dist}.elevate.7
|
||||
Summary: Repositories for leapp
|
||||
|
||||
License: ASL 2.0
|
||||
@ -350,6 +350,9 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Apr 20 2026 Yuriy Kohut <ykohut@almalinux.org> - 0.24.0-1.elevate.7
|
||||
- Allow AlmaLinux 10 x86-64-v2 targets in checkmicroarchitecture
|
||||
|
||||
* Tue Apr 14 2026 Yuriy Kohut <ykohut@almalinux.org> - 0.24.0-1.elevate.6
|
||||
- Enable upgrades to x86_64_v2: implement the ability to use a pre-built rootfs instead of bootstrapping the target userspace container via 'dnf install --installroot'.
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user