Skip to content

Commit 980dea6

Browse files
authored
Merge branch 'master' into algo_kix_region
2 parents 48e20f1 + da77745 commit 980dea6

17 files changed

+377
-23
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## v2.56.0 (2021-08-26)
4+
5+
### Features
6+
7+
* Add NEO KIX Configuration
8+
* Algorithms region launch on KIX
9+
10+
### Bug Fixes and Other Changes
11+
12+
* remove dots from CHANGELOG
13+
314
## v2.55.0 (2021-08-25)
415

516
### Features

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.55.1.dev0
1+
2.56.1.dev0

src/sagemaker/automl/automl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ def deploy(
420420
serializer=serializer,
421421
deserializer=deserializer,
422422
endpoint_name=endpoint_name,
423+
kms_key=model_kms_key,
423424
tags=tags,
424425
wait=wait,
425426
)

src/sagemaker/image_uri_config/clarify.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"ap-east-1": "098760798382",
88
"ap-northeast-1": "377024640650",
99
"ap-northeast-2": "263625296855",
10+
"ap-northeast-3": "912233562940",
1011
"ap-south-1": "452307495513",
1112
"ap-southeast-1": "834264404009",
1213
"ap-southeast-2": "007051062584",

src/sagemaker/image_uri_config/image-classification-neo.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"ap-east-1": "110948597952",
88
"ap-northeast-1": "941853720454",
99
"ap-northeast-2": "151534178276",
10+
"ap-northeast-3": "925152966179",
1011
"ap-south-1": "763008648453",
1112
"ap-southeast-1": "324986816169",
1213
"ap-southeast-2": "355873309152",

src/sagemaker/image_uri_config/inferentia-mxnet.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"ap-east-1": "110948597952",
1010
"ap-northeast-1": "941853720454",
1111
"ap-northeast-2": "151534178276",
12+
"ap-northeast-3": "925152966179",
1213
"ap-south-1": "763008648453",
1314
"ap-southeast-1": "324986816169",
1415
"ap-southeast-2": "355873309152",

src/sagemaker/image_uri_config/inferentia-pytorch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"ap-east-1": "110948597952",
1010
"ap-northeast-1": "941853720454",
1111
"ap-northeast-2": "151534178276",
12+
"ap-northeast-3": "925152966179",
1213
"ap-south-1": "763008648453",
1314
"ap-southeast-1": "324986816169",
1415
"ap-southeast-2": "355873309152",

src/sagemaker/image_uri_config/inferentia-tensorflow.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"ap-east-1": "110948597952",
1010
"ap-northeast-1": "941853720454",
1111
"ap-northeast-2": "151534178276",
12+
"ap-northeast-3": "925152966179",
1213
"ap-south-1": "763008648453",
1314
"ap-southeast-1": "324986816169",
1415
"ap-southeast-2": "355873309152",

src/sagemaker/image_uri_config/neo-mxnet.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"ap-east-1": "110948597952",
2424
"ap-northeast-1": "941853720454",
2525
"ap-northeast-2": "151534178276",
26+
"ap-northeast-3": "925152966179",
2627
"ap-south-1": "763008648453",
2728
"ap-southeast-1": "324986816169",
2829
"ap-southeast-2": "355873309152",

src/sagemaker/image_uri_config/neo-pytorch.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"ap-east-1": "110948597952",
1818
"ap-northeast-1": "941853720454",
1919
"ap-northeast-2": "151534178276",
20+
"ap-northeast-3": "925152966179",
2021
"ap-south-1": "763008648453",
2122
"ap-southeast-1": "324986816169",
2223
"ap-southeast-2": "355873309152",
@@ -46,6 +47,7 @@
4647
"ap-east-1": "110948597952",
4748
"ap-northeast-1": "941853720454",
4849
"ap-northeast-2": "151534178276",
50+
"ap-northeast-3": "925152966179",
4951
"ap-south-1": "763008648453",
5052
"ap-southeast-1": "324986816169",
5153
"ap-southeast-2": "355873309152",
@@ -75,6 +77,7 @@
7577
"ap-east-1": "110948597952",
7678
"ap-northeast-1": "941853720454",
7779
"ap-northeast-2": "151534178276",
80+
"ap-northeast-3": "925152966179",
7881
"ap-south-1": "763008648453",
7982
"ap-southeast-1": "324986816169",
8083
"ap-southeast-2": "355873309152",

