From fd1101c1274ceeec2edd4cd19f9712f2bc8a7958 Mon Sep 17 00:00:00 2001 From: Hanwen Date: Mon, 14 Dec 2020 16:58:25 -0500 Subject: [PATCH 1/2] Remove the ban of using p4d as head node Signed-off-by: Hanwen --- CHANGELOG.md | 1 + cli/src/pcluster/config/validators.py | 2 +- cli/tests/pcluster/config/test_validators.py | 4 +--- cli/tests/pcluster/configure/test_pcluster_configure.py | 9 --------- .../test_multiple_nics/pcluster.config.ini | 2 +- 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf150a89e0..e77f14f06f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ CHANGELOG - Use inclusive language in user facing messages and internal naming convention. - Change the default of instance types from the hardcoded `t2.micro` to the free tier instance type (`t2.micro` or `t3.micro` dependent on region). In regions without free tier, the default is `t3.micro`. +- Allow P4d as head node. (P4d was already supported as compute node in 2.10.0) **BUG FIXES** diff --git a/cli/src/pcluster/config/validators.py b/cli/src/pcluster/config/validators.py index 20f17f277e..4a3bcc084d 100644 --- a/cli/src/pcluster/config/validators.py +++ b/cli/src/pcluster/config/validators.py @@ -77,7 +77,7 @@ "sc1": (500, 16 * 1024), } -HEAD_NODE_UNSUPPORTED_INSTANCE_TYPES = ["p4d.24xlarge"] +HEAD_NODE_UNSUPPORTED_INSTANCE_TYPES = [] HEAD_NODE_UNSUPPORTED_MESSAGE = "The instance type '{0}' is not supported as head node." # Constants for section labels diff --git a/cli/tests/pcluster/config/test_validators.py b/cli/tests/pcluster/config/test_validators.py index e603216d50..fa1247ebb7 100644 --- a/cli/tests/pcluster/config/test_validators.py +++ b/cli/tests/pcluster/config/test_validators.py @@ -87,9 +87,7 @@ def test_ec2_instance_type_validator(mocker, instance_type, expected_message): utils.assert_param_validator(mocker, config_parser_dict, expected_message) -@pytest.mark.parametrize( - "instance_type, expected_message", [("t2.micro", None), ("c4.xlarge", None), ("p4d.24xlarge", "is not supported")] -) +@pytest.mark.parametrize("instance_type, expected_message", [("t2.micro", None), ("c4.xlarge", None)]) def test_head_node_instance_type_validator(mocker, instance_type, expected_message): config_parser_dict = {"cluster default": {"master_instance_type": instance_type}} utils.assert_param_validator(mocker, config_parser_dict, expected_message) diff --git a/cli/tests/pcluster/configure/test_pcluster_configure.py b/cli/tests/pcluster/configure/test_pcluster_configure.py index cb4b43b12c..63a9359ade 100644 --- a/cli/tests/pcluster/configure/test_pcluster_configure.py +++ b/cli/tests/pcluster/configure/test_pcluster_configure.py @@ -914,12 +914,3 @@ def test_hit_config_file(mocker, capsys, test_datadir): # Expected sys exit with error with pytest.raises(SystemExit, match="ERROR: Configuration in file .* cannot be overwritten"): _run_configuration(mocker, old_config_file, with_config=True) - - -def test_invalid_p4d_head_node_type(mocker): - with pytest.raises(StopIteration): - assert_that(general_wrapper_for_prompt_testing(mocker, head_node_instance="p4d.24xlarge")).is_true() - - -def test_valid_p4d_compute_node_type(mocker): - assert_that(general_wrapper_for_prompt_testing(mocker, compute_instance="p4d.24xlarge")).is_true() diff --git a/tests/integration-tests/tests/multiple_nics/test_multiple_nics/test_multiple_nics/pcluster.config.ini b/tests/integration-tests/tests/multiple_nics/test_multiple_nics/test_multiple_nics/pcluster.config.ini index 71e62ed1cf..ac6fc00483 100644 --- a/tests/integration-tests/tests/multiple_nics/test_multiple_nics/test_multiple_nics/pcluster.config.ini +++ b/tests/integration-tests/tests/multiple_nics/test_multiple_nics/test_multiple_nics/pcluster.config.ini @@ -8,7 +8,7 @@ cluster_template = default base_os = {{ os }} key_name = {{ key_name }} scheduler = {{ scheduler }} -master_instance_type = c5.xlarge +master_instance_type = {{ instance }} compute_instance_type = {{ instance }} initial_queue_size = 1 maintain_initial_size = true From 9edf030827171f70cf557ec40e87ebcb20d182a0 Mon Sep 17 00:00:00 2001 From: Francesco De Martino Date: Tue, 15 Dec 2020 11:02:29 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e77f14f06f..f5a127a870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ CHANGELOG - Use inclusive language in user facing messages and internal naming convention. - Change the default of instance types from the hardcoded `t2.micro` to the free tier instance type (`t2.micro` or `t3.micro` dependent on region). In regions without free tier, the default is `t3.micro`. -- Allow P4d as head node. (P4d was already supported as compute node in 2.10.0) +- Enable support for p4d as head node instance type. (p4d was already supported as compute node in 2.10.0) **BUG FIXES**