From 6f8e978b9ef2cea8855a80112b26b9968543a7e5 Mon Sep 17 00:00:00 2001 From: Rex Date: Thu, 11 Mar 2021 14:17:52 -0800 Subject: [PATCH] Deprecate AL1 and Ubuntu16: address comments Signed-off-by: Rex --- cli/src/pcluster/cli.py | 3 ++- cli/src/pcluster/config/mappings.py | 10 ++++++++-- cli/src/pcluster/config/validators.py | 4 ++-- cli/src/pcluster/constants.py | 1 + cli/src/pcluster/dcv/utils.py | 3 ++- tests/integration-tests/configs/common/common.yaml | 2 +- tests/integration-tests/configs/develop.yaml | 2 +- tests/integration-tests/configs/new_region.yaml | 2 +- .../cloudwatch_logging/test_cloudwatch_logging.py | 2 +- 9 files changed, 19 insertions(+), 10 deletions(-) diff --git a/cli/src/pcluster/cli.py b/cli/src/pcluster/cli.py index 53a30b63f4..8971ccc2b6 100644 --- a/cli/src/pcluster/cli.py +++ b/cli/src/pcluster/cli.py @@ -29,6 +29,7 @@ import pcluster.configure.easyconfig as easyconfig import pcluster.createami as createami import pcluster.utils as utils +from pcluster.constants import SUPPORTED_OSS from pcluster.dcv.connect import dcv_connect LOGGER = logging.getLogger(__name__) @@ -360,7 +361,7 @@ def _get_parser(): "--os", dest="base_ami_os", required=True, - help="Specifies the OS of the base AMI. " "Valid options are: alinux2, ubuntu1804, centos7, centos8.", + help="Specifies the OS of the base AMI. " "Valid options are: %s." % ", ".join(SUPPORTED_OSS), ) pami.add_argument( "-i", diff --git a/cli/src/pcluster/config/mappings.py b/cli/src/pcluster/config/mappings.py index 5941596a41..7dcb63b138 100644 --- a/cli/src/pcluster/config/mappings.py +++ b/cli/src/pcluster/config/mappings.py @@ -111,7 +111,13 @@ tags_validator, url_validator, ) -from pcluster.constants import CIDR_ALL_IPS, FSX_HDD_THROUGHPUT, FSX_SSD_THROUGHPUT, SUPPORTED_ARCHITECTURES +from pcluster.constants import ( + CIDR_ALL_IPS, + FSX_HDD_THROUGHPUT, + FSX_SSD_THROUGHPUT, + SUPPORTED_ARCHITECTURES, + SUPPORTED_OSS, +) CLUSTER_COMMON_VALIDATORS = [duplicate_shared_dir_validator, region_validator] # This file contains a definition of all the sections and the parameters configurable by the user @@ -811,7 +817,7 @@ ("base_os", { "type": BaseOSCfnParam, "cfn_param_mapping": "BaseOS", - "allowed_values": ["alinux2", "ubuntu1804", "centos7", "centos8"], + "allowed_values": SUPPORTED_OSS, "validators": [architecture_os_validator], "required": True, "update_policy": UpdatePolicy.UNSUPPORTED diff --git a/cli/src/pcluster/config/validators.py b/cli/src/pcluster/config/validators.py index 54326d2d4f..5fa239f55b 100644 --- a/cli/src/pcluster/config/validators.py +++ b/cli/src/pcluster/config/validators.py @@ -17,7 +17,7 @@ import boto3 from botocore.exceptions import ClientError, ParamValidationError -from pcluster.constants import CIDR_ALL_IPS, FSX_HDD_THROUGHPUT, FSX_SSD_THROUGHPUT +from pcluster.constants import CIDR_ALL_IPS, FSX_HDD_THROUGHPUT, FSX_SSD_THROUGHPUT, SUPPORTED_OSS from pcluster.dcv.utils import get_supported_dcv_os from pcluster.utils import ( InstanceTypeInfo, @@ -90,7 +90,7 @@ } FSX_SUPPORTED_ARCHITECTURES_OSES = { - "x86_64": ["centos7", "centos8", "ubuntu1804", "alinux2"], + "x86_64": SUPPORTED_OSS, "arm64": ["ubuntu1804", "alinux2", "centos8"], } diff --git a/cli/src/pcluster/constants.py b/cli/src/pcluster/constants.py index ed2674b196..984d72f33b 100644 --- a/cli/src/pcluster/constants.py +++ b/cli/src/pcluster/constants.py @@ -18,3 +18,4 @@ SUPPORTED_ARCHITECTURES = ["x86_64", "arm64"] FSX_SSD_THROUGHPUT = [50, 100, 200] FSX_HDD_THROUGHPUT = [12, 40] +SUPPORTED_OSS = ["alinux2", "ubuntu1804", "centos7", "centos8"] diff --git a/cli/src/pcluster/dcv/utils.py b/cli/src/pcluster/dcv/utils.py index d75980fbf8..2b508f311c 100644 --- a/cli/src/pcluster/dcv/utils.py +++ b/cli/src/pcluster/dcv/utils.py @@ -9,6 +9,7 @@ # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and # limitations under the License. +from pcluster.constants import SUPPORTED_OSS DCV_CONNECT_SCRIPT = "/opt/parallelcluster/scripts/pcluster_dcv_connect.sh" @@ -16,7 +17,7 @@ def get_supported_dcv_os(architecture): """Return a list of all the operating system supported by DCV.""" architectures_dict = { - "x86_64": ["centos7", "centos8", "ubuntu1804", "alinux2"], + "x86_64": SUPPORTED_OSS, "arm64": ["ubuntu1804", "alinux2", "centos8"], } return architectures_dict.get(architecture, []) diff --git a/tests/integration-tests/configs/common/common.yaml b/tests/integration-tests/configs/common/common.yaml index 5708c25594..16bdeaf426 100644 --- a/tests/integration-tests/configs/common/common.yaml +++ b/tests/integration-tests/configs/common/common.yaml @@ -173,7 +173,7 @@ disable_hyperthreading: test_disable_hyperthreading.py::test_sit_disable_hyperthreading: dimensions: # Manually disabled HT - {%- for os, scheduler in [("centos8", "torque"), ("ubuntu1804", "sge")] %} + {%- for os, scheduler in [("centos7", "torque"), ("ubuntu1804", "sge")] %} - regions: ["sa-east-1"] instances: ["m4.xlarge"] oss: ["{{ os }}"] diff --git a/tests/integration-tests/configs/develop.yaml b/tests/integration-tests/configs/develop.yaml index 3258d023a4..973990fecd 100644 --- a/tests/integration-tests/configs/develop.yaml +++ b/tests/integration-tests/configs/develop.yaml @@ -7,7 +7,7 @@ test-suites: runtime_bake: test_runtime_bake.py::test_runtime_bake: # These are currently skipped dimensions: - {%- for os, scheduler in [("alinux2", "torque"), ("centos7", "sge")] %} + {%- for os, scheduler in [("alinux2", "slurm"), ("alinux2", "torque"), ("centos7", "sge")] %} - regions: ["eu-west-2"] instances: {{ common.INSTANCES_DEFAULT_X86 }} oss: ["{{ os }}"] diff --git a/tests/integration-tests/configs/new_region.yaml b/tests/integration-tests/configs/new_region.yaml index 64ce0fb4c7..3bd09d3a7c 100644 --- a/tests/integration-tests/configs/new_region.yaml +++ b/tests/integration-tests/configs/new_region.yaml @@ -146,7 +146,7 @@ test-suites: dimensions: - regions: {{ NEW_REGION }} instances: {{ common.INSTANCES_DEFAULT_X86 }} - oss: ["alinux"] + oss: ["alinux2"] schedulers: ["slurm"] test_efs.py::test_efs_compute_az: dimensions: diff --git a/tests/integration-tests/tests/cloudwatch_logging/test_cloudwatch_logging.py b/tests/integration-tests/tests/cloudwatch_logging/test_cloudwatch_logging.py index 2b061dc9e1..b853daaf00 100644 --- a/tests/integration-tests/tests/cloudwatch_logging/test_cloudwatch_logging.py +++ b/tests/integration-tests/tests/cloudwatch_logging/test_cloudwatch_logging.py @@ -141,7 +141,7 @@ def _base_os_to_platform(base_os): """Turn the name of a base OS into the platform.""" # Special case: alinux2 is how the config file refers to amazon linux 2, but in the chef cookbook # (and the cloudwatch log config produced by it) the platform is "amazon". - translations = {"alinux": "amazon"} + translations = {"alinux2": "amazon"} no_digits = base_os.rstrip(string.digits) return translations.get(no_digits, no_digits)