Skip to content

Commit a794f7d

Browse files
committed
[Subnet Prioritization] Add SingleAvailabilityZone to fleet_config.json
Signed-off-by: Hanxuan Zhang <[email protected]>
1 parent be4d2c8 commit a794f7d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/pcluster_fleet_config_generator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def generate_fleet_config_file(output_file: str, input_file: str):
9999
queue_capacity_reservation=queue_capacity_reservation,
100100
queue_capacity_type=queue_capacity_type,
101101
queue_subnets=queue_config["Networking"]["SubnetIds"],
102+
queue_single_availability_zone=queue_config["Networking"]["EnableSingleAvailabilityZone"],
102103
)
103104
fleet_config[queue_name][compute_resource_name] = config_for_fleet
104105

@@ -125,6 +126,7 @@ def _generate_compute_resource_fleet_config(
125126
queue_capacity_reservation: str,
126127
queue_capacity_type: str,
127128
queue_subnets: List,
129+
queue_single_availability_zone: bool,
128130
):
129131
"""
130132
Generate compute resource config to add in the fleet-config.json, overriding values from the queue.
@@ -156,7 +158,10 @@ def _generate_compute_resource_fleet_config(
156158
{
157159
"Api": "create-fleet",
158160
"Instances": copy.deepcopy(compute_resource_config["Instances"]),
159-
"Networking": {"SubnetIds": queue_subnets},
161+
"Networking": {
162+
"SubnetIds": queue_subnets,
163+
"SingleAvailabilityZone": queue_single_availability_zone
164+
},
160165
}
161166
)
162167
allocation_strategy = compute_resource_config.get("AllocationStrategy", queue_allocation_strategy)

0 commit comments

Comments
 (0)