Skip to content

Commit a752e2e

Browse files
committed
Rename new setting, Add changelog, Fix style, fix some tests
Signed-off-by: Thomas Heinen <t.heinen@reply.de>
1 parent 9b6d7a4 commit a752e2e

File tree

13 files changed

+36
-14
lines changed

13 files changed

+36
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CHANGELOG
77
**ENHANCEMENTS**
88

99
- Add support for custom actions on login nodes.
10+
- Add new configuration `SharedStorage/EfsSettings/AccessPointId` to specify an optional EFS access point for a mount
1011

1112
**BUG FIXES**
1213
- Fix validator `EfaPlacementGroupValidator` so that it does not suggest to configure a Placement Group when Capacity Blocks are used.

cli/src/pcluster/aws/efs.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,14 @@ def describe_file_system(self, efs_fs_id):
8080
:return: the mount_target_ids
8181
"""
8282
return self._client.describe_file_systems(FileSystemId=efs_fs_id)
83+
84+
@AWSExceptionHandler.handle_client_exception
85+
@Cache.cached
86+
def describe_access_point(self, access_point_id):
87+
"""
88+
Describe access point attributes for the given EFS access point id.
89+
90+
:param efaccess_point_ids_ap_id: EFS access point Id
91+
:return: the access_point details
92+
"""
93+
return self._client.describe_access_points(AccessPointId=access_point_id)

cli/src/pcluster/config/cluster_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def __init__(
371371
deletion_policy: str = None,
372372
encryption_in_transit: bool = None,
373373
iam_authorization: bool = None,
374-
accesspoint_id: str = None,
374+
access_point_id: str = None,
375375
):
376376
super().__init__()
377377
self.mount_dir = Resource.init_param(mount_dir)
@@ -388,7 +388,7 @@ def __init__(
388388
)
389389
self.encryption_in_transit = Resource.init_param(encryption_in_transit, default=False)
390390
self.iam_authorization = Resource.init_param(iam_authorization, default=False)
391-
self.accesspoint_id = Resource.init_param(accesspoint_id)
391+
self.access_point_id = Resource.init_param(access_point_id)
392392

393393
def _register_validators(self, context: ValidatorContext = None): # noqa: D102 #pylint: disable=unused-argument
394394
self._register_validator(SharedStorageNameValidator, name=self.name)
@@ -400,7 +400,7 @@ def _register_validators(self, context: ValidatorContext = None): # noqa: D102
400400
EfsMountOptionsValidator,
401401
encryption_in_transit=self.encryption_in_transit,
402402
iam_authorization=self.iam_authorization,
403-
accesspoint_id=self.accesspoint_id,
403+
access_point_id=self.access_point_id,
404404
name=self.name,
405405
)
406406

cli/src/pcluster/schemas/cluster_schema.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ class EfsSettingsSchema(BaseSchema):
321321
deletion_policy = fields.Str(
322322
validate=validate.OneOf(DELETION_POLICIES), metadata={"update_policy": UpdatePolicy.SUPPORTED}
323323
)
324-
accesspoint_id = fields.Str(
325-
validate=validate.Regexp(r"^fsap-[0-9a-z]{17}$"),
324+
access_point_id = fields.Str(
325+
validate=validate.Regexp(r"^fsap-[0-9a-z]{17}$"), metadata={"update_policy": UpdatePolicy.SUPPORTED}
326326
)
327327
encryption_in_transit = fields.Bool(metadata={"update_policy": UpdatePolicy.UNSUPPORTED})
328328
iam_authorization = fields.Bool(metadata={"update_policy": UpdatePolicy.UNSUPPORTED})
@@ -334,7 +334,12 @@ def validate_file_system_id_ignored_parameters(self, data, **kwargs):
334334
messages = []
335335
if data.get("file_system_id") is not None:
336336
for key in data:
337-
if key is not None and key not in ["encryption_in_transit", "iam_authorization", "file_system_id", "accesspoint_id"]:
337+
if key is not None and key not in [
338+
"encryption_in_transit",
339+
"iam_authorization",
340+
"file_system_id",
341+
"access_point_id"
342+
]:
338343
messages.append(EFS_MESSAGES["errors"]["ignored_param_with_efs_fs_id"].format(efs_param=key))
339344
if messages:
340345
raise ValidationError(message=messages)

cli/src/pcluster/templates/cluster_stack.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ def _add_efs_storage(self, id: str, shared_efs: SharedEfs):
11091109
shared_efs.encryption_in_transit
11101110
)
11111111
self.shared_storage_attributes[SharedStorageType.EFS]["IamAuthorizations"].append(shared_efs.iam_authorization)
1112-
self.shared_storage_attributes[SharedStorageType.EFS]["AccesspointIds"].append(shared_efs.accesspoint_id)
1112+
self.shared_storage_attributes[SharedStorageType.EFS]["AccessPointIds"].append(shared_efs.access_point_id)
11131113

11141114
return efs_id
11151115

@@ -1289,8 +1289,8 @@ def _add_head_node(self):
12891289
"efs_iam_authorizations": to_comma_separated_string(
12901290
self.shared_storage_attributes[SharedStorageType.EFS]["IamAuthorizations"], use_lower_case=True
12911291
),
1292-
"efs_accesspoint_ids": to_comma_separated_string(
1293-
self.shared_storage_attributes[SharedStorageType.EFS]["AccesspointIds"],
1292+
"efs_access_point_ids": to_comma_separated_string(
1293+
self.shared_storage_attributes[SharedStorageType.EFS]["AccessPointIds"],
12941294
use_lower_case=True,
12951295
),
12961296
"fsx_fs_ids": get_shared_storage_ids_by_type(self.shared_storage_infos, SharedStorageType.FSX),

cli/src/pcluster/templates/login_nodes_stack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ def _add_login_nodes_pool_launch_template(self):
235235
self._shared_storage_attributes[SharedStorageType.EFS]["IamAuthorizations"],
236236
use_lower_case=True,
237237
),
238-
"efs_accesspoint_ids": to_comma_separated_string(
239-
self._shared_storage_attributes[SharedStorageType.EFS]["AccesspointIds"],
238+
"efs_access_point_ids": to_comma_separated_string(
239+
self._shared_storage_attributes[SharedStorageType.EFS]["AccessPointIds"],
240240
use_lower_case=True,
241241
),
242242
"enable_intel_hpc_platform": "true" if self._config.is_intel_hpc_platform_enabled else "false",

cli/src/pcluster/templates/queues_stack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ def _add_compute_resource_launch_template(
335335
self._shared_storage_attributes[SharedStorageType.EFS]["IamAuthorizations"],
336336
use_lower_case=True,
337337
),
338-
"efs_accesspoint_ids": to_comma_separated_string(
339-
self._shared_storage_attributes[SharedStorageType.EFS]["AccesspointIds"],
338+
"efs_access_point_ids": to_comma_separated_string(
339+
self._shared_storage_attributes[SharedStorageType.EFS]["AccessPointIds"],
340340
use_lower_case=True,
341341
),
342342
"fsx_fs_ids": get_shared_storage_ids_by_type(self._shared_storage_infos, SharedStorageType.FSX),

cli/src/pcluster3_config_converter/pcluster3_config_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def convert_efs_settings(self, section_name):
296296
("efs_kms_key_id", "KmsKeyId"),
297297
("provisioned_throughput", "ProvisionedThroughput", "getint"),
298298
("throughput_mode", "ThroughputMode"),
299-
("accesspoint_id", "AccesspointId"),
299+
("access_point_id", "AccessPointId"),
300300
]
301301
efs_section, efs_dict, _section_label = self.convert_storage_base(
302302
"efs", efs_label.strip(), additional_items

cli/tests/pcluster/templates/test_cluster_stack/test_head_node_dna_json/head_node_default.dna.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"efs_fs_ids": "",
2121
"efs_iam_authorizations": "",
2222
"efs_shared_dirs": "",
23+
"efs_access_point_ids": "",
2324
"enable_intel_hpc_platform": "false",
2425
"ephemeral_dir": "/scratch",
2526
"fsx_dns_names": "",

cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/dna-1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"efs_fs_ids": "",
2323
"efs_iam_authorizations": "",
2424
"efs_shared_dirs": "",
25+
"efs_access_point_ids": "",
2526
"enable_intel_hpc_platform": "false",
2627
"ephemeral_dir": "/scratch",
2728
"fsx_dns_names": "",

0 commit comments

Comments
 (0)