Skip to content

Commit

Permalink
Clean up osu decoupling tests
Browse files Browse the repository at this point in the history
Signed-off-by: Judy Ng <njud@amazon.com>
  • Loading branch information
judysng committed Dec 20, 2023
1 parent e90e55d commit 823f895
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,8 @@ def test_ad_integration(
if not is_directory_supported(region, directory_type):
pytest.skip(f"Skipping the test because directory type {directory_type} is not supported in region {region}")

head_node_instance_type = "c5.xlarge"
compute_instance_type_info = {"name": "c5.xlarge", "num_cores": 4}
fsx_supported = is_fsx_supported(region)
config_params = {
"compute_instance_type": compute_instance_type_info.get("name"),
"head_node_instance_type": head_node_instance_type,
"fsx_supported": fsx_supported,
}
directory_stack_name, nlb_stack_name = directory_factory(
Expand Down Expand Up @@ -826,12 +822,6 @@ def test_ad_integration_on_login_nodes(
2. SSH key for AD users is created when the property GenerateSshKeysForUsers is true;
3. AD users can submit workloads;
"""
head_node_instance_type = "c5.xlarge"
compute_instance_type_info = {"name": "c5.xlarge", "num_cores": 4}
config_params = {
"compute_instance_type": compute_instance_type_info.get("name"),
"head_node_instance_type": head_node_instance_type,
}
directory_stack_name, nlb_stack_name = directory_factory(
request.config.getoption("directory_stack_name"),
request.config.getoption("ldaps_nlb_stack_name"),
Expand All @@ -846,16 +836,14 @@ def test_ad_integration_on_login_nodes(
)
nlb_stack_parameters = get_infra_stack_parameters(nlb_stack_name)
ldap_tls_ca_cert = "/opt/parallelcluster/shared_login_nodes/directory_service/certificate.crt"
config_params.update(
get_ad_config_param_vals(
directory_stack_outputs,
nlb_stack_parameters,
password_secret_arn,
ldap_tls_ca_cert,
directory_type,
directory_protocol,
directory_certificate_verification,
)
config_params = get_ad_config_param_vals(
directory_stack_outputs,
nlb_stack_parameters,
password_secret_arn,
ldap_tls_ca_cert,
directory_type,
directory_protocol,
directory_certificate_verification,
)
cluster_config = pcluster_config_reader(**config_params)
cluster = clusters_factory(cluster_config)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Image:
Os: {{ os }}
HeadNode:
InstanceType: {{ head_node_instance_type }}
InstanceType: {{ instance }}
Networking:
SubnetId: {{ public_subnet_id }}
Ssh:
Expand All @@ -15,7 +15,7 @@ Scheduling:
ComputeResources:
- Name: cit
Instances:
- InstanceType: {{ compute_instance_type }}
- InstanceType: {{ instance }}
MinCount: 2
MaxCount: 150
Networking:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Image:
Os: {{ os }}
HeadNode:
InstanceType: {{ head_node_instance_type }}
InstanceType: {{ instance }}
Networking:
SubnetId: {{ public_subnet_id }}
Ssh:
Expand All @@ -15,7 +15,7 @@ Scheduling:
ComputeResources:
- Name: cit
Instances:
- InstanceType: {{ compute_instance_type }}
- InstanceType: {{ instance }}
MinCount: 2
MaxCount: 150
Networking:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Image:
Os: {{ os }}
HeadNode:
InstanceType: {{ head_node_instance_type }}
InstanceType: {{ instance }}
Networking:
SubnetId: {{ public_subnet_id }}
Ssh:
Expand All @@ -15,7 +15,7 @@ Scheduling:
ComputeResources:
- Name: cit
Instances:
- InstanceType: {{ compute_instance_type }}
- InstanceType: {{ instance }}
MinCount: 2
MaxCount: 150
Networking:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LoginNodes:
Ssh:
KeyName: {{ key_name }}
HeadNode:
InstanceType: {{ head_node_instance_type }}
InstanceType: {{ instance }}
Networking:
SubnetId: {{ public_subnet_id }}
Ssh:
Expand All @@ -25,7 +25,7 @@ Scheduling:
ComputeResources:
- Name: cit
Instances:
- InstanceType: {{ compute_instance_type }}
- InstanceType: {{ instance }}
MinCount: 2
MaxCount: 150
Networking:
Expand Down
5 changes: 1 addition & 4 deletions tests/integration-tests/tests/efa/test_efa.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ def test_efa(
Grouped all tests in a single function so that cluster can be reused for all of them.
"""

max_queue_size = 2

if architecture == "x86_64":
head_node_instance = "c5.18xlarge"
else:
head_node_instance = "c6g.16xlarge"

slots_per_instance = fetch_instance_slots(region, instance, multithreading_disabled=True)
cluster_config = pcluster_config_reader(max_queue_size=max_queue_size, head_node_instance=head_node_instance)
cluster_config = pcluster_config_reader(head_node_instance=head_node_instance)
cluster = clusters_factory(cluster_config)
remote_command_executor = RemoteCommandExecutor(cluster)
scheduler_commands = scheduler_commands_factory(remote_command_executor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Scheduling:
Instances:
- InstanceType: {{ instance }}
{% endif %}
MaxCount: {{ max_queue_size }}
MinCount: {{ max_queue_size }}
MaxCount: 2
MinCount: 2
DisableSimultaneousMultithreading: true
Efa:
Enabled: true
Expand Down
22 changes: 11 additions & 11 deletions tests/integration-tests/tests/performance_tests/test_osu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,9 @@
from tests.common.osu_common import run_individual_osu_benchmark
from tests.common.utils import fetch_instance_slots, get_installed_parallelcluster_version, run_system_analyzer

# We collected OSU benchmarks results for c5n.18xlarge only.
OSU_BENCHMARKS_INSTANCES = ["c5n.18xlarge"]


@pytest.mark.usefixtures("serial_execution_by_instance")
def test_osu(
Expand All @@ -37,22 +40,19 @@ def test_osu(
scheduler_commands_factory,
request,
):
# We collected OSU benchmarks results for c5n.18xlarge only.
osu_benchmarks_instances = ["c5n.18xlarge"]

if instance not in osu_benchmarks_instances:
raise Exception(f"OSU benchmarks can't be run on instance {instance}.")

# 32 instances are required to see performance differences in collective OSU benchmarks.
max_queue_size = 32
if instance not in OSU_BENCHMARKS_INSTANCES:
raise Exception(
f"OSU benchmarks can't be run on instance {instance}. "
f"Only these instances are supported: {OSU_BENCHMARKS_INSTANCES}"
)

if architecture == "x86_64":
head_node_instance = "c5.18xlarge"
else:
head_node_instance = "c6g.16xlarge"

slots_per_instance = fetch_instance_slots(region, instance, multithreading_disabled=True)
cluster_config = pcluster_config_reader(max_queue_size=max_queue_size, head_node_instance=head_node_instance)
cluster_config = pcluster_config_reader(head_node_instance=head_node_instance)
cluster = clusters_factory(cluster_config)
remote_command_executor = RemoteCommandExecutor(cluster)
scheduler_commands = scheduler_commands_factory(remote_command_executor)
Expand Down Expand Up @@ -83,7 +83,7 @@ def test_osu(
test_datadir,
os,
instance,
num_instances=max_queue_size,
num_instances=32,
slots_per_instance=slots_per_instance,
partition="efa-enabled",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Scheduling:
Instances:
- InstanceType: {{ instance }}
{% endif %}
MaxCount: {{ max_queue_size }}
MinCount: {{ max_queue_size }}
MaxCount: 32
MinCount: 32
DisableSimultaneousMultithreading: true
Efa:
Enabled: true
Expand Down

0 comments on commit 823f895

Please sign in to comment.