Skip to content

Commit ecf099a

Browse files
author
Sean Smith
committed
FSx Lustre Deployment Types
We've added support for two new FSx Lustre deployment types * `SCRATCH_2` - The latest generation of scratch file systems that supports up to six times the baseline throughput for spiky workloads, and supports in-transit encryption of data for supported instance types. With this deployment type, the storage_capacity settings has possible values of 1200 and any multiple of 2400. * `PERSISTENT_1` - Designed for longer-term storage. The file servers are highly available and the data is replicated within the file systems AWS Availability Zone (AZ), and supports in-transit encryption of data for supported instance types. With this deployment type, the storage_capacity settings has possible values of 1200 and any multiple of 2400. Added parameters: * Add `deployment_type` parameter * Add `per_unit_storage_throughput` parameter Added IAM parameters: * `fsx:DescribeFileSystems` This is needed to retreive the FSx MountName from the DescribeFileSystems API Added Validatations: * Validate `kms_key_id` and `per_unit_storage_throughput` are only set when `PERSISTENT_1` * Add FSx Deployment Type Options to the integration tests * Get FSx MountName from Boto3 * For the new FSx FileSystem Types, the mountname changes from always /fsx to a value returned from the API. This is backwards compatible, so the API returns /fsx for `SCRATCH_1` (current default) filesystems. Validate Storage Capacity * If deployment_type == 'PERSISTENT_1' or 'SCRATCH_2' then storage_capacity can be 1200 GiB, 2400 GiB, or multiples of 2400 * If deployment_type == 'SCRATCH_1' then storage_capacity can be 1200 GiB, 2400 GiB, or multiples of 3600 Signed-off-by: Sean Smith <[email protected]>
1 parent 3f537b0 commit ecf099a

File tree

13 files changed

+312
-63
lines changed

13 files changed

+312
-63
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ CHANGELOG
33
=========
44

55
2.6.0
6-
====
6+
=====
7+
8+
**ENHANCEMENTS**
9+
* Support two new Lustre Features, Scratch 2 and Persistent filesystems
10+
* This adds two parameters ``deployment_type`` and ``per_unit_storage_throughput`` to the ``fsx`` section.
11+
* New storage sizes ``storage_capacity``, 1,200 GiB, 2,400 GiB and multiples of 2,400 are supported with ``SCRATCH_2``
12+
* In transit encryption is available via ``kms_key_id`` parameter when ``deployment_type = PERSISTENT_1``.
13+
* A new parameter, ``per_unit_storage_throughput`` is available when ``deployment_type = PERSISTENT_1``.
714

815
**CHANGES**
916

cli/pcluster/config/mappings.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@
108108
"volume_id": r"^vol-[0-9a-z]{8}$|^vol-[0-9a-z]{17}$",
109109
"volume_types": ["standard", "io1", "gp2", "st1", "sc1"],
110110
"vpc_id": r"^vpc-[0-9a-z]{8}$|^vpc-[0-9a-z]{17}$",
111+
"deployment_type": ["SCRATCH_1", "SCRATCH_2", "PERSISTENT_1"],
112+
"per_unit_storage_throughput": [50, 100, 200],
111113
}
112114

