Skip to content

Commit 08e05fe

Browse files
authored
change: add support for me-south-1 region (#1097)
* change: add support for me-south-1 region
1 parent 95c0f53 commit 08e05fe

File tree

9 files changed

+34
-10
lines changed

9 files changed

+34
-10
lines changed

src/sagemaker/amazon/amazon_estimator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ def registry(region_name, algorithm=None):
465465
"eu-north-1": "669576153137",
466466
"eu-west-3": "749696950732",
467467
"sa-east-1": "855470959533",
468+
"me-south-1": "249704162688",
468469
}[region_name]
469470
elif algorithm in ["lda"]:
470471
account_id = {
@@ -505,6 +506,7 @@ def registry(region_name, algorithm=None):
505506
"eu-north-1": "669576153137",
506507
"eu-west-3": "749696950732",
507508
"sa-east-1": "855470959533",
509+
"me-south-1": "249704162688",
508510
}[region_name]
509511
elif algorithm in [
510512
"xgboost",
@@ -534,6 +536,7 @@ def registry(region_name, algorithm=None):
534536
"eu-north-1": "669576153137",
535537
"eu-west-3": "749696950732",
536538
"sa-east-1": "855470959533",
539+
"me-south-1": "249704162688",
537540
}[region_name]
538541
elif algorithm in ["image-classification-neo", "xgboost-neo"]:
539542
account_id = NEO_IMAGE_ACCOUNT[region_name]

src/sagemaker/fw_registry.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@
112112
"scikit-learn": "659782779980",
113113
"xgboost": "659782779980",
114114
},
115+
"me-south-1": {
116+
"sparkml-serving": "801668240914",
117+
"scikit-learn": "801668240914",
118+
"xgboost": "801668240914",
119+
},
115120
}
116121

117122

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 = {

src/sagemaker/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
"rk3288",
4141
"rk3399",
4242
"sbe_c",
43+
"aisage",
44+
"qcs603",
45+
"qcs605",
4346
]
4447
)
4548
NEO_ALLOWED_FRAMEWORKS = set(["mxnet", "tensorflow", "pytorch", "onnx", "xgboost"])
@@ -62,6 +65,7 @@
6265
"ap-south-1": "763008648453",
6366
"sa-east-1": "756306329178",
6467
"ca-central-1": "464438896020",
68+
"me-south-1": "836785723513",
6569
}
6670

6771

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",

tests/unit/test_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ def test_check_neo_region(sagemaker_session, tmpdir):
568568
"ap-southeast-2",
569569
"sa-east-1",
570570
"ca-central-1",
571+
"me-south-1",
571572
]
572573
for region_name in ec2_region_list:
573574
if region_name in neo_support_region:

0 commit comments

Comments
 (0)