diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e417bbed5..f0ac7f39aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ CHANGELOG **BUG FIXES** - Fix a bug that update-cluster, update-compute-fleet may fail when compute resources use an expired Capacity Reservation. +- Fix build image failures on Rocky 9 non-lastest versions. 3.13.1 ------ diff --git a/cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml b/cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml index 364a0785e6..326a8c25f9 100644 --- a/cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml +++ b/cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml @@ -184,7 +184,7 @@ phases: fi fi - - name: PinKernelVersion + - name: PinVersion action: ExecuteBash inputs: commands: @@ -193,26 +193,66 @@ phases: OS='{{ build.OperatingSystemName.outputs.stdout }}' PLATFORM='{{ build.PlatformName.outputs.stdout }}' KERNEL_VERSION=$(uname -a) + RELEASE_VERSION='{{ build.OperatingSystemVersion.outputs.stdout }}' if [[ ${!PLATFORM} == RHEL ]]; then - yum install -y yum-plugin-versionlock - # listing all the packages because wildcard does not work as expected - yum versionlock kernel kernel-core kernel-modules + if [[ ${!OS} == rhel9 ]] || [[ ${!OS} == rocky9 ]]; then + if [[ ! -f /etc/yum/vars/releasever ]]; then + echo "yes" > /opt/parallelcluster/pin_releasesever + echo ${!RELEASE_VERSION} > /etc/yum/vars/releasever + yum clean all + fi + fi + PACKAGE_LIST="kernel-headers-$(uname -r) kernel-devel-$(uname -r)" + if [[ ${!OS} != "rocky8" ]] && [[ ${!OS} != "rhel8" ]]; then + PACKAGE_LIST+=" kernel-devel-matched-$(uname -r)" + fi - if [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then - yum versionlock kernel-abi-whitelists + if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then + for PACKAGE in ${!PACKAGE_LIST} + do + yum install -y ${!PACKAGE} + if [ $? -ne 0 ]; then + # Enable vault repository + sed -i 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=http://dl.rockylinux.org/vault/rocky|g' /etc/yum.repos.d/*.repo + sed -i 's|^#baseurl=https://dl.rockylinux.org/$contentdir|baseurl=https://dl.rockylinux.org/vault/rocky|g' /etc/yum.repos.d/*.repo + yum install -y ${!PACKAGE} + fi + done else - yum versionlock kernel-abi-stablelists + for PACKAGE in ${!PACKAGE_LIST} + do + yum -y install ${!PACKAGE} + done fi + yum install -y yum-plugin-versionlock + # listing all the packages because wildcard does not work as expected + yum versionlock kernel kernel-core kernel-modules + if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then yum versionlock rocky-release rocky-repos elif [[ ${!OS} == "rhel8" ]] || [[ ${!OS} == "rhel9" ]] ; then yum versionlock redhat-release fi else + apt-get -y install linux-headers-$(uname -r) apt-mark hold linux-aws* linux-base* linux-headers* linux-image* fi - echo "Kernel version is ${!KERNEL_VERSION}" + echo "Kernel version is ${!KERNEL_VERSION}" + + - name: DisableNouveau + action: ExecuteBash + inputs: + commands: + - | + set -v + PLATFORM='{{ build.PlatformName.outputs.stdout }}' + /bin/sed -r -i -e 's/GRUB_CMDLINE_LINUX="(.*)"/GRUB_CMDLINE_LINUX="\1 rd.driver.blacklist=nouveau nouveau.modeset=0"/' /etc/default/grub + if [[ ${!PLATFORM} == RHEL ]]; then + grub2-mkconfig -o /boot/grub2/grub.cfg + elif [[ ${!PLATFORM} == DEBIAN ]]; then + update-grub + fi # Install prerequisite OS packages - name: InstallPrerequisite @@ -223,16 +263,8 @@ phases: set -v OS='{{ build.OperatingSystemName.outputs.stdout }}' PLATFORM='{{ build.PlatformName.outputs.stdout }}' - VERSION='{{ build.OperatingSystemVersion.outputs.stdout }}' if [[ ${!PLATFORM} == RHEL ]]; then - if [[ ${!OS} == rhel9 ]] || [[ ${!OS} == rocky9 ]]; then - if [[ ! -f /etc/yum/vars/releasever ]]; then - echo "yes" > /opt/parallelcluster/pin_releasesever - echo ${!VERSION} > /etc/yum/vars/releasever - yum clean all - fi - fi yum -y update krb5-libs yum -y groupinstall development && sudo yum -y install wget jq if [[ ${!OS} != alinux2023 ]]; then @@ -252,6 +284,13 @@ phases: apt-get -y install build-essential curl wget jq fi + - name: RebootStep + action: Reboot + onFailure: Abort + maxAttempts: 2 + inputs: + delaySeconds: 10 + # Install Cinc - name: InstallCinc action: ExecuteBash @@ -350,12 +389,6 @@ phases: if [[ ${!PLATFORM} == RHEL ]]; then yum versionlock delete kernel kernel-core kernel-modules - if [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then - yum versionlock delete kernel-abi-whitelists - else - yum versionlock delete kernel-abi-stablelists - fi - if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then yum versionlock delete rocky-release rocky-repos elif [[ ${!OS} == "rhel8" ]] || [[ ${!OS} == "rhel9" ]] ; then diff --git a/cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml b/cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml index 2b7607b1ea..b7a5157215 100644 --- a/cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml +++ b/cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml @@ -99,20 +99,6 @@ phases: fi fi - - name: DisableNouveau - action: ExecuteBash - inputs: - commands: - - | - set -v - PLATFORM='{{ build.PlatformName.outputs.stdout }}' - /bin/sed -r -i -e 's/GRUB_CMDLINE_LINUX="(.*)"/GRUB_CMDLINE_LINUX="\1 rd.driver.blacklist=nouveau nouveau.modeset=0"/' /etc/default/grub - if [[ ${!PLATFORM} == RHEL ]]; then - grub2-mkconfig -o /boot/grub2/grub.cfg - elif [[ ${!PLATFORM} == DEBIAN ]]; then - update-grub - fi - - name: DisableUnattendedUpgrades action: ExecuteBash inputs: @@ -131,20 +117,6 @@ phases: # update package index DEBIAN_FRONTEND=noninteractive apt-get -y update fi - - - name: InstallEfiBootManager - action: ExecuteBash - inputs: - commands: - - | - set -v - PLATFORM='{{ build.PlatformName.outputs.stdout }}' - ARCH=$(uname -m) - if [[ `echo ${!ARCH}` == 'aarch64' ]] && [[ ${!PLATFORM} == DEBIAN ]]; then - # temporary workaround to solve https://bugs.launchpad.net/ubuntu/+source/grub2-signed/+bug/1936857 - apt-get -y install efibootmgr - fi - - name: InstallPrerequisites action: ExecuteBash inputs: @@ -202,12 +174,6 @@ phases: # listing all the packages because wildcard does not work as expected yum versionlock kernel kernel-core kernel-modules - if [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then - yum versionlock kernel-abi-whitelists - else - yum versionlock kernel-abi-stablelists - fi - if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then yum versionlock rocky-release rocky-repos elif [[ ${!OS} == "rhel8" ]] || [[ ${!OS} == "rhel9" ]] ; then @@ -252,42 +218,6 @@ phases: maxAttempts: 2 inputs: delaySeconds: 10 - - name: InstallAdditionalKernelPackages - action: ExecuteBash - inputs: - commands: - - | - set -v - OS='{{ build.OperatingSystemName.outputs.stdout }}' - PLATFORM='{{ build.PlatformName.outputs.stdout }}' - DISABLE_KERNEL_UPDATE='{{ build.DisableKernelUpdate.outputs.stdout }}' - - if [[ ${!PLATFORM} == RHEL ]]; then - # Install kernel-devel during OS update, so that headers are aligned with new kernel. - # The same is done for Debian through `apt-get -y install linux-aws` - if [[ ${!OS} == "rocky8" ]] ; then - PACKAGE="kernel-devel-$(uname -r)" - RELEASE_VERSION=$(source /etc/os-release && echo ${!VERSION_ID}) - - # try to install kernel source for a specific release version - yum install -y ${!PACKAGE} --releasever ${!RELEASE_VERSION} - if [ $? -ne 0 ]; then - yum install -y wget - # 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/${!RELEASE_VERSION}/BaseOS/$(uname -m)/os/Packages/k/${!PACKAGE}.rpm - yum install -y ./${!PACKAGE}.rpm - fi - else - yum -y install kernel-headers-$(uname -r) - yum -y install kernel-devel-$(uname -r) - fi - - elif [[ ${!PLATFORM} == DEBIAN ]]; then - if [[ ${!DISABLE_KERNEL_UPDATE} != true ]]; then - apt-get -y install linux-aws linux-headers-aws linux-image-aws - fi - fi - name: RemoveKernelPin action: ExecuteBash @@ -303,12 +233,6 @@ phases: if [[ ${!DISABLE_KERNEL_UPDATE} == true ]] && [[ ${!PLATFORM} == RHEL ]]; then yum versionlock delete kernel kernel-core kernel-modules - if [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then - yum versionlock delete kernel-abi-whitelists - else - yum versionlock delete kernel-abi-stablelists - fi - if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then yum versionlock delete rocky-release elif [[ ${!OS} == "rhel8" ]] || [[ ${!OS} == "rhel9" ]] ; then