Skip to content

Commit c389847

Browse files
hanwen-clusterhanwen-pcluste
authored andcommitted
[Integ-tests] Make capacity reservation according operating systems
AWS doc: https://docs.aws.amazon.com/parallelcluster/latest/ug/install-v3-install-standalone.html Signed-off-by: Hanwen <hanwenli@amazon.com>
1 parent b3d7d7f commit c389847

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

tests/integration-tests/conftest.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,7 @@ def _odcr_azs(vpc_stack):
12091209
def scaling_odcr_stack(
12101210
request,
12111211
region,
1212+
os,
12121213
cfn_stacks_factory,
12131214
vpc_stack: CfnVpcStack,
12141215
):
@@ -1229,20 +1230,21 @@ def _scaling_odcr_stack(instances_count: int):
12291230
odcr_template.set_description("ODCR stack to test scaling with special cases")
12301231
default_public_az, availability_zone_1, availability_zone_2 = _odcr_azs(vpc_stack).values()
12311232

1233+
instance_platform = "Red Hat Enterprise Linux" if "rhel" in os else "Linux/UNIX"
12321234
first_odcr_instances_count = int(instances_count // 2)
12331235
scaling_odcr_a = ec2.CapacityReservation(
12341236
"integTestsScalingOdcrA",
12351237
AvailabilityZone=default_public_az,
12361238
InstanceCount=first_odcr_instances_count,
1237-
InstancePlatform="Linux/UNIX",
1239+
InstancePlatform=instance_platform,
12381240
InstanceType="c5.large",
12391241
InstanceMatchCriteria="targeted",
12401242
)
12411243
scaling_odcr_b = ec2.CapacityReservation(
12421244
"integTestsScalingOdcrB",
12431245
AvailabilityZone=default_public_az,
12441246
InstanceCount=instances_count - first_odcr_instances_count,
1245-
InstancePlatform="Linux/UNIX",
1247+
InstancePlatform=instance_platform,
12461248
InstanceType="c5.large",
12471249
InstanceMatchCriteria="targeted",
12481250
)
@@ -1302,6 +1304,7 @@ def _scaling_odcr_stack(instances_count: int):
13021304
def odcr_stack(
13031305
request,
13041306
region,
1307+
os,
13051308
placement_group_stack,
13061309
cfn_stacks_factory,
13071310
vpc_stack: CfnVpcStack,
@@ -1314,18 +1317,20 @@ def odcr_stack(
13141317
odcr_template.set_description("ODCR stack to test open, targeted, and PG ODCRs")
13151318
default_public_az, availability_zone_1, availability_zone_2 = _odcr_azs(vpc_stack).values()
13161319

1320+
instance_platform = "Red Hat Enterprise Linux" if "rhel" in os else "Linux/UNIX"
1321+
13171322
open_odcr = ec2.CapacityReservation(
13181323
"integTestsOpenOdcr",
13191324
AvailabilityZone=default_public_az,
13201325
InstanceCount=6,
1321-
InstancePlatform="Linux/UNIX",
1326+
InstancePlatform=instance_platform,
13221327
InstanceType="m5.2xlarge",
13231328
)
13241329
target_odcr = ec2.CapacityReservation(
13251330
"integTestsTargetOdcr",
13261331
AvailabilityZone=default_public_az,
13271332
InstanceCount=6,
1328-
InstancePlatform="Linux/UNIX",
1333+
InstancePlatform=instance_platform,
13291334
InstanceType="r5.xlarge",
13301335
InstanceMatchCriteria="targeted",
13311336
)
@@ -1334,7 +1339,7 @@ def odcr_stack(
13341339
"integTestsPgOdcr",
13351340
AvailabilityZone=default_public_az,
13361341
InstanceCount=3,
1337-
InstancePlatform="Linux/UNIX",
1342+
InstancePlatform=instance_platform,
13381343
InstanceType="m5.xlarge",
13391344
InstanceMatchCriteria="targeted",
13401345
PlacementGroupArn=boto3.resource("ec2").PlacementGroup(pg_name).group_arn,
@@ -1383,15 +1388,15 @@ def odcr_stack(
13831388
"az1Odcr",
13841389
AvailabilityZone=availability_zone_1,
13851390
InstanceCount=2,
1386-
InstancePlatform="Linux/UNIX",
1391+
InstancePlatform=instance_platform,
13871392
InstanceMatchCriteria="targeted",
13881393
InstanceType="c5.xlarge",
13891394
)
13901395
az2_odcr = ec2.CapacityReservation(
13911396
"az2Odcr",
13921397
AvailabilityZone=availability_zone_2,
13931398
InstanceCount=2,
1394-
InstancePlatform="Linux/UNIX",
1399+
InstancePlatform=instance_platform,
13951400
InstanceMatchCriteria="targeted",
13961401
InstanceType="c5.xlarge",
13971402
)

0 commit comments

Comments
 (0)