src/sagemaker/image_uri_config/neo-tensorflow.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"ap-east-1": "110948597952",
2323
"ap-northeast-1": "941853720454",
2424
"ap-northeast-2": "151534178276",
25+
"ap-northeast-3": "925152966179",
2526
"ap-south-1": "763008648453",
2627
"ap-southeast-1": "324986816169",
2728
"ap-southeast-2": "355873309152",

src/sagemaker/image_uri_config/xgboost-neo.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"ap-east-1": "110948597952",
88
"ap-northeast-1": "941853720454",
99
"ap-northeast-2": "151534178276",
10+
"ap-northeast-3": "925152966179",
1011
"ap-south-1": "763008648453",
1112
"ap-southeast-1": "324986816169",
1213
"ap-southeast-2": "355873309152",

src/sagemaker/workflow/_utils.py

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,10 @@
4242

4343

4444
class _RepackModelStep(TrainingStep):
45-
"""Repacks model artifacts with inference entry point.
45+
"""Repacks model artifacts with custom inference entry points.
4646
47-
Attributes:
48-
name (str): The name of the training step.
49-
step_type (StepTypeEnum): The type of the step with value `StepTypeEnum.Training`.
50-
estimator (EstimatorBase): A `sagemaker.estimator.EstimatorBase` instance.
51-
inputs (TrainingInput): A `sagemaker.inputs.TrainingInput` instance. Defaults to `None`.
47+
The SDK automatically adds this step to pipelines that have RegisterModelSteps with models
48+
that have a custom entry point.
5249
"""
5350

5451
def __init__(
@@ -61,19 +58,77 @@ def __init__(
6158
source_dir: str = None,
6259
dependencies: List = None,
6360
depends_on: Union[List[str], List[Step]] = None,
61+
subnets=None,
62+
security_group_ids=None,
6463
**kwargs,
6564
):
66-
"""Constructs a TrainingStep, given an `EstimatorBase` instance.
67-
68-
In addition to the estimator instance, the other arguments are those that are supplied to
69-
the `fit` method of the `sagemaker.estimator.Estimator`.
65+
"""Base class initializer.
7066
7167
Args:
7268
name (str): The name of the training step.
73-
estimator (EstimatorBase): A `sagemaker.estimator.EstimatorBase` instance.
74-
inputs (TrainingInput): A `sagemaker.inputs.TrainingInput` instance. Defaults to `None`.
69+
sagemaker_session (sagemaker.session.Session): Session object which manages
70+
interactions with Amazon SageMaker APIs and any other AWS services needed. If
71+
not specified, the estimator creates one using the default
72+
AWS configuration chain.
73+
role (str): An AWS IAM role (either name or full ARN). The Amazon
74+
SageMaker training jobs and APIs that create Amazon SageMaker
75+
endpoints use this role to access training data and model
76+
artifacts. After the endpoint is created, the inference code
77+
might use the IAM role, if it needs to access an AWS resource.
78+
model_data (str): The S3 location of a SageMaker model data
79+
``.tar.gz`` file (default: None).
80+
entry_point (str): Path (absolute or relative) to the local Python
81+
source file which should be executed as the entry point to
82+
inference. If ``source_dir`` is specified, then ``entry_point``
83+
must point to a file located at the root of ``source_dir``.
84+
If 'git_config' is provided, 'entry_point' should be
85+
a relative location to the Python source file in the Git repo.
86+
87+
Example:
88+
With the following GitHub repo directory structure:
89+
90+
>>> |----- README.md
91+
>>> |----- src
92+
>>> |----- train.py
93+
>>> |----- test.py
94+
95+
You can assign entry_point='src/train.py'.
96+
source_dir (str): A relative location to a directory with other training
97+
or model hosting source code dependencies aside from the entry point
98+
file in the Git repo (default: None). Structure within this
99+
directory are preserved when training on Amazon SageMaker.
100+
dependencies (list[str]): A list of paths to directories (absolute
101+
or relative) with any additional libraries that will be exported
102+
to the container (default: []). The library folders will be
103+
copied to SageMaker in the same folder where the entrypoint is
104+
copied. If 'git_config' is provided, 'dependencies' should be a
105+
list of relative locations to directories with any additional
106+
libraries needed in the Git repo.
107+
108+
.. admonition:: Example
109+
110+
The following call
111+
112+
>>> Estimator(entry_point='train.py',
113+
... dependencies=['my/libs/common', 'virtual-env'])
114+
115+
results in the following inside the container:
116+
117+
>>> $ ls
118+
119+
>>> opt/ml/code
120+
>>> |------ train.py
121+
>>> |------ common
122+
>>> |------ virtual-env
123+
124+
This is not supported with "local code" in Local Mode.
125+
depends_on (List[str] or List[Step]): A list of step names or instances
126+
this step depends on
127+
subnets (list[str]): List of subnet ids. If not specified, the re-packing
128+
job will be created without VPC config.
129+
security_group_ids (list[str]): List of security group ids. If not
130+
specified, the re-packing job will be created without VPC config.
75131
"""
76-
# yeah, go ahead and save the originals for now
77132
self._model_data = model_data
78133
self.sagemaker_session = sagemaker_session
79134
self.role = role
@@ -101,6 +156,8 @@ def __init__(
101156
"inference_script": self._entry_point_basename,
102157
"model_archive": self._model_archive,
103158
},
159+
subnets=subnets,
160+
security_group_ids=security_group_ids,
104161
**kwargs,
105162
)
106163
repacker.disable_profiler = True

