Skip to content

Commit 47fe401

Browse files
committed
Attempt to correct FsxLustre cluster settings
1 parent 3c32361 commit 47fe401

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

hpc_provisioner/src/hpc_provisioner/handlers.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ def pcluster_do_create_handler(event, _context=None):
130130
"""
131131
logger.debug(f"event: {event}, _context: {_context}")
132132
cluster = Cluster.from_dict(event["cluster"])
133-
if not cluster.include_lustre:
134-
for dra in DRAS:
135-
dra["expected"] = False
136-
pcluster_create(cluster, DRAS)
133+
pcluster_create(cluster)
137134

138135

139136
def pcluster_create_request_handler(event, _context=None):

hpc_provisioner/src/hpc_provisioner/pcluster_manager.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def fsx_precreate(cluster: Cluster, filesystems: list) -> bool:
203203
return False
204204

205205

206-
def pcluster_create(cluster: Cluster, filesystems: list):
206+
def pcluster_create(cluster: Cluster):
207207
"""Create a pcluster for a given vlab
208208
209209
Args:
@@ -236,22 +236,22 @@ def pcluster_create(cluster: Cluster, filesystems: list):
236236

237237
populate_config(cluster=cluster, create_users_args=create_users_args)
238238
fsx_client = boto3.client("fsx")
239-
for filesystem in filesystems:
240-
if filesystem.get("expected", True):
241-
fs = get_fsx(
242-
fsx_client=fsx_client,
243-
fs_name=cluster.name,
244-
)
245-
if not fs:
246-
raise RuntimeError(f"Filesystem {filesystem} not created when it should have been")
247-
CONFIG_VALUES["fsx"] = {
248-
"Name": filesystem["name"],
249-
"StorageType": "FsxLustre",
250-
"MountDir": filesystem["mountpoint"],
251-
"FsxLustreSettings": {"FileSystemId": fs["FileSystemId"]},
252-
}
253-
else:
254-
CONFIG_VALUES["fsx"] = {}
239+
if cluster.include_lustre:
240+
fs = get_fsx(
241+
fsx_client=fsx_client,
242+
fs_name=cluster.name,
243+
)
244+
245+
if not fs:
246+
raise RuntimeError(f"Filesystem {cluster.name} not created when it should have been")
247+
CONFIG_VALUES["fsx"] = {
248+
"Name": next(tag for tag in fs["Tags"] if tag["Key"] == "Name")["Value"],
249+
"MountDir": "/obi/data",
250+
"StorageType": "FsxLustre",
251+
"FsxLustreSettings": {"FileSystemId": fs["FileSystemId"]},
252+
}
253+
else:
254+
CONFIG_VALUES["fsx"] = {}
255255

256256
pcluster_config = load_pcluster_config(cluster.dev)
257257
if not cluster.include_lustre:

0 commit comments

Comments
 (0)