Skip to content

Commit 3e2fdb0

Browse files
author
Chuyang Deng
committed
change: add support for me-south-1 region
1 parent 95c0f53 commit 3e2fdb0

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

src/sagemaker/fw_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
VALID_EIA_FRAMEWORKS = ["tensorflow", "tensorflow-serving", "mxnet", "mxnet-serving"]
5858
VALID_ACCOUNTS_BY_REGION = {"us-gov-west-1": "246785580436", "us-iso-east-1": "744548109606"}
5959
ASIMOV_VALID_ACCOUNTS_BY_REGION = {"us-iso-east-1": "886529160074"}
60-
OPT_IN_ACCOUNTS_BY_REGION = {"ap-east-1": "057415533634"}
61-
ASIMOV_OPT_IN_ACCOUNTS_BY_REGION = {"ap-east-1": "871362719292"}
60+
OPT_IN_ACCOUNTS_BY_REGION = {"ap-east-1": "057415533634", "me-south-1": "724002660598"}
61+
ASIMOV_OPT_IN_ACCOUNTS_BY_REGION = {"ap-east-1": "871362719292", "me-south-1": "217643126080"}
6262
DEFAULT_ACCOUNT = "520713654638"
6363

6464
MERGED_FRAMEWORKS_REPO_MAP = {

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232
DEFAULT_REGION = "us-west-2"
3333

34-
NO_M4_REGIONS = ["eu-west-3", "eu-north-1", "ap-east-1", "sa-east-1"]
34+
NO_M4_REGIONS = ["eu-west-3", "eu-north-1", "ap-east-1", "sa-east-1", "me-south-1"]
3535

36-
NO_T2_REGIONS = ["eu-north-1", "ap-east-1"]
36+
NO_T2_REGIONS = ["eu-north-1", "ap-east-1", "me-south-1"]
3737

3838

3939
def pytest_addoption(parser):

tests/integ/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"eu-north-1",
5656
"sa-east-1",
5757
"ap-east-1",
58+
"me-south-1",
5859
]
5960

6061
# EI is currently only supported in the following regions
@@ -68,8 +69,8 @@
6869
"ap-northeast-2",
6970
]
7071

71-
NO_LDA_REGIONS = ["eu-west-3", "eu-north-1", "sa-east-1", "ap-east-1"]
72-
NO_MARKET_PLACE_REGIONS = ["eu-west-3", "eu-north-1", "sa-east-1", "ap-east-1"]
72+
NO_LDA_REGIONS = ["eu-west-3", "eu-north-1", "sa-east-1", "ap-east-1", "me-south-1"]
73+
NO_MARKET_PLACE_REGIONS = ["eu-west-3", "eu-north-1", "sa-east-1", "ap-east-1", "me-south-1"]
7374

7475
EFS_TEST_ENABLED_REGION = []
7576

tests/integ/test_horovod.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ def gpu_instance_type(request):
3535

3636
@pytest.mark.canary_quick
3737
def test_hvd_cpu(sagemaker_session, cpu_instance_type, tmpdir):
38-
__create_and_fit_estimator(sagemaker_session, cpu_instance_type, tmpdir)
38+
_create_and_fit_estimator(sagemaker_session, cpu_instance_type, tmpdir)
3939

4040

4141
@pytest.mark.canary_quick
4242
@pytest.mark.skipif(
43-
integ.test_region() in integ.HOSTING_NO_P2_REGIONS, reason="no ml.p2 instances in this region"
43+
integ.test_region() in integ.TRAINING_NO_P2_REGIONS, reason="no ml.p2 instances in this region"
4444
)
4545
def test_hvd_gpu(sagemaker_session, gpu_instance_type, tmpdir):
46-
__create_and_fit_estimator(sagemaker_session, gpu_instance_type, tmpdir)
46+
_create_and_fit_estimator(sagemaker_session, gpu_instance_type, tmpdir)
4747

4848

4949
@pytest.mark.local_mode
@@ -97,7 +97,7 @@ def extract_files_from_s3(s3_url, tmpdir):
9797
tar_file.extractall(tmpdir)
9898

9999

100-
def __create_and_fit_estimator(sagemaker_session, instance_type, tmpdir):
100+
def _create_and_fit_estimator(sagemaker_session, instance_type, tmpdir):
101101
job_name = sagemaker.utils.unique_name_from_base("tf-horovod")
102102
estimator = TensorFlow(
103103
entry_point=os.path.join(horovod_dir, "hvd_basic.py"),

tests/unit/test_fw_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
MOCK_REGION = "mars-south-3"
3535
MOCK_ACCELERATOR = "eia1.medium"
3636
MOCK_HKG_REGION = "ap-east-1"
37+
MOCK_BAH_REGION = "me-south-1"
3738

3839

3940
@contextmanager
@@ -146,6 +147,15 @@ def test_create_image_uri_hkg():
146147
}
147148

148149

150+
def test_create_image_uri_bah():
151+
image_uri = fw_utils.create_image_uri(
152+
MOCK_BAH_REGION, MOCK_FRAMEWORK, "ml.p3.2xlarge", "1.0rc", "py3"
153+
)
154+
assert {
155+
image_uri == "217643126080.dkr.ecr.me-south-1.amazonaws.com/sagemaker-mlfw:1.0rc-gpu-py3"
156+
}
157+
158+
149159
def test_tf_eia_images():
150160
image_uri = fw_utils.create_image_uri(
151161
"us-west-2",

0 commit comments

Comments
 (0)