Skip to content

Commit 435e545

Browse files
bhaozbenieric
authored andcommitted
fix: disable integration tests for Inference Component based endpoint for non supported regions (#1414)
1 parent c1ecf58 commit 435e545

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

tests/integ/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,26 @@
182182
"us-west-1",
183183
"us-west-2",
184184
]
185+
186+
INFERENCE_COMPONENT_SUPPORTED_REGIONS = [
187+
"ap-south-1",
188+
"us-west-2",
189+
"ca-central-1",
190+
"us-east-1",
191+
"us-east-2",
192+
"ap-northeast-2",
193+
"eu-west-2",
194+
"ap-southeast-2",
195+
"eu-west-1",
196+
"ap-northeast-1",
197+
"eu-central-1",
198+
"eu-north-1",
199+
"ap-southeast-1",
200+
"sa-east-1",
201+
"me-central-1",
202+
"ap-southeast-3",
203+
]
204+
185205
# Data parallelism need to be tested with p3.16xlarge.
186206
# The instance type is expensive and not supported in all the regions.
187207
# Limiting the test to run in IAD and CMH

tests/integ/sagemaker/jumpstart/model/test_jumpstart_model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def test_non_prepacked_jumpstart_model(setup):
6767
assert response is not None
6868

6969

70+
@pytest.mark.skipif(
71+
tests.integ.test_region() not in tests.integ.INFERENCE_COMPONENT_SUPPORTED_REGIONS,
72+
reason="inference component based endpoint is not supported in certain regions",
73+
)
7074
def test_non_prepacked_jumpstart_model_deployed_on_inference_component_based_endpoint(setup):
7175

7276
model_id = "huggingface-llm-falcon-7b-instruct-bf16" # default g5.2xlarge

tests/integ/test_huggingface.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os
1616

1717
import pytest
18+
import tests.integ
1819

1920
from sagemaker.huggingface import HuggingFace, HuggingFaceProcessor
2021
from sagemaker.huggingface.model import HuggingFaceModel, HuggingFacePredictor
@@ -179,6 +180,10 @@ def test_huggingface_inference(
179180
@pytest.mark.skip(
180181
reason="re-enable when above MODEL_BASED endpoint hugging face inference test enabled",
181182
)
183+
@pytest.mark.skipif(
184+
tests.integ.test_region() not in tests.integ.INFERENCE_COMPONENT_SUPPORTED_REGIONS,
185+
reason="inference component based endpoint is not supported in certain regions",
186+
)
182187
def test_huggingface_inference_inference_component_based_endpoint(
183188
sagemaker_session,
184189
gpu_pytorch_instance_type,

tests/integ/test_inference_component_based_endpoint.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os
1616
import sagemaker.predictor
1717
import sagemaker.utils
18+
import tests.integ
1819
import pytest
1920

2021
from sagemaker import image_uris
@@ -114,6 +115,10 @@ def xgboost_model(sagemaker_session, resources, model_update_to_name):
114115

115116

116117
@pytest.mark.release
118+
@pytest.mark.skipif(
119+
tests.integ.test_region() not in tests.integ.INFERENCE_COMPONENT_SUPPORTED_REGIONS,
120+
reason="inference component based endpoint is not supported in certain regions",
121+
)
117122
def test_deploy_single_model_with_endpoint_name(tfs_model, resources):
118123
endpoint_name = sagemaker.utils.unique_name_from_base("sagemaker-tensorflow-serving")
119124
predictor = tfs_model.deploy(
@@ -141,6 +146,10 @@ def test_deploy_single_model_with_endpoint_name(tfs_model, resources):
141146

142147

143148
@pytest.mark.release
149+
@pytest.mark.skipif(
150+
tests.integ.test_region() not in tests.integ.INFERENCE_COMPONENT_SUPPORTED_REGIONS,
151+
reason="inference component based endpoint is not supported in certain regions",
152+
)
144153
def test_deploy_update_predictor_with_other_model(
145154
tfs_model,
146155
resources,
@@ -198,6 +207,10 @@ def test_deploy_update_predictor_with_other_model(
198207

199208

200209
@pytest.mark.release
210+
@pytest.mark.skipif(
211+
tests.integ.test_region() not in tests.integ.INFERENCE_COMPONENT_SUPPORTED_REGIONS,
212+
reason="inference component based endpoint is not supported in certain regions",
213+
)
201214
def test_deploy_multi_models_without_endpoint_name(tfs_model, resources):
202215
input_data = {"instances": [1.0, 2.0, 5.0]}
203216
expected_result = {"predictions": [3.5, 4.0, 5.5]}

0 commit comments

Comments
 (0)