From df27c63f579fab90b34ef15da279012836f1340c Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 14 Dec 2023 14:12:49 +0100 Subject: [PATCH] Fix kernel-devel package name for rhel8 When using `wget`, the package name must contain the architecture too. By redefining the `kernel_source_package_version` we're avoiding to `chomp` the architecture from kernel version. Then, use `node['kernel']['machine']` rather than `uname -m`. ### Tests Verified that `dnf install` is working on both the cases when passing architecture. ### References * https://github.com/chef/ohai/blob/17-stable/lib/ohai/plugins/kernel.rb#L34 Signed-off-by: Enrico Usai --- .../install_packages/install_packages_rocky8.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb index 8953d6649..dc49f40e9 100644 --- a/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb +++ b/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb @@ -28,17 +28,20 @@ # try to install kernel source for a specific release version dnf install -y ${package} --releasever #{node['platform_version']} if [ $? -ne 0 ]; then - set -e # Previous releases are moved into a vault area once a new minor release version is available for at least a week. # https://wiki.rockylinux.org/rocky/repo/#notes-on-devel - wget https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/$(uname -m)/os/Packages/k/${package}.rpm - dnf install -y ./${package}.rpm + set -e + dnf -y install https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/#{node['kernel']['machine']}/os/Packages/k/${package}.rpm fi dnf clean all INSTALL_KERNEL_SOURCE end unless on_docker? end +def kernel_source_package_version + node['kernel']['release'] +end + def default_packages # environment-modules required by EFA, Intel MPI and ARM PL # iptables needed for IMDS setup