Skip to content

Commit 4e3d2c2

Browse files
committed
Add error to point user to slurm resume log
1 parent b4f4702 commit 4e3d2c2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/slurm_plugin/fleet_manager.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ def launch_ec2_instances(self, count, job_id=None):
198198
print_with_count([instance.get("InstanceId", "") for instance in assigned_nodes.get("Instances")]),
199199
)
200200
logger.debug("Launched instances information: %s", assigned_nodes.get("Instances"))
201-
elif len(assigned_nodes.get("Errors")) > 0:
202-
raise assigned_nodes.get("Errors")[0]
201+
elif len(assigned_nodes.get("Error")) == 1:
202+
raise assigned_nodes.get("Error")[0]
203203

204204
return [EC2Instance.from_describe_instance_data(instance_info) for instance_info in assigned_nodes["Instances"]]
205205

@@ -424,7 +424,11 @@ def _launch_instances(self, launch_params):
424424

425425
if not instances and len(err_list) == 1:
426426
raise LaunchInstancesError(err_list[0].get("ErrorCode"), err_list[0].get("ErrorMessage"))
427-
return {"Instances": instances, "Errors": err_list}
427+
428+
if len(err_list) >= 1:
429+
return {"Instances": instances, "Error": "Errors found in CreateFleet request, check the slurm_resume "
430+
"log for the ec2 error code."}
431+
return {"Instances": instances}
428432
except ClientError as e:
429433
logger.error(
430434
"Failed CreateFleet request (%s): %s - %s",

0 commit comments

Comments
 (0)