113115
AWS = {
@@ -354,7 +356,7 @@
354356
"type": Section,
355357
"key": "fsx",
356358
"default_label": "default",
357-
"validators": [fsx_validator],
359+
"validators": [fsx_validator, fsx_storage_capacity_validator],
358360
"cfn_param_mapping": "FSXOptions", # All the parameters in the section are converted into a single CFN parameter
359361
"params": OrderedDict( # Use OrderedDict because the parameters must respect the order in the CFN parameter
360362
[
@@ -368,7 +370,6 @@
368370
}),
369371
("storage_capacity", {
370372
"type": IntParam,
371-
"validators": [fsx_storage_capacity_validator]
372373
}),
373374
("fsx_kms_key_id", {
374375
"validators": [kms_key_validator],
@@ -386,6 +387,13 @@
386387
("weekly_maintenance_start_time", {
387388
"allowed_values": r"NONE|^[1-7]:([01]\d|2[0-3]):?([0-5]\d)$",
388389
}),
390+
("deployment_type", {
391+
"allowed_values": ALLOWED_VALUES["deployment_type"],
392+
}),
393+
("per_unit_storage_throughput", {
394+
"type": IntParam,
395+
"allowed_values": ALLOWED_VALUES["per_unit_storage_throughput"],
396+
}),
389397
]
390398
)
391399
}
@@ -412,6 +420,7 @@
412420
]
413421
)
414422
}
423+
415424
CW_LOG = {
416425
"type": Section,
417426
"key": "cw_log",

cli/pcluster/config/validators.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,11 @@ def fsx_validator(section_key, section_label, pcluster_config):
147147
if fsx_export_path and not fsx_import_path:
148148
errors.append("When specifying 'export_path', the 'import_path' option must be specified")
149149

150-
if not fsx_section.get_param_value("storage_capacity") and not fsx_section.get_param_value("fsx_fs_id"):
151-
errors.append("When specifying 'fsx' section, the 'storage_capacity' option must be specified")
150+
if fsx_section.get_param_value("deployment_type") != "PERSISTENT_1":
151+
if fsx_section.get_param_value("fsx_kms_key_id"):
152+
errors.append("'fsx_kms_key_id' can only be used when 'deployment_type = PERSISTENT_1'")
153+
if fsx_section.get_param_value("per_unit_storage_throughput"):
154+
errors.append("'per_unit_storage_throughput' can only be used when 'deployment_type = PERSISTENT_1'")
152155

153156
return errors, warnings
154157

@@ -205,14 +208,28 @@ def fsx_id_validator(param_key, param_value, pcluster_config):
205208
return errors, warnings
206209

207210

208-
def fsx_storage_capacity_validator(param_key, param_value, pcluster_config):
211+
def fsx_storage_capacity_validator(section_key, section_label, pcluster_config):
209212
errors = []
210213
warnings = []
211214

212-
if int(param_value) > 0 and not (
213-
int(param_value) == 1200 or int(param_value) == 2400 or int(param_value) % 3600 == 0
214-
):
215-
errors.append("Capacity for FSx lustre filesystem, 1,200 GB, 2,400 GB or increments of 3,600 GB")
215+
fsx_section = pcluster_config.get_section(section_key, section_label)
216+
storage_capacity = fsx_section.get_param_value("storage_capacity")
217+
deployment_type = fsx_section.get_param_value("deployment_type")
218+
219+
if fsx_section.get_param_value("fsx_fs_id"):
220+
# if fsx_fs_id is provided, don't validate storage_capacity
221+
return errors, warnings
222+
elif not storage_capacity:
223+
# if fsx_fs_id is not provided, storage_capacity must be provided
224+
errors.append("When specifying 'fsx' section, the 'storage_capacity' option must be specified")
225+
elif deployment_type == "SCRATCH_1":
226+
if not (storage_capacity == 1200 or storage_capacity == 2400 or storage_capacity % 3600 == 0):
227+
warnings.append("Capacity for FSx SCRATCH_1 filesystem is 1,200 GB, 2,400 GB or increments of 3,600 GB")
228+
elif deployment_type in ["SCRATCH_2", "PERSISTENT_1"]:
229+
if not (storage_capacity == 1200 or storage_capacity % 2400 == 0):
230+
warnings.append(
231+
"Capacity for FSx SCRATCH_2 and PERSISTENT_1 filesystems is 1,200 GB or increments of 2,400 GB"
232+
)
216233

217234
return errors, warnings
218235

cli/pcluster/examples/config

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,21 @@ master_subnet_id = subnet-12345678
260260
# This is used when AWS ParallelCluster creates the security group
261261
# (defaults to 0.0.0.0/0)
262262
#access_from = 0.0.0.0/0
263+
264+
## FSx settings
265+
#[fsx fsx-custom]
266+
# Mount Point for Shared Dir
267+
#shared_dir = /fsx
268+
# Storage Capacity in GiB
269+
#storage_capacity = 1200
270+
# Deployment type allows you to launch filesystems with different characteristics
271+
# Valid options are SCRATCH_1, PERSISTENT_1, SCRATCH_2
272+
#deployment_type = PERSISTENT_1
273+
# When using SCRATCH_2 or PERSISTENT_1 you can set storage throughput to 50,100,200
274+
#per_unit_storage_throughput = 50
275+
# S3 Bucket to hydrate the fs from
276+
#import_path = s3://import-path
277+
# S3 Location to backup too
278+
#export_path = s3://import-path/export-dir
279+
# For SCRATCH_2 and PERSISTENT_1 you can provide a KMS Key for in transit encryption
280+
#fsx_kms_key_id = XXXX-XXXXX-XXX-XXXXX

cli/tests/pcluster/config/defaults.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
"export_path": None,
7777
"import_path": None,
7878
"weekly_maintenance_start_time": None,
79+
"deployment_type": None,
80+
"per_unit_storage_throughput": None,
7981
}
8082