src/sagemaker/workflow/step_collections.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __init__(
6969
compile_model_family=None,
7070
description=None,
7171
tags=None,
72-
model=None,
72+
model: Union[Model, PipelineModel] = None,
7373
**kwargs,
7474
):
7575
"""Construct steps `_RepackModelStep` and `_RegisterModelStep` based on the estimator.
@@ -109,6 +109,16 @@ def __init__(
109109
repack_model = False
110110
self.model_list = None
111111
self.container_def_list = None
112+
subnets = None
113+
security_group_ids = None
114+
115+
if estimator is not None:
116+
subnets = estimator.subnets
117+
security_group_ids = estimator.security_group_ids
118+
elif model is not None and model.vpc_config is not None:
119+
subnets = model.vpc_config["Subnets"]
120+
security_group_ids = model.vpc_config["SecurityGroupIds"]
121+
112122
if "entry_point" in kwargs:
113123
repack_model = True
114124
entry_point = kwargs.pop("entry_point", None)
@@ -125,6 +135,9 @@ def __init__(
125135
entry_point=entry_point,
126136
source_dir=source_dir,
127137
dependencies=dependencies,
138+
tags=tags,
139+
subnets=subnets,
140+
security_group_ids=security_group_ids,
128141
**kwargs,
129142
)
130143
steps.append(repack_model_step)
@@ -163,6 +176,9 @@ def __init__(
163176
entry_point=entry_point,
164177
source_dir=source_dir,
165178
dependencies=dependencies,
179+
tags=tags,
180+
subnets=subnets,
181+
security_group_ids=security_group_ids,
166182
**kwargs,
167183
)
168184
steps.append(repack_model_step)
@@ -283,6 +299,9 @@ def __init__(
283299
entry_point=entry_point,
284300
source_dir=source_dir,
285301
dependencies=dependencies,
302+
tags=tags,
303+
subnets=estimator.subnets,
304+
security_group_ids=estimator.security_group_ids,
286305
)
287306
steps.append(repack_model_step)
288307
model_data = repack_model_step.properties.ModelArtifacts.S3ModelArtifacts

tests/unit/sagemaker/automl/test_auto_ml.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ def test_deploy(sagemaker_session, candidate_mock):
541541
initial_instance_count=INSTANCE_COUNT,
542542
instance_type=INSTANCE_TYPE,
543543
sagemaker_session=sagemaker_session,
544+
model_kms_key=OUTPUT_KMS_KEY,
544545
)
545546
auto_ml.create_model.assert_called_once()
546547
mock_pipeline.deploy.assert_called_once()
@@ -594,6 +595,7 @@ def test_deploy_optional_args(candidate_estimator, sagemaker_session, candidate_
594595
serializer=None,
595596
deserializer=None,
596597
endpoint_name=JOB_NAME,
598+
kms_key=OUTPUT_KMS_KEY,
597599
tags=TAGS,
598600
wait=False,
599601
)

0 commit comments

Comments
 (0)