Skip to content

Commit 2fe8fe1

Browse files
authored
Merge branch 'master' into master
2 parents 1cae02e + c62ce81 commit 2fe8fe1

File tree

4 files changed

+55
-12
lines changed

4 files changed

+55
-12
lines changed

src/sagemaker/image_uri_config/pytorch.json

+16-11
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
"cpu"
55
],
66
"version_aliases": {
7-
"1.3": "1.3.1"
7+
"1.3": "1.3.1",
8+
"1.5": "1.5.1"
89
},
910
"versions": {
1011
"1.3.1": {
1112
"py_versions": [
1213
"py3"
1314
],
1415
"registries": {
15-
"af-south-1": "626614931356",
16-
"ap-east-1": "871362719292",
1716
"ap-northeast-1": "763104351884",
1817
"ap-northeast-2": "763104351884",
1918
"ap-northeast-3": "364406365360",
@@ -26,16 +25,22 @@
2625
"eu-central-1": "763104351884",
2726
"eu-north-1": "763104351884",
2827
"eu-west-1": "763104351884",
29-
"eu-west-2": "763104351884",
30-
"eu-west-3": "763104351884",
31-
"eu-south-1": "692866216735",
32-
"me-south-1": "217643126080",
33-
"sa-east-1": "763104351884",
3428
"us-east-1": "763104351884",
3529
"us-east-2": "763104351884",
36-
"us-gov-west-1": "442386744353",
37-
"us-iso-east-1": "886529160074",
38-
"us-west-1": "763104351884",
30+
"us-west-2": "763104351884"
31+
},
32+
"repository": "pytorch-inference-eia"
33+
},
34+
"1.5.1": {
35+
"py_versions": [
36+
"py3"
37+
],
38+
"registries": {
39+
"ap-northeast-1": "763104351884",
40+
"ap-northeast-2": "763104351884",
41+
"eu-west-1": "763104351884",
42+
"us-east-1": "763104351884",
43+
"us-east-2": "763104351884",
3944
"us-west-2": "763104351884"
4045
},
4146
"repository": "pytorch-inference-eia"

src/sagemaker/local/local_session.py

+15
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,21 @@ def logs_for_job(self, job_name, wait=False, poll=5, log_type="All"):
571571
# on local mode.
572572
pass # pylint: disable=unnecessary-pass
573573

574+
def logs_for_processing_job(self, job_name, wait=False, poll=10):
575+
"""A no-op method meant to override the sagemaker client.
576+
577+
Args:
578+
job_name:
579+
wait: (Default value = False)
580+
poll: (Default value = 10)
581+
582+
Returns:
583+
584+
"""
585+
# override logs_for_job() as it doesn't need to perform any action
586+
# on local mode.
587+
pass # pylint: disable=unnecessary-pass
588+
574589

575590
class file_input(object):
576591
"""Amazon SageMaker channel configuration for FILE data sources, used in local mode."""

tests/unit/sagemaker/image_uris/test_dlc_frameworks.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
"us-gov-west-1": "246785580436",
4343
"us-iso-east-1": "744548109606",
4444
}
45+
ELASTIC_INFERENCE_REGIONS = [
46+
"ap-northeast-1",
47+
"ap-northeast-2",
48+
"eu-west-1",
49+
"us-east-1",
50+
"us-east-2",
51+
"us-west-2",
52+
]
4553

4654

4755
def _test_image_uris(
@@ -385,8 +393,9 @@ def test_pytorch_eia(pytorch_eia_version, pytorch_eia_py_version):
385393
)
386394
assert expected == uri
387395

388-
for region, account in DLC_ALTERNATE_REGION_ACCOUNTS.items():
396+
for region in ELASTIC_INFERENCE_REGIONS:
389397
uri = image_uris.retrieve(region=region, **base_args)
398+
account = DLC_ALTERNATE_REGION_ACCOUNTS.get(region, DLC_ACCOUNT)
390399

391400
expected = expected_uris.framework_uri(
392401
"pytorch-inference-eia",

tests/unit/test_local_session.py

+14
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,20 @@ def test_describe_transform_job_does_not_exist(LocalSession, _LocalTransformJob)
551551
local_sagemaker_client.describe_transform_job("transform-job-does-not-exist")
552552

553553

554+
@patch("sagemaker.local.image._SageMakerContainer.process")
555+
@patch("sagemaker.local.local_session.LocalSession")
556+
def test_logs_for_job(process, LocalSession):
557+
local_job_logs = LocalSession.logs_for_job("my-processing-job")
558+
assert local_job_logs is not None
559+
560+
561+
@patch("sagemaker.local.image._SageMakerContainer.process")
562+
@patch("sagemaker.local.local_session.LocalSession")
563+
def test_logs_for_processing_job(process, LocalSession):
564+
local_processing_job_logs = LocalSession.logs_for_processing_job("my-processing-job")
565+
assert local_processing_job_logs is not None
566+
567+
554568
@patch("sagemaker.local.local_session.LocalSession")
555569
def test_describe_endpoint_config(LocalSession):
556570
local_sagemaker_client = sagemaker.local.local_session.LocalSagemakerClient()

0 commit comments

Comments
 (0)