Skip to content

Commit

Permalink
CentOS 7 is no longer supported
Browse files Browse the repository at this point in the history
Signed-off-by: Hanwen <[email protected]>
  • Loading branch information
hanwen-pcluste committed Jun 20, 2024
1 parent 8383fc2 commit 9c44fa0
Show file tree
Hide file tree
Showing 67 changed files with 169 additions and 446 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ CHANGELOG
`cfn_bootstrap_virtualenv` is not added in PATH environment variable.

**CHANGES**
- CentOS 7 is no longer supported.
- Upgrade Cinc Client to version to 18.4.12 from 18.2.7.
- Allow build-image to be run in an isolated network.

Expand Down
6 changes: 1 addition & 5 deletions cli/src/pcluster/cli/commands/configure/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,7 @@ def configure(args): # noqa: C901
default_instance_type = AWSApi.instance().ec2.get_default_instance_type()
head_node_instance_type = prompt(
"Head node instance type",
lambda x: x in AWSApi.instance().ec2.list_instance_types()
and ( # pcluster doesn't support CentOS7 with ARM
base_os != "centos7"
or AWSApi.instance().ec2.get_instance_type_info(x).supported_architecture()[0] == "x86_64"
),
lambda x: x in AWSApi.instance().ec2.list_instance_types(),
default_value=default_instance_type,
)
if scheduler == "awsbatch":
Expand Down
2 changes: 1 addition & 1 deletion cli/src/pcluster/cli/commands/dcv_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ def get_supported_dcv_os(architecture):
"""Return a list of all the operating system supported by DCV."""
architectures_dict = {
"x86_64": [os for os in SUPPORTED_OSES if os not in UNSUPPORTED_OSES_FOR_DCV],
"arm64": ["alinux2", "centos7", "rhel8", "rocky8", "rhel9", "rocky9"],
"arm64": ["alinux2", "rhel8", "rocky8", "rhel9", "rocky9"],
}
return architectures_dict.get(architecture, [])
2 changes: 0 additions & 2 deletions cli/src/pcluster/config/cluster_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1574,8 +1574,6 @@ def _register_validators(self, context: ValidatorContext = None): # noqa: D102
ArchitectureOsValidator,
os=self.image.os,
architecture=self.head_node.architecture,
custom_ami=self.image.custom_ami,
ami_search_filters=self.dev_settings.ami_search_filters if self.dev_settings else None,
)
if self.head_node_ami:
self._register_validator(
Expand Down
4 changes: 1 addition & 3 deletions cli/src/pcluster/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

SUPPORTED_SCHEDULERS = ["slurm", "awsbatch"]
SCHEDULERS_SUPPORTING_IMDS_SECURED = ["slurm"]
SUPPORTED_OSES = ["alinux2", "alinux2023", "centos7", "ubuntu2004", "ubuntu2204", "rhel8", "rocky8", "rhel9", "rocky9"]
SUPPORTED_OSES = ["alinux2", "alinux2023", "ubuntu2004", "ubuntu2204", "rhel8", "rocky8", "rhel9", "rocky9"]
SUPPORTED_OSES_FOR_SCHEDULER = {"slurm": SUPPORTED_OSES, "awsbatch": ["alinux2", "alinux2023"]}
UNSUPPORTED_OSES_FOR_MICRO_NANO = ["ubuntu2004", "ubuntu2204", "rhel8", "rocky8", "rhel9", "rocky9"]
DELETE_POLICY = "Delete"
Expand All @@ -37,7 +37,6 @@
AWSBATCH = "awsbatch"

OS_MAPPING = {
"centos7": {"user": "centos"},
"alinux2": {"user": "ec2-user"},
"alinux2023": {"user": "ec2-user"},
"ubuntu2004": {"user": "ubuntu"},
Expand All @@ -51,7 +50,6 @@
OS_TO_IMAGE_NAME_PART_MAP = {
"alinux2": "amzn2-hvm",
"alinux2023": "amzn2023-hvm",
"centos7": "centos7-hvm",
"ubuntu2004": "ubuntu-2004-lts-hvm",
"ubuntu2204": "ubuntu-2204-lts-hvm",
"rhel8": "rhel8-hvm",
Expand Down
11 changes: 3 additions & 8 deletions cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ phases:
[ -n "${CfnParamCincInstaller}" ] && CINC_URL="${CfnParamCincInstaller}"
echo "${!CINC_URL}"
# Check input base AMI OS and get OS information, the output should be like centos.7 | amzn.2 | ubuntu.20.04 | ubuntu.22.04 | rhel.8.7 | rocky.8.8
# Check input base AMI OS and get OS information, the output should be like amzn.2 | ubuntu.20.04 | ubuntu.22.04 | rhel.8.7 | rocky.8.8
- name: OperatingSystemRelease
action: ExecuteBash
inputs:
Expand Down Expand Up @@ -86,8 +86,6 @@ phases:
OS='alinux2'
elif [ `echo "${!RELEASE}" | grep -w '^amzn\.2023'` ]; then
OS='alinux2023'
elif [ `echo "${!RELEASE}" | grep '^centos\.7'` ]; then
OS='centos7'
elif [ `echo "${!RELEASE}" | grep '^ubuntu\.20'` ]; then
OS='ubuntu2004'
elif [ `echo "${!RELEASE}" | grep '^ubuntu\.22'` ]; then
Expand Down Expand Up @@ -159,10 +157,10 @@ phases:
exit {{ FailExitCode }}
fi
# This component only supports aarch64 CPUs on Amazon Linux 2, Ubuntu2004, Ubuntu2204, Centos7, RHEL8, Rocky8, RHEL9 and Rocky9
# This component only supports aarch64 CPUs on Amazon Linux 2, Ubuntu2004, Ubuntu2204, RHEL8, Rocky8, RHEL9 and Rocky9
ARCH=$(uname -m)
if [[ `echo ${!ARCH}` == 'aarch64' ]]; then
if [ `echo "${!RELEASE}" | grep -Ev '^(amzn\.2|amzn\.2023|centos\.7|ubuntu\.20\.04|ubuntu\.22\.04|rhel\.8|rocky\.8|rhel\.9|rocky\.9)'` ]; then
if [ `echo "${!RELEASE}" | grep -Ev '^(amzn\.2|amzn\.2023|ubuntu\.20\.04|ubuntu\.22\.04|rhel\.8|rocky\.8|rhel\.9|rocky\.9)'` ]; then
echo "This component does not support '${!RELEASE}' on ARM64 CPUs. Failing build."
exit {{ FailExitCode }}
fi
Expand All @@ -180,9 +178,6 @@ phases:
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
if [[ ${!PLATFORM} == RHEL ]]; then
if [[ ${!OS} == centos7 ]]; then
yum -y install epel-release
fi
yum -y groupinstall development && sudo yum -y install curl wget jq
if [[ ${!OS} =~ ^centos ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ phases:
OS='alinux2'
elif [ $(echo "${RELEASE}" | grep -w '^amzn\.2023') ]; then
OS='alinux2023'
elif [ $(echo "${RELEASE}" | grep '^centos\.7') ]; then
OS='centos7'
elif [ $(echo "${RELEASE}" | grep '^ubuntu\.20') ]; then
OS='ubuntu2004'
elif [ $(echo "${RELEASE}" | grep '^ubuntu\.22') ]; then
Expand Down Expand Up @@ -78,7 +76,7 @@ phases:
which aws
if [[ $? -ne 0 ]]; then
echo "Installing unzip"
if [[ "{{ test.OperatingSystemName.outputs.stdout }}" =~ ^(centos7|alinux|rhel|rocky) ]]; then
if [[ "{{ test.OperatingSystemName.outputs.stdout }}" =~ ^(alinux|rhel|rocky) ]]; then
yum -y install unzip
elif [[ "{{ test.OperatingSystemName.outputs.stdout }}" =~ ^ubuntu ]]; then
apt-get -y install unzip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ phases:
OS='alinux2'
elif [ `echo "${RELEASE}" | grep -w '^amzn\.2023'` ]; then
OS='alinux2023'
elif [ `echo "${RELEASE}" | grep '^centos\.7'` ]; then
OS='centos7'
elif [ `echo "${RELEASE}" | grep '^ubuntu\.20'` ]; then
OS='ubuntu2004'
elif [ `echo "${RELEASE}" | grep '^ubuntu\.22'` ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ phases:
OS='alinux2'
elif [ `echo "${RELEASE}" | grep -w '^amzn\.2023'` ]; then
OS='alinux2023'
elif [ `echo "${RELEASE}" | grep '^centos\.7'` ]; then
OS='centos7'
elif [ `echo "${RELEASE}" | grep '^ubuntu\.20'` ]; then
OS='ubuntu2004'
elif [ `echo "${RELEASE}" | grep '^ubuntu\.22'` ]; then
Expand Down Expand Up @@ -328,12 +326,6 @@ phases:
set -vx
OS='{{ validate.OperatingSystemName.outputs.stdout }}'
if [ {{ validate.LustreSupported.outputs.stdout }} == true ]; then
echo "Checking for Lustre client..."
if [ ${OS} == centos7 ]; then
rpm -qa | grep lustre-client
fi
fi
[[ $? -ne 0 ]] && echo "Check for Lustre client failed" && exit 1
echo "FSx Lustre test passed"
Expand Down
15 changes: 5 additions & 10 deletions cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ constants:
phases:
- name: build
steps:
# Check input base AMI OS and get OS information, the output should be like centos.7 | amzn.2 | ubuntu.20.04 | ubuntu.22.04 | rhel.8.7 | rocky.8.8
# Check input base AMI OS and get OS information, the output should be like amzn.2 | ubuntu.20.04 | ubuntu.22.04 | rhel.8.7 | rocky.8.8
- name: OperatingSystemRelease
action: ExecuteBash
inputs:
Expand Down Expand Up @@ -39,8 +39,6 @@ phases:
OS='alinux2'
elif [ `echo "${!RELEASE}" | grep -w '^amzn\.2023'` ]; then
OS='alinux2023'
elif [ `echo "${!RELEASE}" | grep '^centos\.7'` ]; then
OS='centos7'
elif [ `echo "${!RELEASE}" | grep '^ubuntu\.20'` ]; then
OS='ubuntu2004'
elif [ `echo "${!RELEASE}" | grep '^ubuntu\.22'` ]; then
Expand Down Expand Up @@ -90,10 +88,10 @@ phases:
exit {{ FailExitCode }}
fi
# This component only supports aarch64 CPUs on Amazon Linux 2, Ubuntu2004, Ubuntu2204, Centos7, RHEL8, Rocky8, RHEL9 and Rocky9
# This component only supports aarch64 CPUs on Amazon Linux 2, Ubuntu2004, Ubuntu2204, RHEL8, Rocky8, RHEL9 and Rocky9
ARCH=$(uname -m)
if [[ `echo ${!ARCH}` == 'aarch64' ]]; then
if [ `echo "${!RELEASE}" | grep -Ev '^(amzn\.2|centos\.7|ubuntu\.20\.04|ubuntu\.22\.04|rhel\.8|rocky\.8|rhel\.9|rocky\.9)'` ]; then
if [ `echo "${!RELEASE}" | grep -Ev '^(amzn\.2|ubuntu\.20\.04|ubuntu\.22\.04|rhel\.8|rocky\.8|rhel\.9|rocky\.9)'` ]; then
echo "This component does not support '${!RELEASE}' on ARM64 CPUs. Failing build."
exit {{ FailExitCode }}
fi
Expand Down Expand Up @@ -155,9 +153,6 @@ phases:
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
if [[ ${!PLATFORM} == RHEL ]]; then
if [[ ${!OS} == centos7 ]]; then
yum -y install epel-release
fi
yum -y install jq
elif [[ ${!PLATFORM} == DEBIAN ]]; then
apt-get -y install jq
Expand Down Expand Up @@ -205,7 +200,7 @@ phases:
# listing all the packages because wildcard does not work as expected
yum versionlock kernel kernel-core kernel-modules
if [[ ${!OS} == "centos7" ]] || [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then
if [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then
yum versionlock kernel-abi-whitelists
else
yum versionlock kernel-abi-stablelists
Expand Down Expand Up @@ -300,7 +295,7 @@ phases:
if [[ ${!DISABLE_KERNEL_UPDATE} == true ]] && [[ ${!PLATFORM} == RHEL ]]; then
yum versionlock delete kernel kernel-core kernel-modules
if [[ ${!OS} == "centos7" ]] || [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then
if [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then
yum versionlock delete kernel-abi-whitelists
else
yum versionlock delete kernel-abi-stablelists
Expand Down
4 changes: 1 addition & 3 deletions cli/src/pcluster/templates/cw_dashboard_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,7 @@ def _add_cw_log(self):
self._new_cw_log_widget(
title="system-messages",
conditions=[
Condition(
["alinux2", "alinux2023", "centos7", "rhel8", "rocky8", "rhel9", "rocky9"], base_os
)
Condition(["alinux2", "alinux2023", "rhel8", "rocky8", "rhel9", "rocky9"], base_os)
],
filters=[self._new_filter(pattern=f"{head_private_ip}.*system-messages")],
),
Expand Down
11 changes: 2 additions & 9 deletions cli/src/pcluster/validators/cluster_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
SHARED_STORAGE_NAME_MAX_LENGTH = 30
NAME_REGEX = r"^[a-z][a-z0-9\-]*$"

EFA_UNSUPPORTED_ARCHITECTURES_OSES = {"x86_64": [], "arm64": ["centos7"]}
EFA_UNSUPPORTED_ARCHITECTURES_OSES = {"x86_64": [], "arm64": []}

EFS_MESSAGES = {
"errors": {
Expand Down Expand Up @@ -278,21 +278,14 @@ class ArchitectureOsValidator(Validator):
ARM AMIs are only available for a subset of the supported OSes.
"""

def _validate(self, os: str, architecture: str, custom_ami: str, ami_search_filters):
def _validate(self, os: str, architecture: str):
allowed_oses = get_supported_os_for_architecture(architecture)
if os not in allowed_oses:
self._add_failure(
f"The architecture {architecture} is only supported "
f"for the following operating systems: {allowed_oses}.",
FailureLevel.ERROR,
)
if custom_ami is None and os == "centos7" and architecture == "arm64" and not ami_search_filters:
self._add_failure(
"The aarch64 CentOS 7 OS is not validated for the 6th generation aarch64 instances "
"(M6g, C6g, etc.). To proceed please provide a custom AMI, "
"for more info see: https://wiki.centos.org/Cloud/AWS#aarch64_notes",
FailureLevel.ERROR,
)


class InstanceArchitectureCompatibilityValidator(Validator):
Expand Down
1 change: 0 additions & 1 deletion cli/tests/pcluster/aws/test_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def test_get_supported_architectures(mocker, instance_type, supported_architectu
"os_part, expected_os",
[
("amzn2-hvm", "alinux2"),
("centos7-hvm", "centos7"),
("ubuntu-2004-lts-hvm", "ubuntu2004"),
("ubuntu-2204-lts-hvm", "ubuntu2204"),
("nonexistant-hvm", "linux"),
Expand Down
14 changes: 7 additions & 7 deletions cli/tests/pcluster/cli/configure/test_pcluster_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def test_subnet_automation_no_awsbatch_no_errors_empty_vpc(mocker, capsys, test_
mock_handler.add_subnet_automation(public_subnet_id="subnet-12345678", private_subnet_id="subnet-23456789")

input_composer = ComposeInput(aws_region_name="eu-west-1", key="key1", scheduler="slurm")
input_composer.add_first_flow(op_sys="centos7", head_node_instance="t2.nano")
input_composer.add_first_flow(op_sys="alinux2", head_node_instance="t2.nano")
input_composer.add_compute_instance("t2.micro", "14")
input_composer.add_sub_automation(
vpc_id="vpc-23456789", network_configuration=PUBLIC_PRIVATE_CONFIGURATION, vpc_has_subnets=False
Expand All @@ -554,7 +554,7 @@ def test_subnet_automation_no_awsbatch_no_errors(mocker, capsys, test_datadir, t
mock_handler.add_subnet_automation(public_subnet_id="subnet-12345678", private_subnet_id="subnet-23456789")

input_composer = ComposeInput(aws_region_name="eu-west-1", key="key1", scheduler="slurm")
input_composer.add_first_flow(op_sys="centos7", head_node_instance="t2.nano")
input_composer.add_first_flow(op_sys="alinux2", head_node_instance="t2.nano")
input_composer.add_compute_instance("t2.micro", "14")
input_composer.add_sub_automation(
vpc_id="vpc-12345678", network_configuration=PUBLIC_PRIVATE_CONFIGURATION, vpc_has_subnets=True
Expand All @@ -571,7 +571,7 @@ def test_vpc_automation_no_awsbatch_no_errors(mocker, capsys, test_datadir, temp
mock_handler.add_subnet_automation(public_subnet_id="subnet-12345678", private_subnet_id="subnet-23456789")

input_composer = ComposeInput(aws_region_name="eu-west-1", key="key1", scheduler="slurm")
input_composer.add_first_flow(op_sys="centos7", head_node_instance="t2.nano")
input_composer.add_first_flow(op_sys="alinux2", head_node_instance="t2.nano")
input_composer.add_compute_instance("t2.micro", "14")
input_composer.add_vpc_sub_automation(network_configuration=PUBLIC_PRIVATE_CONFIGURATION)
input_composer.mock_input(mocker)
Expand Down Expand Up @@ -636,7 +636,7 @@ def test_vpc_automation_no_vpc_in_region(mocker, capsys, test_datadir, temp_path
mock_handler.add_subnet_automation(public_subnet_id="subnet-12345678", private_subnet_id="subnet-23456789")

input_composer = ComposeInput(aws_region_name="eu-west-1", key="key1", scheduler="slurm")
input_composer.add_first_flow(op_sys="centos7", head_node_instance="t2.nano")
input_composer.add_first_flow(op_sys="alinux2", head_node_instance="t2.nano")
input_composer.add_compute_instance("t2.micro", "14")
input_composer.add_vpc_sub_automation_empty_region(network_configuration=PUBLIC_PRIVATE_CONFIGURATION)
input_composer.mock_input(mocker)
Expand All @@ -652,7 +652,7 @@ def test_vpc_automation_no_vpc_in_region_public(mocker, capsys, test_datadir, te
mock_handler.add_subnet_automation(public_subnet_id="subnet-12345678")

input_composer = ComposeInput(aws_region_name="eu-west-1", key="key1", scheduler="slurm")
input_composer.add_first_flow(op_sys="centos7", head_node_instance="t2.nano")
input_composer.add_first_flow(op_sys="alinux2", head_node_instance="t2.nano")
input_composer.add_compute_instance("t2.micro", "14")
input_composer.add_vpc_sub_automation_empty_region(network_configuration="2")
input_composer.mock_input(mocker)
Expand Down Expand Up @@ -681,7 +681,7 @@ def general_wrapper_for_prompt_testing(
temp_path_for_config,
region="eu-west-1",
scheduler="slurm",
op_sys="centos7",
op_sys="alinux2",
max_size="10",
head_node_instance="t2.nano",
compute_instance="t2.micro",
Expand Down Expand Up @@ -764,7 +764,7 @@ def test_vpc_automation_with_no_single_qualified_az(mocker, temp_path_for_config
mock_handler.add_subnet_automation(public_subnet_id="subnet-12345678", private_subnet_id="subnet-23456789")

input_composer = ComposeInput(aws_region_name="eu-west-1", key="key1", scheduler="slurm")
input_composer.add_first_flow(op_sys="centos7", head_node_instance="t2.nano")
input_composer.add_first_flow(op_sys="alinux2", head_node_instance="t2.nano")
input_composer.add_compute_instance("t2.micro", "14")
input_composer.add_vpc_sub_automation(network_configuration=PUBLIC_PRIVATE_CONFIGURATION)
input_composer.mock_input(mocker)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ Allowed values for Scheduler:
Allowed values for Operating System:
1. alinux2
2. alinux2023
3. centos7
4. ubuntu2004
5. ubuntu2204
6. rhel8
7. rocky8
8. rhel9
9. rocky9
3. ubuntu2004
4. ubuntu2204
5. rhel8
6. rocky8
7. rhel9
8. rocky9
The EC2 instance selected supports enhanced networking capabilities using Elastic Fabric Adapter (EFA). EFA enables you to run applications requiring high levels of inter-node communications at scale on AWS at no additional charge (https://docs.aws.amazon.com/parallelcluster/latest/ug/efa-v3.html).
Allowed values for VPC ID:
# id name number_of_subnets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ Allowed values for Scheduler:
Allowed values for Operating System:
1. alinux2
2. alinux2023
3. centos7
4. ubuntu2004
5. ubuntu2204
6. rhel8
7. rocky8
8. rhel9
9. rocky9
3. ubuntu2004
4. ubuntu2204
5. rhel8
6. rocky8
7. rhel9
8. rocky9
Allowed values for VPC ID:
# id name number_of_subnets
--- ------------ --------------------------------- -------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ Allowed values for Scheduler:
Allowed values for Operating System:
1. alinux2
2. alinux2023
3. centos7
4. ubuntu2004
5. ubuntu2204
6. rhel8
7. rocky8
8. rhel9
9. rocky9
3. ubuntu2004
4. ubuntu2204
5. rhel8
6. rocky8
7. rhel9
8. rocky9
The EC2 instance selected supports enhanced networking capabilities using Elastic Fabric Adapter (EFA). EFA enables you to run applications requiring high levels of inter-node communications at scale on AWS at no additional charge (https://docs.aws.amazon.com/parallelcluster/latest/ug/efa-v3.html).
Enabling EFA requires compute instances to be placed within a Placement Group. Please specify an existing Placement Group name or leave it blank for ParallelCluster to create one.
Allowed values for VPC ID:
Expand Down
Loading

0 comments on commit 9c44fa0

Please sign in to comment.