8183
DEFAULT_DCV_DICT = {"enable": None, "port": 8443, "access_from": "0.0.0.0/0"}
@@ -192,7 +194,7 @@ class DefaultDict(Enum):
192194

193195
DEFAULT_RAID_CFN_PARAMS = {"RAIDOptions": "NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE"}
194196

195-
DEFAULT_FSX_CFN_PARAMS = {"FSXOptions": "NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE"}
197+
DEFAULT_FSX_CFN_PARAMS = {"FSXOptions": "NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE"}
196198

197199
DEFAULT_DCV_CFN_PARAMS = {"DCVOptions": "NONE,NONE,NONE"}
198200
DEFAULT_CW_LOG_CFN_PARAMS = {"CWLogOptions": "true,14"}
@@ -261,7 +263,7 @@ class DefaultDict(Enum):
261263
# raid
262264
"RAIDOptions": "NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE",
263265
# fsx
264-
"FSXOptions": "NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE",
266+
"FSXOptions": "NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE",
265267
# dcv
266268
"DCVOptions": "NONE,NONE,NONE",
267269
# cw_log_settings

cli/tests/pcluster/config/test_section_cluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ def test_cluster_section_to_cfn(mocker, section_dict, expected_cfn_params):
11981198
# raid
11991199
"RAIDOptions": "raid,NONE,NONE,gp2,20,100,false,NONE",
12001200
# fsx
1201-
"FSXOptions": "fsx,NONE,NONE,NONE,NONE,NONE,NONE,NONE",
1201+
"FSXOptions": "fsx,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE",
12021202
# dcv
12031203
"DCVOptions": "master,8555,10.0.0.0/0",
12041204
},
@@ -1264,7 +1264,7 @@ def test_cluster_section_to_cfn(mocker, section_dict, expected_cfn_params):
12641264
# raid
12651265
"RAIDOptions": "raid,NONE,NONE,gp2,20,100,false,NONE",
12661266
# fsx
1267-
"FSXOptions": "fsx,NONE,NONE,NONE,NONE,NONE,NONE,NONE",
1267+
"FSXOptions": "fsx,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE",
12681268
# dcv
12691269
"DCVOptions": "master,8555,10.0.0.0/0",
12701270
},

