Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock kernel minor version during image build #6624

Merged
merged 2 commits into from
Dec 13, 2024
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
22 changes: 22 additions & 0 deletions cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ phases:

echo ${!OS}

- name: OperatingSystemVersion
action: ExecuteBash
inputs:
commands:
- |
set -v
FILE=/etc/os-release
if [ -e ${!FILE} ]; then
. ${!FILE}
echo "${!VERSION_ID}"
else
echo "The file '${!FILE}' does not exist. Failing build."
exit {{ FailExitCode }}
fi

# Get platform name
- name: PlatformName
action: ExecuteBash
Expand Down Expand Up @@ -176,9 +191,16 @@ 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 ]]; then
echo ${!VERSION} > /etc/yum/vars/releasever
yum clean all
fi
yum -y update krb5-libs
yum -y groupinstall development && sudo yum -y install curl wget jq


if [[ ${!OS} =~ ^centos ]]; then
/bin/sed -r -i -e 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
Expand Down
20 changes: 20 additions & 0 deletions cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ phases:
fi

echo ${!OS}
- name: OperatingSystemVersion
action: ExecuteBash
inputs:
commands:
- |
set -v
FILE=/etc/os-release
if [ -e ${!FILE} ]; then
. ${!FILE}
echo "${!VERSION_ID}"
else
echo "The file '${!FILE}' does not exist. Failing build."
exit {{ FailExitCode }}
fi


# Get platform name
- name: PlatformName
Expand Down Expand Up @@ -151,6 +166,11 @@ phases:
set -v
OS='{{ build.OperatingSystemName.outputs.stdout }}'
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
VERSION='{{ build.OperatingSystemVersion.outputs.stdout }}'
if [[ ${!OS} == rhel9 ]]; then
echo ${!VERSION} > /etc/yum/vars/releasever
yum clean all
fi

if [[ ${!PLATFORM} == RHEL ]]; then
yum -y install jq
Expand Down
Loading