Skip to content

Commit 66232ed

Browse files
authored
Add unique time string to integ test (#150)
* Add unique time string to integ test * Update syntax
1 parent 29a16c5 commit 66232ed

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

test/integration_tests/inference/cli/test_cli_custom_fsx_inference.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
custom_list_pods
1515
)
1616
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
17+
from test.integration_tests.utils import get_time_str
1718

1819
# --------- Test Configuration ---------
1920
NAMESPACE = "integration"
@@ -36,7 +37,7 @@ def runner():
3637

3738
@pytest.fixture(scope="module")
3839
def custom_endpoint_name():
39-
return f"custom-cli-integration-fsx"
40+
return "custom-cli-integration-fsx-" + get_time_str()
4041

4142
@pytest.fixture(scope="module")
4243
def sagemaker_client():

test/integration_tests/inference/cli/test_cli_custom_s3_inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import time
2-
import uuid
32
import pytest
43
import boto3
54
import os
@@ -14,6 +13,7 @@
1413
custom_list_pods
1514
)
1615
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
16+
from test.integration_tests.utils import get_time_str
1717

1818
# --------- Test Configuration ---------
1919
NAMESPACE = "integration"
@@ -36,7 +36,7 @@ def runner():
3636

3737
@pytest.fixture(scope="module")
3838
def custom_endpoint_name():
39-
return f"custom-cli-integration-s3"
39+
return "custom-cli-integration-s3-" + get_time_str()
4040

4141
@pytest.fixture(scope="module")
4242
def sagemaker_client():

test/integration_tests/inference/cli/test_cli_jumpstart_inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import time
2-
import uuid
32
import pytest
43
import boto3
54
from click.testing import CliRunner
65
from sagemaker.hyperpod.cli.commands.inference import (
76
js_create, custom_invoke, js_list, js_describe, js_delete, js_get_operator_logs, js_list_pods
87
)
98
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
9+
from test.integration_tests.utils import get_time_str
1010

1111
# --------- Test Configuration ---------
1212
NAMESPACE = "integration"
@@ -21,7 +21,7 @@ def runner():
2121

2222
@pytest.fixture(scope="module")
2323
def js_endpoint_name():
24-
return f"js-cli-integration"
24+
return "js-cli-integration-" + get_time_str()
2525

2626
@pytest.fixture(scope="module")
2727
def sagemaker_client():

test/integration_tests/inference/sdk/test_sdk_custom_fsx_inference.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
import time
2-
import uuid
3-
import json
42
import pytest
53
import boto3
64
import os
75
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
86
from sagemaker.hyperpod.inference.config.hp_endpoint_config import (
97
ModelSourceConfig, FsxStorage, TlsConfig, Worker, ModelVolumeMount,
10-
ModelInvocationPort, Resources, EnvironmentVariables, AutoScalingSpec,
11-
CloudWatchTrigger, Dimensions, Metrics
8+
ModelInvocationPort, Resources, EnvironmentVariables,
129
)
1310
import sagemaker_core.main.code_injection.codec as codec
11+
from test.integration_tests.utils import get_time_str
1412

1513
# --------- Test Configuration ---------
1614
NAMESPACE = "integration"
1715
REGION = "us-east-2"
18-
ENDPOINT_NAME = f"custom-sdk-integration-fsx"
16+
ENDPOINT_NAME = "custom-sdk-integration-fsx-" + get_time_str()
1917

2018
MODEL_NAME = f"test-model-integration-sdk-fsx"
2119
MODEL_LOCATION = "hf-eqa"

test/integration_tests/inference/sdk/test_sdk_custom_s3_inference.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
import time
2-
import uuid
3-
import json
42
import pytest
53
import boto3
64
import os
75
from sagemaker.hyperpod.inference.hp_endpoint import HPEndpoint
86
from sagemaker.hyperpod.inference.config.hp_endpoint_config import (
97
ModelSourceConfig, S3Storage, TlsConfig, Worker, ModelVolumeMount,
10-
ModelInvocationPort, Resources, EnvironmentVariables, AutoScalingSpec,
11-
CloudWatchTrigger, Dimensions, Metrics
8+
ModelInvocationPort, Resources, EnvironmentVariables
129
)
1310
import sagemaker_core.main.code_injection.codec as codec
11+
from test.integration_tests.utils import get_time_str
1412

1513
# --------- Test Configuration ---------
1614
NAMESPACE = "integration"
1715
REGION = "us-east-2"
18-
ENDPOINT_NAME = f"custom-sdk-integration-s3"
16+
ENDPOINT_NAME = "custom-sdk-integration-s3-" + get_time_str()
1917

2018
MODEL_NAME = f"test-model-integration-sdk-s3"
2119
MODEL_LOCATION = "hf-eqa"

test/integration_tests/inference/sdk/test_sdk_jumpstart_inference.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
import time
2-
import uuid
3-
import json
42
import pytest
53
import boto3
6-
74
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
85
from sagemaker.hyperpod.inference.config.hp_jumpstart_endpoint_config import (
9-
Model, Server, SageMakerEndpoint, TlsConfig
6+
Model, Server, SageMakerEndpoint
107
)
118
import sagemaker_core.main.code_injection.codec as codec
9+
from test.integration_tests.utils import get_time_str
1210

1311
# --------- Config ---------
1412
NAMESPACE = "integration"
1513
REGION = "us-east-2"
16-
ENDPOINT_NAME = "js-sdk-integration"
14+
ENDPOINT_NAME = "js-sdk-integration-" + get_time_str()
1715

1816
INSTANCE_TYPE = "ml.g5.4xlarge"
1917
MODEL_ID = "deepseek-llm-r1-distill-qwen-1-5b"

test/integration_tests/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import subprocess
22
import logging
3+
import datetime
34

45
logger = logging.getLogger(__name__)
56

@@ -18,3 +19,7 @@ def execute_command(command):
1819
logger.error(f"Stdout: {e.stdout}")
1920
logger.error(f"Stderr: {e.stderr}")
2021
raise RuntimeError(f"Failed to execute command: {' '.join(command)}. Error: {e}")
22+
23+
def get_time_str():
24+
now = datetime.datetime.now()
25+
return now.strftime("%m%d-%H%M%S")

0 commit comments

Comments
 (0)