cli/tests/pcluster/config/test_section_fsx.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
[
2121
(DefaultCfnParams["fsx"].value, DefaultDict["fsx"].value),
2222
({}, DefaultDict["fsx"].value),
23-
({"FSXOptions": "NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE"}, DefaultDict["fsx"].value),
24-
({"FSXOptions": "NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE"}, DefaultDict["fsx"].value),
23+
({"FSXOptions": "NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE"}, DefaultDict["fsx"].value),
24+
({"FSXOptions": "NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE"}, DefaultDict["fsx"].value),
2525
(
26-
{"FSXOptions": "test,NONE,NONE,NONE,NONE,NONE,NONE,NONE"},
26+
{"FSXOptions": "test,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE"},
2727
{
2828
"shared_dir": "test",
2929
"fsx_fs_id": None,
@@ -33,10 +33,12 @@
3333
"export_path": None,
3434
"import_path": None,
3535
"weekly_maintenance_start_time": None,
36+
"deployment_type": None,
37+
"per_unit_storage_throughput": None,
3638
},
3739
),
3840
(
39-
{"FSXOptions": "test,test1,10,test2,20,test3,test4,test5"},
41+
{"FSXOptions": "test,test1,10,test2,20,test3,test4,test5,SCRATCH_1,50"},
4042
{
4143
"shared_dir": "test",
4244
"fsx_fs_id": "test1",
@@ -46,6 +48,8 @@
4648
"export_path": "test3",
4749
"import_path": "test4",
4850
"weekly_maintenance_start_time": "test5",
51+
"deployment_type": "SCRATCH_1",
52+
"per_unit_storage_throughput": 50,
4953
},
5054
),
5155
],
@@ -65,6 +69,10 @@ def test_fsx_section_from_cfn(mocker, cfn_params_dict, expected_section_dict):
6569
({"fsx default": {"storage_capacity": "wrong_value"}}, None, "must be an Integer"),
6670
# invalid key
6771
({"fsx default": {"invalid_key": "fake_value"}}, None, "'invalid_key' is not allowed in the .* section"),
72+
# invalid value
73+
({"fsx default": {"deployment_type": "BLAH"}}, None, "'deployment_type' has an invalid value 'BLAH'"),
74+
# invalid value
75+
({"fsx default": {"per_unit_storage_throughput": 1000}}, None, "has an invalid value '1000'"),
6876
],
6977
)
7078
def test_fsx_section_from_file(mocker, config_parser_dict, expected_dict_params, expected_message):
@@ -152,6 +160,19 @@ def test_fsx_section_to_cfn(mocker, section_dict, expected_cfn_params):
152160
("weekly_maintenance_start_time", "10:00", "10:00", "has an invalid value"),
153161
("weekly_maintenance_start_time", "1:10:00", "1:10:00", None),
154162
("weekly_maintenance_start_time", "NONE", "NONE", None),
163+
("deployment_type", "SCRATCH_1", "SCRATCH_1", None),
164+
("deployment_type", "SCRATCH_2", "SCRATCH_2", None),
165+
("deployment_type", "PERSISTENT_1", "PERSISTENT_1", None),
166+
(
167+
"deployment_type",
168+
"INVALID_VALUE",
169+
"INVALID_VALUE",
170+
" 'deployment_type' has an invalid value 'INVALID_VALUE'",
171+
),
172+
("per_unit_storage_throughput", "50", 50, None),
173+
("per_unit_storage_throughput", "100", 100, None),
174+
("per_unit_storage_throughput", "200", 200, None),
175+
("per_unit_storage_throughput", "101", 101, "'per_unit_storage_throughput' has an invalid value '101'"),
155176
],
156177
)
157178
def test_fsx_param_from_file(mocker, param_key, param_value, expected_value, expected_message):
@@ -176,7 +197,7 @@ def test_fsx_param_from_file(mocker, param_key, param_value, expected_value, exp
176197
{
177198
"MasterSubnetId": "subnet-12345678",
178199
"AvailabilityZone": "mocked_avail_zone",
179-
"FSXOptions": "fsx,NONE,NONE,NONE,NONE,NONE,NONE,NONE",
200+
"FSXOptions": "fsx,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE",
180201
},
181202
),
182203
),
@@ -187,7 +208,8 @@ def test_fsx_param_from_file(mocker, param_key, param_value, expected_value, exp
187208
{
188209
"MasterSubnetId": "subnet-12345678",
189210
"AvailabilityZone": "mocked_avail_zone",
190-
"FSXOptions": "fsx,fs-12345678901234567,10,key1,1020,s3://test-export,s3://test-import,10",
211+
"FSXOptions": "fsx,fs-12345678901234567,10,key1,1020,s3://test-export,"
212+
"s3://test-import,10,SCRATCH_1,50",
191213
},
192214
),
193215
),

cli/tests/pcluster/config/test_section_fsx/test_fsx_from_file_to_cfn/pcluster.config.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ imported_file_chunk_size = 1020
3131
export_path = s3://test-export
3232
import_path = s3://test-import
3333
weekly_maintenance_start_time = 10
34+
deployment_type = SCRATCH_1
35+
per_unit_storage_throughput = 50
3436

3537
[fsx test4]
3638
shared_dir = /fsx

0 commit comments

Comments
 (0)