Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
------
Expand Down
77 changes: 55 additions & 22 deletions cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ phases:
fi
fi

- name: PinKernelVersion
- name: PinVersion
action: ExecuteBash
inputs:
commands:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
76 changes: 0 additions & 76 deletions cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading