Skip to content

Commit c1f5a7c

Browse files
authored
Merge branch 'develop' into develop-jun17
2 parents cb94619 + f848e1e commit c1f5a7c

File tree

3 files changed

+63
-74
lines changed

3 files changed

+63
-74
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CHANGELOG
99

1010
**BUG FIXES**
1111
- Fix an issue where Security Group validation failed when a rule contained both IPv4 ranges (IpRanges) and security group references (UserIdGroupPairs).
12+
- Fix build image failures on Rocky 9 non-lastest versions.
1213

1314
3.13.1
1415
------

cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ phases:
182182
fi
183183
fi
184184
185-
- name: PinKernelVersion
185+
- name: PinVersion
186186
action: ExecuteBash
187187
inputs:
188188
commands:
@@ -191,7 +191,45 @@ phases:
191191
OS='{{ build.OperatingSystemName.outputs.stdout }}'
192192
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
193193
KERNEL_VERSION=$(uname -a)
194+
RELEASE_VERSION='{{ build.OperatingSystemVersion.outputs.stdout }}'
194195
if [[ ${!PLATFORM} == RHEL ]]; then
196+
if [[ ${!OS} == rhel9 ]] || [[ ${!OS} == rocky9 ]]; then
197+
if [[ ! -f /etc/yum/vars/releasever ]]; then
198+
echo "yes" > /opt/parallelcluster/pin_releasesever
199+
echo ${!RELEASE_VERSION} > /etc/yum/vars/releasever
200+
yum clean all
201+
fi
202+
fi
203+
PACKAGE_LIST="kernel-headers-$(uname -r) kernel-devel-$(uname -r)"
204+
if [[ ${!OS} != "rocky8" ]] && [[ ${!OS} != "rhel8" ]]; then
205+
PACKAGE_LIST+=" kernel-devel-matched-$(uname -r)"
206+
fi
207+
208+
if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then
209+
if [[ ${!OS} == "rocky8" ]] ; then
210+
REPOSITORY="BaseOS"
211+
else
212+
REPOSITORY="AppStream"
213+
fi
214+
for PACKAGE in ${!PACKAGE_LIST}
215+
do
216+
# try to install kernel source for a specific release version
217+
yum install -y ${!PACKAGE}
218+
if [ $? -ne 0 ]; then
219+
yum install -y wget
220+
# Previous releases are moved into a vault area once a new minor release version is available for at least a week.
221+
# https://wiki.rockylinux.org/rocky/repo/#notes-on-devel
222+
wget https://dl.rockylinux.org/vault/rocky/${!RELEASE_VERSION}/${!REPOSITORY}/$(uname -m)/os/Packages/k/${!PACKAGE}.rpm
223+
yum install -y ./${!PACKAGE}.rpm
224+
fi
225+
done
226+
else
227+
for PACKAGE in ${!PACKAGE_LIST}
228+
do
229+
yum -y install ${!PACKAGE}
230+
done
231+
fi
232+
195233
yum install -y yum-plugin-versionlock
196234
# listing all the packages because wildcard does not work as expected
197235
yum versionlock kernel kernel-core kernel-modules
@@ -202,9 +240,24 @@ phases:
202240
yum versionlock redhat-release
203241
fi
204242
else
243+
apt-get -y install linux-headers-$(uname -r)
205244
apt-mark hold linux-aws* linux-base* linux-headers* linux-image*
206245
fi
207-
echo "Kernel version is ${!KERNEL_VERSION}"
246+
echo "Kernel version is ${!KERNEL_VERSION}"
247+
248+
- name: DisableNouveau
249+
action: ExecuteBash
250+
inputs:
251+
commands:
252+
- |
253+
set -v
254+
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
255+
/bin/sed -r -i -e 's/GRUB_CMDLINE_LINUX="(.*)"/GRUB_CMDLINE_LINUX="\1 rd.driver.blacklist=nouveau nouveau.modeset=0"/' /etc/default/grub
256+
if [[ ${!PLATFORM} == RHEL ]]; then
257+
grub2-mkconfig -o /boot/grub2/grub.cfg
258+
elif [[ ${!PLATFORM} == DEBIAN ]]; then
259+
update-grub
260+
fi
208261
209262
# Install prerequisite OS packages
210263
- name: InstallPrerequisite
@@ -215,16 +268,8 @@ phases:
215268
set -v
216269
OS='{{ build.OperatingSystemName.outputs.stdout }}'
217270
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
218-
VERSION='{{ build.OperatingSystemVersion.outputs.stdout }}'
219271
220272
if [[ ${!PLATFORM} == RHEL ]]; then
221-
if [[ ${!OS} == rhel9 ]] || [[ ${!OS} == rocky9 ]]; then
222-
if [[ ! -f /etc/yum/vars/releasever ]]; then
223-
echo "yes" > /opt/parallelcluster/pin_releasesever
224-
echo ${!VERSION} > /etc/yum/vars/releasever
225-
yum clean all
226-
fi
227-
fi
228273
yum -y groupinstall development && sudo yum -y install wget jq
229274
if [[ ${!OS} != alinux2023 ]]; then
230275
# Do not install curl on al2023 since curl-minimal-8.5.0-1.amzn2023* is already shipped and conflicts.
@@ -243,6 +288,13 @@ phases:
243288
apt-get -y install build-essential curl wget jq
244289
fi
245290
291+
- name: RebootStep
292+
action: Reboot
293+
onFailure: Abort
294+
maxAttempts: 2
295+
inputs:
296+
delaySeconds: 10
297+
246298
# Install Cinc
247299
- name: InstallCinc
248300
action: ExecuteBash

cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,6 @@ phases:
9797
fi
9898
fi
9999
100-
- name: DisableNouveau
101-
action: ExecuteBash
102-
inputs:
103-
commands:
104-
- |
105-
set -v
106-
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
107-
/bin/sed -r -i -e 's/GRUB_CMDLINE_LINUX="(.*)"/GRUB_CMDLINE_LINUX="\1 rd.driver.blacklist=nouveau nouveau.modeset=0"/' /etc/default/grub
108-
if [[ ${!PLATFORM} == RHEL ]]; then
109-
grub2-mkconfig -o /boot/grub2/grub.cfg
110-
elif [[ ${!PLATFORM} == DEBIAN ]]; then
111-
update-grub
112-
fi
113-
114100
- name: DisableUnattendedUpgrades
115101
action: ExecuteBash
116102
inputs:
@@ -129,20 +115,6 @@ phases:
129115
# update package index
130116
DEBIAN_FRONTEND=noninteractive apt-get -y update
131117
fi
132-
133-
- name: InstallEfiBootManager
134-
action: ExecuteBash
135-
inputs:
136-
commands:
137-
- |
138-
set -v
139-
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
140-
ARCH=$(uname -m)
141-
if [[ `echo ${!ARCH}` == 'aarch64' ]] && [[ ${!PLATFORM} == DEBIAN ]]; then
142-
# temporary workaround to solve https://bugs.launchpad.net/ubuntu/+source/grub2-signed/+bug/1936857
143-
apt-get -y install efibootmgr
144-
fi
145-
146118
- name: InstallPrerequisites
147119
action: ExecuteBash
148120
inputs:
@@ -244,42 +216,6 @@ phases:
244216
maxAttempts: 2
245217
inputs:
246218
delaySeconds: 10
247-
- name: InstallAdditionalKernelPackages
248-
action: ExecuteBash
249-
inputs:
250-
commands:
251-
- |
252-
set -v
253-
OS='{{ build.OperatingSystemName.outputs.stdout }}'
254-
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
255-
DISABLE_KERNEL_UPDATE='{{ build.DisableKernelUpdate.outputs.stdout }}'
256-
257-
if [[ ${!PLATFORM} == RHEL ]]; then
258-
# Install kernel-devel during OS update, so that headers are aligned with new kernel.
259-
# The same is done for Debian through `apt-get -y install linux-aws`
260-
if [[ ${!OS} == "rocky8" ]] ; then
261-
PACKAGE="kernel-devel-$(uname -r)"
262-
RELEASE_VERSION=$(source /etc/os-release && echo ${!VERSION_ID})
263-
264-
# try to install kernel source for a specific release version
265-
yum install -y ${!PACKAGE} --releasever ${!RELEASE_VERSION}
266-
if [ $? -ne 0 ]; then
267-
yum install -y wget
268-
# Previous releases are moved into a vault area once a new minor release version is available for at least a week.
269-
# https://wiki.rockylinux.org/rocky/repo/#notes-on-devel
270-
wget https://dl.rockylinux.org/vault/rocky/${!RELEASE_VERSION}/BaseOS/$(uname -m)/os/Packages/k/${!PACKAGE}.rpm
271-
yum install -y ./${!PACKAGE}.rpm
272-
fi
273-
else
274-
yum -y install kernel-headers-$(uname -r)
275-
yum -y install kernel-devel-$(uname -r)
276-
fi
277-
278-
elif [[ ${!PLATFORM} == DEBIAN ]]; then
279-
if [[ ${!DISABLE_KERNEL_UPDATE} != true ]]; then
280-
apt-get -y install linux-aws linux-headers-aws linux-image-aws
281-
fi
282-
fi
283219

284220
- name: RemoveKernelPin
285221
action: ExecuteBash

0 commit comments

Comments
 (0)