From f4bea2f42f7978a506f1777002a7be009f9f8a5f Mon Sep 17 00:00:00 2001 From: Ryan Anderson Date: Mon, 22 Jan 2024 12:00:40 -0500 Subject: [PATCH] Add the config parameter `DeploymentSettings/DefaultUserHome` to change the default user's home directory across the cluster Move the cluster user out of `/home` and into `/local/home` when the `DefaultUserHome` option is set to local --- CHANGELOG.md | 1 + cli/src/pcluster/config/cluster_config.py | 15 +++- cli/src/pcluster/config/common.py | 8 ++ cli/src/pcluster/schemas/cluster_schema.py | 8 +- cli/src/pcluster/templates/cluster_stack.py | 9 +++ .../pcluster/templates/login_nodes_stack.py | 9 +++ cli/src/pcluster/templates/queues_stack.py | 9 +++ .../pcluster/templates/test_cluster_stack.py | 7 ++ .../default-user-local-home.yaml | 22 ++++++ .../head_node_default.dna.json | 1 + .../test_login_nodes_dna_json/config-1.yaml | 1 + .../test_login_nodes_dna_json/dna-1.json | 1 + .../test_login_nodes_dna_json/dna-2.json | 3 +- .../test_compute_nodes_dna_json/config-2.yaml | 1 + .../test_compute_nodes_dna_json/dna-1.json | 75 ++++++++++--------- .../test_compute_nodes_dna_json/dna-2.json | 1 + tests/integration-tests/configs/develop.yaml | 7 ++ .../integration-tests/tests/users/__init__.py | 11 +++ .../tests/users/test_default_user_home.py | 46 ++++++++++++ .../pcluster.config.yaml | 33 ++++++++ 20 files changed, 227 insertions(+), 41 deletions(-) create mode 100644 cli/tests/pcluster/templates/test_cluster_stack/test_head_node_dna_json/default-user-local-home.yaml create mode 100644 tests/integration-tests/tests/users/__init__.py create mode 100644 tests/integration-tests/tests/users/test_default_user_home.py create mode 100644 tests/integration-tests/tests/users/test_default_user_home/test_default_user_local_home/pcluster.config.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index f6e3831c7a..303cfa858d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG ------ **ENHANCEMENTS** +- Add the configuration parameter `DeploymentSettings/DefaultUserHome` to allow users to move the default user's home directory to `/local/home` instead of `/home` (default). - Permit to update `MinCount`, `MaxCount`, `Queue` and `ComputeResource` configuration parameters without the need to stop the compute fleet. It's now possible to update them by setting `Scheduling/SlurmSettings/QueueUpdateStrategy` to TERMINATE. ParallelCluster will terminate only the nodes removed during a resize of the cluster capacity diff --git a/cli/src/pcluster/config/cluster_config.py b/cli/src/pcluster/config/cluster_config.py index 6d292ad20c..f54a5b4e69 100644 --- a/cli/src/pcluster/config/cluster_config.py +++ b/cli/src/pcluster/config/cluster_config.py @@ -23,7 +23,14 @@ from pcluster.aws.aws_api import AWSApi from pcluster.aws.aws_resources import InstanceTypeInfo from pcluster.aws.common import AWSClientError, get_region -from pcluster.config.common import AdditionalIamPolicy, BaseDeploymentSettings, BaseDevSettings, BaseTag, CapacityType +from pcluster.config.common import ( + AdditionalIamPolicy, + BaseDeploymentSettings, + BaseDevSettings, + BaseTag, + CapacityType, + DefaultUserHomeType, +) from pcluster.config.common import Imds as TopLevelImds from pcluster.config.common import Resource from pcluster.constants import ( @@ -1232,9 +1239,13 @@ def _register_validators(self, context: ValidatorContext = None): class ClusterDeploymentSettings(BaseDeploymentSettings): """Represent the cluster-wide settings related to deployment.""" - def __init__(self, disable_sudo_access_default_user: bool = None, **kwargs): + def __init__(self, default_user_home: str = None, disable_sudo_access_default_user: bool = None, **kwargs): super().__init__(**kwargs) self.disable_sudo_access_default_user = Resource.init_param(disable_sudo_access_default_user) + self.default_user_home = Resource.init_param( + default_user_home, + default=DefaultUserHomeType.SHARED.value, + ) def _register_validators(self, context: ValidatorContext = None): super()._register_validators(context) diff --git a/cli/src/pcluster/config/common.py b/cli/src/pcluster/config/common.py index 935412a9e6..cf7f54323c 100644 --- a/cli/src/pcluster/config/common.py +++ b/cli/src/pcluster/config/common.py @@ -378,6 +378,13 @@ def __init__(self, imds_support: str = None, **kwargs): self.imds_support = Resource.init_param(imds_support, default="v2.0") +class DefaultUserHomeType(Enum): + """Define supported allocation strategies.""" + + SHARED = "Shared" + LOCAL = "Local" + + class BaseDeploymentSettings(Resource): """ Represent the settings related to PCluster deployment, i.e. Lambda Functions for custom resources. @@ -388,6 +395,7 @@ class BaseDeploymentSettings(Resource): def __init__(self, lambda_functions_vpc_config: LambdaFunctionsVpcConfig = None, **kwargs): super().__init__(**kwargs) + self.lambda_functions_vpc_config = Resource.init_param(lambda_functions_vpc_config) def _register_validators(self, context: ValidatorContext = None): diff --git a/cli/src/pcluster/schemas/cluster_schema.py b/cli/src/pcluster/schemas/cluster_schema.py index 1686ab5d3e..8ba6d45d05 100644 --- a/cli/src/pcluster/schemas/cluster_schema.py +++ b/cli/src/pcluster/schemas/cluster_schema.py @@ -95,7 +95,7 @@ SlurmSettings, Timeouts, ) -from pcluster.config.common import BaseTag, CapacityType +from pcluster.config.common import BaseTag, CapacityType, DefaultUserHomeType from pcluster.config.update_policy import UpdatePolicy from pcluster.constants import ( DELETION_POLICIES, @@ -1162,6 +1162,12 @@ class ClusterDeploymentSettingsSchema(BaseDeploymentSettingsSchema): metadata={"update_policy": UpdatePolicy.COMPUTE_AND_LOGIN_NODES_STOP}, ) + default_user_home = fields.Str( + required=False, + metadata={"update_policy": UpdatePolicy.UNSUPPORTED}, + validate=validate.OneOf([type.value for type in DefaultUserHomeType]), + ) + @post_load def make_resource(self, data, **kwargs): """Generate resource.""" diff --git a/cli/src/pcluster/templates/cluster_stack.py b/cli/src/pcluster/templates/cluster_stack.py index bda8969065..8fa8c8d50b 100644 --- a/cli/src/pcluster/templates/cluster_stack.py +++ b/cli/src/pcluster/templates/cluster_stack.py @@ -57,6 +57,7 @@ SharedStorageType, SlurmClusterConfig, ) +from pcluster.config.common import DefaultUserHomeType from pcluster.constants import ( ALL_PORTS_RANGE, CW_ALARM_DATAPOINTS_TO_ALARM_DEFAULT, @@ -1250,6 +1251,14 @@ def _add_head_node(self): "base_os": self.config.image.os, "region": self.stack.region, "shared_storage_type": self.config.head_node.shared_storage_type.lower(), + "default_user_home": ( + self.config.deployment_settings.default_user_home.lower() + if ( + self.config.deployment_settings is not None + and self.config.deployment_settings.default_user_home is not None + ) + else DefaultUserHomeType.SHARED.value.lower() + ), "efs_fs_ids": get_shared_storage_ids_by_type(self.shared_storage_infos, SharedStorageType.EFS), "efs_shared_dirs": to_comma_separated_string(self.shared_storage_mount_dirs[SharedStorageType.EFS]), "efs_encryption_in_transits": to_comma_separated_string( diff --git a/cli/src/pcluster/templates/login_nodes_stack.py b/cli/src/pcluster/templates/login_nodes_stack.py index d31c3e1e28..8999191d2b 100644 --- a/cli/src/pcluster/templates/login_nodes_stack.py +++ b/cli/src/pcluster/templates/login_nodes_stack.py @@ -9,6 +9,7 @@ from pcluster.aws.aws_api import AWSApi from pcluster.config.cluster_config import LoginNodesPool, SharedStorageType, SlurmClusterConfig +from pcluster.config.common import DefaultUserHomeType from pcluster.constants import ( DEFAULT_EPHEMERAL_DIR, NODE_BOOTSTRAP_TIMEOUT, @@ -211,6 +212,14 @@ def _add_login_nodes_pool_launch_template(self): "generate_ssh_keys_for_users": ds_generate_keys, }, "shared_storage_type": self._config.head_node.shared_storage_type.lower(), + "default_user_home": ( + self._config.deployment_settings.default_user_home.lower() + if ( + self._config.deployment_settings is not None + and self._config.deployment_settings.default_user_home is not None + ) + else DefaultUserHomeType.SHARED.value.lower() + ), "ebs_shared_dirs": to_comma_separated_string( self._shared_storage_mount_dirs[SharedStorageType.EBS] ), diff --git a/cli/src/pcluster/templates/queues_stack.py b/cli/src/pcluster/templates/queues_stack.py index 4caea5d077..65a2b53dd5 100644 --- a/cli/src/pcluster/templates/queues_stack.py +++ b/cli/src/pcluster/templates/queues_stack.py @@ -8,6 +8,7 @@ from pcluster.aws.aws_api import AWSApi from pcluster.config.cluster_config import SharedStorageType, SlurmClusterConfig, SlurmComputeResource, SlurmQueue +from pcluster.config.common import DefaultUserHomeType from pcluster.constants import ( DEFAULT_EPHEMERAL_DIR, NODE_BOOTSTRAP_TIMEOUT, @@ -314,6 +315,14 @@ def _add_compute_resource_launch_template( "base_os": self._config.image.os, "region": self._config.region, "shared_storage_type": self._config.head_node.shared_storage_type.lower(), # noqa: E501 pylint: disable=line-too-long + "default_user_home": ( + self._config.deployment_settings.default_user_home.lower() + if ( + self._config.deployment_settings is not None + and self._config.deployment_settings.default_user_home is not None + ) + else DefaultUserHomeType.SHARED.value.lower() + ), "efs_fs_ids": get_shared_storage_ids_by_type(self._shared_storage_infos, SharedStorageType.EFS), "efs_shared_dirs": to_comma_separated_string( self._shared_storage_mount_dirs[SharedStorageType.EFS] diff --git a/cli/tests/pcluster/templates/test_cluster_stack.py b/cli/tests/pcluster/templates/test_cluster_stack.py index 3db4510271..637c919106 100644 --- a/cli/tests/pcluster/templates/test_cluster_stack.py +++ b/cli/tests/pcluster/templates/test_cluster_stack.py @@ -884,6 +884,13 @@ def test_login_nodes_traffic_management_resources_values_properties( "scheduler": "slurm", }, ), + ( + "default-user-local-home.yaml", + { + "scheduler": "slurm", + "default_user_home": "local", + }, + ), ], ) # Datetime mocking is required because some template values depend on the current datetime value diff --git a/cli/tests/pcluster/templates/test_cluster_stack/test_head_node_dna_json/default-user-local-home.yaml b/cli/tests/pcluster/templates/test_cluster_stack/test_head_node_dna_json/default-user-local-home.yaml new file mode 100644 index 0000000000..3ae48792cd --- /dev/null +++ b/cli/tests/pcluster/templates/test_cluster_stack/test_head_node_dna_json/default-user-local-home.yaml @@ -0,0 +1,22 @@ +Image: + Os: alinux2 +HeadNode: + InstanceType: t2.micro + Networking: + SubnetId: subnet-12345678 + Ssh: + KeyName: ec2-key-name +Scheduling: + Scheduler: slurm + SlurmQueues: + - Name: queue1 + Networking: + SubnetIds: + - subnet-12345678 + ComputeResources: + - Name: compute_resource1 + InstanceType: c5.2xlarge + - Name: compute_resource2 + InstanceType: c4.2xlarge +DeploymentSettings: + DefaultUserHome: Local diff --git a/cli/tests/pcluster/templates/test_cluster_stack/test_head_node_dna_json/head_node_default.dna.json b/cli/tests/pcluster/templates/test_cluster_stack/test_head_node_dna_json/head_node_default.dna.json index 1d12c4ea9f..5ba6cdbfb2 100644 --- a/cli/tests/pcluster/templates/test_cluster_stack/test_head_node_dna_json/head_node_default.dna.json +++ b/cli/tests/pcluster/templates/test_cluster_stack/test_head_node_dna_json/head_node_default.dna.json @@ -13,6 +13,7 @@ "dcv_enabled": "false", "dcv_port": "NONE", "ddb_table": "NONE", + "default_user_home": "shared", "disable_sudo_access_for_default_user": "false", "ebs_shared_dirs": "", "efs_encryption_in_transits": "", diff --git a/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/config-1.yaml b/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/config-1.yaml index caa4237801..dddcf1736d 100644 --- a/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/config-1.yaml +++ b/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/config-1.yaml @@ -1,5 +1,6 @@ DeploymentSettings: DisableSudoAccessForDefaultUser: True + DefaultUserHome: Local Region: us-east-1 Image: Os: alinux2 diff --git a/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/dna-1.json b/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/dna-1.json index 655102f848..fe2fc6281b 100644 --- a/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/dna-1.json +++ b/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/dna-1.json @@ -9,6 +9,7 @@ "custom_awsbatchcli_package": "", "custom_node_package": "", "cw_logging_enabled": "true", + "default_user_home": "local", "directory_service": { "domain_read_only_user": "", "enabled": "false", diff --git a/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/dna-2.json b/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/dna-2.json index d79164658f..3c2817937b 100644 --- a/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/dna-2.json +++ b/cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/dna-2.json @@ -9,6 +9,7 @@ "custom_awsbatchcli_package": "", "custom_node_package": "", "cw_logging_enabled": "true", + "default_user_home": "shared", "directory_service": { "domain_read_only_user": "cn=ReadOnlyUser,ou=Users,ou=CORP,dc=corp,dc=pcluster,dc=com", "enabled": "true", @@ -44,4 +45,4 @@ "stack_name": "clustername", "use_private_hostname": "false" } -} \ No newline at end of file +} diff --git a/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/config-2.yaml b/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/config-2.yaml index 713e7332a3..3f19dae35f 100644 --- a/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/config-2.yaml +++ b/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/config-2.yaml @@ -28,3 +28,4 @@ DirectoryService: GenerateSshKeysForUsers: true DeploymentSettings: DisableSudoAccessForDefaultUser: True + DefaultUserHome: Local diff --git a/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/dna-1.json b/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/dna-1.json index 07f7863b65..d243c47a1e 100644 --- a/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/dna-1.json +++ b/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/dna-1.json @@ -1,50 +1,51 @@ { "cluster": { - "cluster_name": "clustername", - "stack_name": "clustername", - "stack_arn": "{\"Ref\": \"AWS::StackId\"}", - "cluster_s3_bucket": "parallelcluster-a69601b5ee1fc2f2-v1-do-not-delete", + "base_os": "alinux2", "cluster_config_s3_key": "parallelcluster/clusters/dummy-cluster-randomstring123/configs/cluster-config-with-implied-values.yaml", "cluster_config_version": "", - "enable_efa": "NONE", - "raid_shared_dir": "", - "raid_type": "", - "base_os": "alinux2", - "region": "us-east-1", - "shared_storage_type": "ebs", - "efs_fs_ids": "", - "efs_shared_dirs": "", + "cluster_name": "clustername", + "cluster_s3_bucket": "parallelcluster-a69601b5ee1fc2f2-v1-do-not-delete", + "cluster_user": "ec2-user", + "custom_awsbatchcli_package": "", + "custom_node_package": "", + "cw_logging_enabled": "true", + "default_user_home": "shared", + "directory_service": { + "enabled": "false" + }, + "disable_sudo_access_for_default_user": "false", + "dns_domain": "{\"Ref\": \"referencetoclusternameClusterDNSDomain8D0872E1Ref\"}", + "ebs_shared_dirs": "", "efs_encryption_in_transits": "", + "efs_fs_ids": "", "efs_iam_authorizations": "", - "fsx_fs_ids": "", - "fsx_mount_names": "", + "efs_shared_dirs": "", + "enable_efa": "NONE", + "enable_efa_gdr": "NONE", + "enable_intel_hpc_platform": "false", + "ephemeral_dir": "/scratch", "fsx_dns_names": "", - "fsx_volume_junction_paths": "", + "fsx_fs_ids": "", "fsx_fs_types": "", + "fsx_mount_names": "", "fsx_shared_dirs": "", - "scheduler": "slurm", - "ephemeral_dir": "/scratch", - "ebs_shared_dirs": "", - "proxy": "NONE", - "slurm_ddb_table": "{\"Ref\": \"referencetoclusternameSlurmDynamoDBTable99119DBERef\"}", - "log_group_name": "/aws/parallelcluster/clustername-202401151530", - "dns_domain": "{\"Ref\": \"referencetoclusternameClusterDNSDomain8D0872E1Ref\"}", + "fsx_volume_junction_paths": "", + "head_node_private_ip": "{\"Ref\": \"referencetoclusternameHeadNodeENI6497A502PrimaryPrivateIpAddress\"}", "hosted_zone": "{\"Ref\": \"referencetoclusternameRoute53HostedZone2388733DRef\"}", - "node_type": "ComputeFleet", - "cluster_user": "ec2-user", - "enable_intel_hpc_platform": "false", - "cw_logging_enabled": "true", + "log_group_name": "/aws/parallelcluster/clustername-202401151530", "log_rotation_enabled": "true", - "scheduler_queue_name": "queue1", + "node_type": "ComputeFleet", + "proxy": "NONE", + "raid_shared_dir": "", + "raid_type": "", + "region": "us-east-1", + "scheduler": "slurm", "scheduler_compute_resource_name": "cr1", - "enable_efa_gdr": "NONE", - "custom_node_package": "", - "custom_awsbatchcli_package": "", - "use_private_hostname": "false", - "head_node_private_ip": "{\"Ref\": \"referencetoclusternameHeadNodeENI6497A502PrimaryPrivateIpAddress\"}", - "directory_service": { - "enabled": "false" - }, - "disable_sudo_access_for_default_user": "false" + "scheduler_queue_name": "queue1", + "shared_storage_type": "ebs", + "slurm_ddb_table": "{\"Ref\": \"referencetoclusternameSlurmDynamoDBTable99119DBERef\"}", + "stack_arn": "{\"Ref\": \"AWS::StackId\"}", + "stack_name": "clustername", + "use_private_hostname": "false" } -} \ No newline at end of file +} diff --git a/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/dna-2.json b/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/dna-2.json index 197e29ec50..b4a3a9b6ce 100644 --- a/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/dna-2.json +++ b/cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/dna-2.json @@ -9,6 +9,7 @@ "custom_awsbatchcli_package": "", "custom_node_package": "", "cw_logging_enabled": "true", + "default_user_home": "local", "directory_service": { "enabled": "true" }, diff --git a/tests/integration-tests/configs/develop.yaml b/tests/integration-tests/configs/develop.yaml index 562edd0bd3..6abbce3b85 100644 --- a/tests/integration-tests/configs/develop.yaml +++ b/tests/integration-tests/configs/develop.yaml @@ -831,3 +831,10 @@ test-suites: - regions: ["eu-west-2"] schedulers: ["slurm"] oss: ["alinux2"] + users: + test_default_user_home.py::test_default_user_local_home: + dimensions: + - oss: [ "alinux2" ] + regions: [ "us-west-2" ] + instances: {{ common.INSTANCES_DEFAULT_X86 }} + schedulers: [ "slurm" ] diff --git a/tests/integration-tests/tests/users/__init__.py b/tests/integration-tests/tests/users/__init__.py new file mode 100644 index 0000000000..32a189ee8f --- /dev/null +++ b/tests/integration-tests/tests/users/__init__.py @@ -0,0 +1,11 @@ +# Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. diff --git a/tests/integration-tests/tests/users/test_default_user_home.py b/tests/integration-tests/tests/users/test_default_user_home.py new file mode 100644 index 0000000000..acc7b9ed19 --- /dev/null +++ b/tests/integration-tests/tests/users/test_default_user_home.py @@ -0,0 +1,46 @@ +# Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. +import logging + +import pytest +from assertpy import assert_that +from remote_command_executor import RemoteCommandExecutor + +# flake8: noqa + + +@pytest.mark.usefixtures("os", "scheduler", "instance") +def test_default_user_local_home( + region, + scheduler, + pcluster_config_reader, + vpc_stack, + scheduler_commands_factory, + test_datadir, + clusters_factory, +): + """Verify the default user's home directory is moved on all instance types when set to local""" + + cluster_config = pcluster_config_reader() + cluster = clusters_factory(cluster_config) + remote_command_executor = RemoteCommandExecutor(cluster) + remote_command_executor_login_node = RemoteCommandExecutor(cluster, use_login_node=True) + + _check_local_home(remote_command_executor) + _check_local_home(remote_command_executor_login_node) + + +def _check_local_home(remote_command_executor): + """Check if the default user's home directory is mounted on the instance""" + logging.info("Testing the default user's home is local") + result = remote_command_executor.run_remote_command("pwd") + assert_that(result.stdout).matches(r"/local/home*") diff --git a/tests/integration-tests/tests/users/test_default_user_home/test_default_user_local_home/pcluster.config.yaml b/tests/integration-tests/tests/users/test_default_user_home/test_default_user_local_home/pcluster.config.yaml new file mode 100644 index 0000000000..3eb7f69e3f --- /dev/null +++ b/tests/integration-tests/tests/users/test_default_user_home/test_default_user_local_home/pcluster.config.yaml @@ -0,0 +1,33 @@ +Image: + Os: {{ os }} +LoginNodes: + Pools: + - Name: login-node-pool-0 + InstanceType: {{ instance }} + Count: 2 + Networking: + SubnetIds: + - {{ public_subnet_id }} + GracetimePeriod: 60 +HeadNode: + InstanceType: {{ instance }} + Networking: + SubnetId: {{ public_subnet_id }} + Ssh: + KeyName: {{ key_name }} + Imds: + Secured: {{ imds_secured }} +Scheduling: + Scheduler: slurm + SlurmQueues: + - Name: queue-0 + ComputeResources: + - Name: compute-resource-0 + Instances: + - InstanceType: {{ instance }} + MinCount: 1 + Networking: + SubnetIds: + - {{ private_subnet_id }} +DeploymentSettings: + DefaultUserHome: Local