Skip to content

Commit 20c2def

Browse files
authored
update with aws:master
update with aws:master
2 parents bb12ba4 + 04a2e75 commit 20c2def

29 files changed

+1564
-107
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
*Description of changes:*
44

5+
*Testing done:*
6+
57
## Merge Checklist
68

79
_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request._
810

911
- [ ] I have read the [CONTRIBUTING](https://github.com/aws/sagemaker-python-sdk/blob/master/CONTRIBUTING.md) doc
1012
- [ ] I used the commit message format described in [CONTRIBUTING](https://github.com/aws/sagemaker-python-sdk/blob/master/CONTRIBUTING.md#committing-your-change)
13+
- [ ] I have used the regional endpoint when creating S3 and/or STS clients (if appropriate)
1114
- [ ] I have added tests that prove my fix is effective or that my feature works (if appropriate)
12-
- [ ] I have updated any necessary [documentation](https://github.com/aws/sagemaker-python-sdk/blob/master/README.rst) (if appropriate)
15+
- [ ] I have checked that my tests are not configured for a specific region or account (if appropriate)
16+
- [ ] I have updated any necessary documentation, including [READMEs](https://github.com/aws/sagemaker-python-sdk/blob/master/README.rst) and [API docs](https://github.com/aws/sagemaker-python-sdk/tree/master/doc) (if appropriate)
1317

1418
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

CHANGELOG.md

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

3+
## v1.46.0 (2019-12-12)
4+
5+
### Features
6+
7+
* support Multi-Model endpoints
8+
9+
### Bug fixes and other changes
10+
11+
* update PR template with items about tests, regional endpoints, and API docs
12+
13+
## v1.45.2 (2019-12-10)
14+
15+
### Bug fixes and other changes
16+
17+
* modify schedule cleanup to abide by latest validations
18+
* lower log level when getting execution role from a SageMaker Notebook
19+
* Fix "ValueError: too many values to unpack (expected 2)" is occurred in windows local mode
20+
* allow ModelMonitor and Processor to take IAM role names (in addition to ARNs)
21+
22+
### Documentation changes
23+
24+
* mention that the entry_point needs to be named inference.py for tfs
25+
326
## v1.45.1 (2019-12-06)
427

528
### Bug fixes and other changes

VERSION

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

buildspec.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
version: 0.2
22

33
phases:
4+
pre_build:
5+
commands:
6+
- start-dockerd
7+
48
build:
59
commands:
610
- IGNORE_COVERAGE=-

doc/using_tf.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,8 @@ JSON options instead.
723723
Create Python Scripts for Custom Input and Output Formats
724724
---------------------------------------------------------
725725
726-
You can add your customized Python code to process your input and output data:
726+
You can add your customized Python code to process your input and output data.
727+
This customized Python code must be named ``inference.py`` and specified through the ``entry_point`` parameter:
727728
728729
.. code::
729730
@@ -736,8 +737,9 @@ You can add your customized Python code to process your input and output data:
736737
How to implement the pre- and/or post-processing handler(s)
737738
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
738739
739-
Your entry point file should implement either a pair of ``input_handler``
740-
and ``output_handler`` functions or a single ``handler`` function.
740+
Your entry point file must be named ``inference.py`` and should implement
741+
either a pair of ``input_handler`` and ``output_handler`` functions or
742+
a single ``handler`` function.
741743
Note that if ``handler`` function is implemented, ``input_handler``
742744
and ``output_handler`` are ignored.
743745
@@ -905,6 +907,7 @@ processing. There are 2 ways to do this:
905907
model_data='s3://mybucket/model.tar.gz',
906908
role='MySageMakerRole')
907909
910+
For more information, see: https://github.com/aws/sagemaker-tensorflow-serving-container#prepost-processing
908911
909912
*************************************
910913
sagemaker.tensorflow.TensorFlow Class

src/sagemaker/automl/automl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
"""A class for SageMaker AutoML Job."""
13+
"""A class for SageMaker AutoML Jobs."""
1414
from __future__ import absolute_import
1515

1616
from six import string_types

src/sagemaker/local/image.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
DOCKER_COMPOSE_HTTP_TIMEOUT_ENV = "COMPOSE_HTTP_TIMEOUT"
4444
DOCKER_COMPOSE_HTTP_TIMEOUT = "120"
4545

46-
4746
# Environment variables to be set during training
4847
REGION_ENV_NAME = "AWS_REGION"
4948
TRAINING_JOB_NAME_ENV_NAME = "TRAINING_JOB_NAME"
@@ -256,7 +255,11 @@ def retrieve_artifacts(self, compose_data, output_data_config, job_name):
256255
for host in self.hosts:
257256
volumes = compose_data["services"][str(host)]["volumes"]
258257
for volume in volumes:
259-
host_dir, container_dir = volume.split(":")
258+
if re.search(r"^[A-Za-z]:", volume):
259+
unit, host_dir, container_dir = volume.split(":")
260+
host_dir = unit + ":" + host_dir
261+
else:
262+
host_dir, container_dir = volume.split(":")
260263
if container_dir == "/opt/ml/model":
261264
sagemaker.local.utils.recursive_copy(host_dir, model_artifacts)
262265
elif container_dir == "/opt/ml/output":
@@ -639,9 +642,7 @@ def __init__(self, host_dir, container_dir=None, channel=None):
639642
if container_dir and channel:
640643
raise ValueError("container_dir and channel cannot be declared together.")
641644

642-
self.container_dir = (
643-
container_dir if container_dir else os.path.join("/opt/ml/input/data", channel)
644-
)
645+
self.container_dir = container_dir if container_dir else "/opt/ml/input/data/" + channel
645646
self.host_dir = host_dir
646647
if platform.system() == "Darwin" and host_dir.startswith("/var"):
647648
self.host_dir = os.path.join("/private", host_dir)

src/sagemaker/model_monitor/model_monitoring.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,17 @@
2222
import logging
2323
import uuid
2424

25-
from six.moves.urllib.parse import urlparse
2625
from six import string_types
27-
26+
from six.moves.urllib.parse import urlparse
2827
from botocore.exceptions import ClientError
2928

29+
from sagemaker.exceptions import UnexpectedStatusException
30+
from sagemaker.model_monitor.monitoring_files import Constraints, ConstraintViolations, Statistics
3031
from sagemaker.network import NetworkConfig
32+
from sagemaker.processing import Processor, ProcessingInput, ProcessingJob, ProcessingOutput
3133
from sagemaker.s3 import S3Uploader
32-
33-
from sagemaker.utils import name_from_base
3434
from sagemaker.session import Session
35-
from sagemaker.processing import Processor
36-
from sagemaker.processing import ProcessingJob
37-
from sagemaker.processing import ProcessingInput
38-
from sagemaker.processing import ProcessingOutput
39-
from sagemaker.model_monitor.monitoring_files import Constraints, ConstraintViolations
40-
from sagemaker.model_monitor.monitoring_files import Statistics
41-
from sagemaker.exceptions import UnexpectedStatusException
42-
from sagemaker.utils import retries
35+
from sagemaker.utils import name_from_base, retries
4336

4437
_DEFAULT_MONITOR_IMAGE_URI_WITH_PLACEHOLDERS = (
4538
"{}.dkr.ecr.{}.amazonaws.com/sagemaker-model-monitor-analyzer"
@@ -331,7 +324,7 @@ def create_monitoring_schedule(
331324
max_runtime_in_seconds=self.max_runtime_in_seconds,
332325
environment=self.env,
333326
network_config=network_config_dict,
334-
role_arn=self.role,
327+
role_arn=self.sagemaker_session.expand_role(self.role),
335328
tags=self.tags,
336329
)
337330

@@ -390,7 +383,7 @@ def update_monitoring_schedule(
390383
network_config (sagemaker.network.NetworkConfig): A NetworkConfig
391384
object that configures network isolation, encryption of
392385
inter-container traffic, security group IDs, and subnets.
393-
role (str): An AWS IAM role. The Amazon SageMaker jobs use this role.
386+
role (str): An AWS IAM role name or ARN. The Amazon SageMaker jobs use this role.
394387
image_uri (str): The uri of the image to use for the jobs started by
395388
the Monitor.
396389
@@ -478,7 +471,7 @@ def update_monitoring_schedule(
478471
max_runtime_in_seconds=max_runtime_in_seconds,
479472
environment=env,
480473
network_config=network_config_dict,
481-
role_arn=role,
474+
role_arn=self.sagemaker_session.expand_role(self.role),
482475
)
483476

484477
self._wait_for_schedule_changes_to_apply()
@@ -988,7 +981,7 @@ def __init__(
988981
creating Amazon SageMaker Monitoring Schedules to monitor SageMaker endpoints.
989982
990983
Args:
991-
role (str): An AWS IAM role. The Amazon SageMaker jobs use this role.
984+
role (str): An AWS IAM role name or ARN. The Amazon SageMaker jobs use this role.
992985
instance_count (int): The number of instances to run the jobs with.
993986
instance_type (str): Type of EC2 instance to use for the job, for example,
994987
'ml.m5.xlarge'.
@@ -1292,7 +1285,7 @@ def create_monitoring_schedule(
12921285
max_runtime_in_seconds=self.max_runtime_in_seconds,
12931286
environment=normalized_env,
12941287
network_config=network_config_dict,
1295-
role_arn=self.role,
1288+
role_arn=self.sagemaker_session.expand_role(self.role),
12961289
tags=self.tags,
12971290
)
12981291

@@ -1355,7 +1348,7 @@ def update_monitoring_schedule(
13551348
inter-container traffic, security group IDs, and subnets.
13561349
enable_cloudwatch_metrics (bool): Whether to publish cloudwatch metrics as part of
13571350
the baselining or monitoring jobs.
1358-
role (str): An AWS IAM role. The Amazon SageMaker jobs use this role.
1351+
role (str): An AWS IAM role name or ARN. The Amazon SageMaker jobs use this role.
13591352
13601353
"""
13611354
monitoring_inputs = None
@@ -1449,7 +1442,7 @@ def update_monitoring_schedule(
14491442
max_runtime_in_seconds=max_runtime_in_seconds,
14501443
environment=normalized_env,
14511444
network_config=network_config_dict,
1452-
role_arn=role,
1445+
role_arn=self.sagemaker_session.expand_role(self.role),
14531446
)
14541447

14551448
self._wait_for_schedule_changes_to_apply()

0 commit comments

Comments
 (0)