Skip to content

Commit 18af39c

Browse files
committed
[Test] Make integration test covering multiple NICS use Capacity Reservation Target when running on p4d.24xlarge.
Signed-off-by: Giacomo Marciani <[email protected]>
1 parent e951908 commit 18af39c

File tree

3 files changed

+5
-45
lines changed

3 files changed

+5
-45
lines changed

tests/integration-tests/tests/multiple_nics/test_multiple_nics.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# or in the "LICENSE.txt" file accompanying this file.
1010
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
1111
# See the License for the specific language governing permissions and limitations under the License.
12-
import boto3
1312
import pytest
1413
from assertpy import assert_that
1514
from remote_command_executor import RemoteCommandExecutor
@@ -19,22 +18,12 @@
1918
@pytest.mark.usefixtures("os", "instance", "scheduler")
2019
def test_multiple_nics(
2120
region,
22-
instance,
2321
pcluster_config_reader,
2422
test_datadir,
2523
clusters_factory,
26-
s3_bucket_factory,
2724
scheduler_commands_factory,
2825
):
29-
# Post-install script to use P4d targeted ODCR
30-
bucket_name = ""
31-
if instance == "p4d.24xlarge":
32-
bucket_name = s3_bucket_factory()
33-
bucket = boto3.resource("s3", region_name=region).Bucket(bucket_name)
34-
bucket.upload_file(str(test_datadir / "run_instance_override.sh"), "run_instance_override.sh")
35-
cluster_config = pcluster_config_reader(
36-
bucket_name=bucket_name,
37-
)
26+
cluster_config = pcluster_config_reader()
3827
cluster = clusters_factory(cluster_config)
3928
remote_command_executor = RemoteCommandExecutor(cluster)
4029
scheduler_commands = scheduler_commands_factory(remote_command_executor)

tests/integration-tests/tests/multiple_nics/test_multiple_nics/test_multiple_nics/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
{% if scheduler == "awsbatch" %}AwsBatchQueues:{% else %}SlurmQueues:{% endif %}
@@ -37,6 +25,10 @@ Scheduling:
3725
MinCount: 1
3826
Efa:
3927
Enabled: true
28+
{% if instance == "p4d.24xlarge" %}
29+
CapacityReservationTarget:
30+
CapacityReservationResourceGroupArn: arn:aws:resource-groups:us-east-1:447714826191:group/EC2CRGroup
31+
{% endif %}
4032
{% endif %}
4133
Networking:
4234
SubnetIds:

tests/integration-tests/tests/multiple_nics/test_multiple_nics/test_multiple_nics/run_instance_override.sh

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

0 commit comments

Comments
 (0)