Skip to content

Commit 1a48cb5

Browse files
committed
sync
1 parent ed1604d commit 1a48cb5

File tree

12 files changed

+216
-145
lines changed

12 files changed

+216
-145
lines changed

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## v2.121.2 (2022-12-12)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* Update for Tensorflow Serving 2.11 inference DLCs
8+
* Revert "fix: type hint of PySparkProcessor __init__"
9+
* Skip Bad Transform Test
10+
11+
## v2.121.1 (2022-12-09)
12+
13+
### Bug Fixes and Other Changes
14+
15+
* Pop out ModelPackageName from pipeline definition
16+
* Fix failing jumpstart cache unit tests
17+
318
## v2.121.0 (2022-12-08)
419

520
### Features

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.121.1.dev0
1+
2.121.3.dev0

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def read_requirements(filename):
5555
"protobuf3-to-dict>=0.1.5,<1.0",
5656
"smdebug_rulesconfig==1.0.1",
5757
"importlib-metadata>=1.4.0,<5.0",
58-
"packaging>=20.0",
58+
"packaging==20.9",
5959
"pandas",
6060
"pathos",
6161
"schema",

src/sagemaker/image_uri_config/pytorch-training-compiler.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"us-west-1": "763104351884",
3535
"us-west-2": "763104351884"
3636
},
37-
"repository": "pytorch-training"
37+
"repository": "pytorch-trcomp-training"
3838
}
3939
}
4040
}

src/sagemaker/image_uri_config/tensorflow.json

