Skip to content

Commit bb6f133

Browse files
Integ-tests: Change test_efa to use ODCR from cluster configuration file
Signed-off-by: Hanwen <[email protected]>
1 parent 371a15e commit bb6f133

File tree

3 files changed

+5
-46
lines changed

3 files changed

+5
-46
lines changed

tests/integration-tests/tests/efa/test_efa.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import logging
1313
import re
1414

15-
import boto3
1615
from assertpy import assert_that
1716
from remote_command_executor import RemoteCommandExecutor
1817
from utils import get_compute_nodes_instance_ids
@@ -54,19 +53,8 @@ def test_efa(
5453
else:
5554
head_node_instance = "c6g.16xlarge"
5655

57-
# Post-install script to use P4d targeted ODCR
58-
bucket_name = ""
59-
if instance == "p4d.24xlarge":
60-
bucket_name = s3_bucket_factory()
61-
bucket = boto3.resource("s3", region_name=region).Bucket(bucket_name)
62-
bucket.upload_file(str(test_datadir / "run_instance_override.sh"), "run_instance_override.sh")
63-
6456
slots_per_instance = fetch_instance_slots(region, instance, multithreading_disabled=True)
65-
cluster_config = pcluster_config_reader(
66-
max_queue_size=max_queue_size,
67-
head_node_instance=head_node_instance,
68-
bucket_name=bucket_name,
69-
)
57+
cluster_config = pcluster_config_reader(max_queue_size=max_queue_size, head_node_instance=head_node_instance)
7058
cluster = clusters_factory(cluster_config)
7159
remote_command_executor = RemoteCommandExecutor(cluster)
7260
scheduler_commands = scheduler_commands_factory(remote_command_executor)

tests/integration-tests/tests/efa/test_efa/test_efa/pcluster.config.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ HeadNode:
99
KeyName: {{ key_name }}
1010
Imds:
1111
Secured: {{ imds_secured }}
12-
{% if instance == "p4d.24xlarge" %}
13-
Iam:
14-
# Needed to use the p4d capacity reservation
15-
AdditionalIamPolicies:
16-
- Policy: arn:aws:iam::aws:policy/AmazonEC2FullAccess
17-
S3Access:
18-
- BucketName: {{ bucket_name }}
19-
EnableWriteAccess: false
20-
CustomActions:
21-
OnNodeConfigured:
22-
Script: s3://{{ bucket_name }}/run_instance_override.sh
23-
{% endif %}
2412
Scheduling:
2513
Scheduler: {{ scheduler }}
2614
SlurmQueues:
@@ -40,6 +28,10 @@ Scheduling:
4028
Efa:
4129
Enabled: true
4230
{% if instance == "p4d.24xlarge" %}GdrSupport: true{% endif %}
31+
{% if instance == "p4d.24xlarge" %}
32+
CapacityReservationTarget:
33+
CapacityReservationId: cr-0fa65fcdbd597f551
34+
{% endif %}
4335
SharedStorage:
4436
- MountDir: /shared
4537
Name: name1

tests/integration-tests/tests/efa/test_efa/test_efa/run_instance_override.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)