+42-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@
303303
"2.7": "2.7.0",
304304
"2.8": "2.8.0",
305305
"2.9": "2.9.2",
306-
"2.10": "2.10.0"
306+
"2.10": "2.10.0",
307+
"2.11": "2.11.0"
307308
},
308309
"versions": {
309310
"1.10.0": {
@@ -1611,15 +1612,18 @@
16111612
"ap-northeast-2": "763104351884",
16121613
"ap-northeast-3": "364406365360",
16131614
"ap-south-1": "763104351884",
1615+
"ap-south-2": "772153158452",
16141616
"ap-southeast-1": "763104351884",
16151617
"ap-southeast-2": "763104351884",
16161618
"ap-southeast-3": "907027046896",
16171619
"ca-central-1": "763104351884",
16181620
"cn-north-1": "727897471807",
16191621
"cn-northwest-1": "727897471807",
16201622
"eu-central-1": "763104351884",
1623+
"eu-central-2": "380420809688",
16211624
"eu-north-1": "763104351884",
16221625
"eu-south-1": "692866216735",
1626+
"eu-south-2": "503227376785",
16231627
"eu-west-1": "763104351884",
16241628
"eu-west-2": "763104351884",
16251629
"eu-west-3": "763104351884",
@@ -1642,15 +1646,52 @@
16421646
"ap-northeast-2": "763104351884",
16431647
"ap-northeast-3": "364406365360",
16441648
"ap-south-1": "763104351884",
1649+
"ap-south-2": "772153158452",
1650+
"ap-southeast-1": "763104351884",
1651+
"ap-southeast-2": "763104351884",
1652+
"ap-southeast-3": "907027046896",
1653+
"ca-central-1": "763104351884",
1654+
"cn-north-1": "727897471807",
1655+
"cn-northwest-1": "727897471807",
1656+
"eu-central-1": "763104351884",
1657+
"eu-central-2": "380420809688",
1658+
"eu-north-1": "763104351884",
1659+
"eu-south-1": "692866216735",
1660+
"eu-south-2": "503227376785",
1661+
"eu-west-1": "763104351884",
1662+
"eu-west-2": "763104351884",
1663+
"eu-west-3": "763104351884",
1664+
"me-south-1": "217643126080",
1665+
"sa-east-1": "763104351884",
1666+
"us-east-1": "763104351884",
1667+
"us-east-2": "763104351884",
1668+
"us-gov-west-1": "442386744353",
1669+
"us-iso-east-1": "886529160074",
1670+
"us-west-1": "763104351884",
1671+
"us-west-2": "763104351884"
1672+
},
1673+
"repository": "tensorflow-inference"
1674+
},
1675+
"2.11.0": {
1676+
"registries": {
1677+
"af-south-1": "626614931356",
1678+
"ap-east-1": "871362719292",
1679+
"ap-northeast-1": "763104351884",
1680+
"ap-northeast-2": "763104351884",
1681+
"ap-northeast-3": "364406365360",
1682+
"ap-south-1": "763104351884",
1683+
"ap-south-2": "772153158452",
16451684
"ap-southeast-1": "763104351884",
16461685
"ap-southeast-2": "763104351884",
16471686
"ap-southeast-3": "907027046896",
16481687
"ca-central-1": "763104351884",
16491688
"cn-north-1": "727897471807",
16501689
"cn-northwest-1": "727897471807",
16511690
"eu-central-1": "763104351884",
1691+
"eu-central-2": "380420809688",
16521692
"eu-north-1": "763104351884",
16531693
"eu-south-1": "692866216735",
1694+
"eu-south-2": "503227376785",
16541695
"eu-west-1": "763104351884",
16551696
"eu-west-2": "763104351884",
16561697
"eu-west-3": "763104351884",

src/sagemaker/jumpstart/cache.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import boto3
2121
import botocore
2222
from packaging.version import Version
23-
from packaging.specifiers import SpecifierSet
23+
from packaging.specifiers import SpecifierSet, InvalidSpecifier
2424
from sagemaker.jumpstart.constants import (
2525
ENV_VARIABLE_JUMPSTART_MANIFEST_LOCAL_ROOT_DIR_OVERRIDE,
2626
ENV_VARIABLE_JUMPSTART_SPECS_LOCAL_ROOT_DIR_OVERRIDE,
@@ -371,7 +371,10 @@ def _select_version(
371371
return None
372372
return str(max(available_versions))
373373

374-
spec = SpecifierSet(f"=={semantic_version_str}")
374+
try:
375+
spec = SpecifierSet(f"=={semantic_version_str}")
376+
except InvalidSpecifier:
377+
raise KeyError(f"Bad semantic version: {semantic_version_str}")
375378
available_versions_filtered = list(spec.filter(available_versions))
376379
return (
377380
str(max(available_versions_filtered)) if available_versions_filtered != [] else None

src/sagemaker/workflow/_utils.py

+12
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"""Scrapper utilities to support repacking of models."""
1414
from __future__ import absolute_import
1515

16+
import logging
1617
import os
1718
import shutil
1819
import tarfile
@@ -37,6 +38,8 @@
3738
if TYPE_CHECKING:
3839
from sagemaker.workflow.step_collections import StepCollection
3940

41+
logger = logging.getLogger(__name__)
42+
4043
FRAMEWORK_VERSION = "0.23-1"
4144
INSTANCE_TYPE = "ml.m5.large"
4245
REPACK_SCRIPT = "_repack_model.py"
@@ -479,10 +482,19 @@ def arguments(self) -> RequestType:
479482

480483
request_dict = get_create_model_package_request(**model_package_args)
481484
# these are not available in the workflow service and will cause rejection
485+
warn_msg_template = (
486+
"Popping out '%s' from the pipeline definition "
487+
"since it will be overridden in pipeline execution time."
488+
)
482489
if "CertifyForMarketplace" in request_dict:
483490
request_dict.pop("CertifyForMarketplace")
491+
logger.warning(warn_msg_template, "CertifyForMarketplace")
484492
if "Description" in request_dict:
485493
request_dict.pop("Description")
494+
logger.warning(warn_msg_template, "Description")
495+
if "ModelPackageName" in request_dict:
496+
request_dict.pop("ModelPackageName")
497+
logger.warning(warn_msg_template, "ModelPackageName")
486498

487499
return request_dict
488500

tests/integ/sagemaker/workflow/test_model_steps.py

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def test_pytorch_training_model_registration_and_creation_without_custom_inferen
112112
inference_instances=["ml.m5.xlarge"],
113113
transform_instances=["ml.m5.xlarge"],
114114
description="test-description",
115+
model_package_name="model-pkg-name-will-be-popped-out",
115116
)
116117
step_model_regis = ModelStep(
117118
name="pytorch-register-model",

tests/integ/test_inference_pipeline.py

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
)
5151

5252

53+
@pytest.mark.skip(reason="Test has likely been failing for a while. Suspected bad XGB model.")
5354
def test_inference_pipeline_batch_transform(sagemaker_session, cpu_instance_type):
5455
sparkml_model_data = sagemaker_session.upload_data(
5556
path=os.path.join(SPARKML_DATA_PATH, "mleap_model.tar.gz"),
+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
from __future__ import absolute_import
14+
15+
from unittest.mock import Mock, PropertyMock
16+
17+
import pytest
18+
19+
from sagemaker import Session
20+
from sagemaker.workflow.pipeline_context import PipelineSession
21+
22+
REGION = "us-west-2"
23+
BUCKET = "my-bucket"
24+
ROLE = "DummyRole"
25+
IMAGE_URI = "fakeimage"
26+
27+
28+
@pytest.fixture(scope="module")
29+
def client():
30+
"""Mock client.
31+
32+
Considerations when appropriate:
33+
34+
* utilize botocore.stub.Stubber
35+
* separate runtime client from client
36+
"""
37+
client_mock = Mock()
38+
client_mock._client_config.user_agent = (
39+
"Boto3/1.14.24 Python/3.8.5 Linux/5.4.0-42-generic Botocore/1.17.24 Resource"
40+
)
41+
return client_mock
42+
43+
44+
@pytest.fixture(scope="module")
45+
def boto_session(client):
46+
role_mock = Mock()
47+
type(role_mock).arn = PropertyMock(return_value=ROLE)
48+
49+
resource_mock = Mock()
50+
resource_mock.Role.return_value = role_mock
51+
52+
session_mock = Mock(region_name=REGION)
53+
session_mock.resource.return_value = resource_mock
54+
session_mock.client.return_value = client
55+
56+
return session_mock
57+
58+
59+
@pytest.fixture(scope="module")
60+
def pipeline_session(boto_session, client):
61+
return PipelineSession(
62+
boto_session=boto_session,
63+
sagemaker_client=client,
64+
default_bucket=BUCKET,
65+
)
66+
67+
68+
@pytest.fixture(scope="module")
69+
def sagemaker_session(boto_session, client):
70+
return Session(
71+
boto_session=boto_session,
72+
sagemaker_client=client,
73+
sagemaker_runtime_client=client,
74+
default_bucket=BUCKET,
75+
)

0 commit comments

Comments
 (0)