Skip to content

Commit bf5bf24

Browse files
committed
Merge branch 'master' into merge-master
2 parents c233f67 + 0ed415f commit bf5bf24

33 files changed

+257
-118
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Feature request
3-
about: Suggest an improvement for this library
3+
about: Suggest new functionality for this library
44
title: ''
55
labels: ''
66
assignees: ''
77

88
---
99

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
10+
**Describe the feature you'd like**
11+
A clear and concise description of the functionality you want.
1212

13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
13+
**How would this feature be used? Please describe.**
14+
A clear and concise description of the use case for this feature. Please provide an example, if possible.
1515

1616
**Describe alternatives you've considered**
1717
A clear and concise description of any alternative solutions or features you've considered.

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _Put an `x` in the boxes that apply. You can also fill these out after creating
1212

1313
- [ ] I have read the [CONTRIBUTING](https://github.com/aws/sagemaker-python-sdk/blob/master/CONTRIBUTING.md) doc
1414
- [ ] I used the commit message format described in [CONTRIBUTING](https://github.com/aws/sagemaker-python-sdk/blob/master/CONTRIBUTING.md#committing-your-change)
15-
- [ ] I have passed the region in to any/all clients that I've initialized as part of this change.
15+
- [ ] I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
1616
- [ ] 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)
1717

1818
#### Tests

CHANGELOG.md

+60-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,59 @@
11
# Changelog
22

3-
## v2.0.0.rc0
3+
## v1.66.0 (2020-06-25)
4+
5+
### Features
6+
7+
* add 3.8 as supported python version
8+
9+
### Testing and Release Infrastructure
10+
11+
* upgrade airflow to latest stable version
12+
* update feature request issue template
13+
14+
## v1.65.1.post1 (2020-06-24)
15+
16+
### Testing and Release Infrastructure
17+
18+
* add py38 to buildspecs
19+
20+
## v1.65.1.post0 (2020-06-22)
21+
22+
### Documentation Changes
23+
24+
* document that Local Mode + local code doesn't support dependencies arg
25+
26+
### Testing and Release Infrastructure
27+
28+
* upgrade Sphinx to 3.1.1
29+
30+
## v1.65.1 (2020-06-18)
31+
32+
### Bug Fixes and Other Changes
33+
34+
* remove include_package_data=True from setup.py
35+
36+
### Documentation Changes
37+
38+
* add some clarification to Processing docs
39+
40+
### Testing and Release Infrastructure
41+
42+
* specify what kinds of clients in PR template
43+
44+
## v1.65.0 (2020-06-17)
45+
46+
### Features
47+
48+
* support for describing hyperparameter tuning job
49+
50+
### Bug Fixes and Other Changes
51+
52+
* update distributed GPU utilization warning message
53+
* set logs to False if wait is False in AutoML
54+
* workflow passing spot training param to training job
55+
56+
## v2.0.0.rc0 (2020-06-17)
457

558
### Breaking Changes
659

@@ -25,6 +78,12 @@
2578
* remove scipy from dependencies
2679
* remove TF from optional dependencies
2780

81+
## v1.64.1 (2020-06-16)
82+
83+
### Bug Fixes and Other Changes
84+
85+
* include py38 tox env and some dependency upgrades
86+
2887
## v1.64.0 (2020-06-15)
2988

3089
### Features

README.rst

+11-7
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ SageMaker Python SDK is tested on:
9595

9696
- Python 3.6
9797
- Python 3.7
98+
- Python 3.8
9899

99100
AWS Permissions
100101
~~~~~~~~~~~~~~~
@@ -162,23 +163,26 @@ You can also run them in parallel:
162163
Building Sphinx docs
163164
~~~~~~~~~~~~~~~~~~~~
164165

165-
Setup a Python environment with ``sphinx`` and ``sagemaker``:
166+
Setup a Python environment, and install the dependencies listed in ``doc/requirements.txt``:
166167

167168
::
168169

170+
# conda
169171
conda create -n sagemaker python=3.7
170172
conda activate sagemaker
171-
conda install sphinx==2.2.2
172-
pip install sagemaker --user
173+
conda install --file doc/requirements.txt
173174

174-
Install the Read The Docs theme:
175+
# pip
176+
pip install -r doc/requirements.txt
175177

176-
::
177178

178-
pip install sphinx_rtd_theme --user
179+
Clone/fork the repo, and install your local version:
180+
181+
::
179182

183+
pip install --upgrade .
180184

181-
Clone/fork the repo, ``cd`` into the ``sagemaker-python-sdk/doc`` directory and run:
185+
Then ``cd`` into the ``sagemaker-python-sdk/doc`` directory and run:
182186

183187
::
184188

buildspec-localmodetests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ phases:
1111

1212
# local mode tests
1313
- start_time=`date +%s`
14-
- execute-command-if-has-matching-changes "tox -e py37 -- tests/integ -m local_mode --durations 50" "tests/integ" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec-localmodetests.yml"
15-
- ./ci-scripts/displaytime.sh 'py37 local mode' $start_time
14+
- execute-command-if-has-matching-changes "tox -e py38 -- tests/integ -m local_mode --durations 50" "tests/integ" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec-localmodetests.yml"
15+
- ./ci-scripts/displaytime.sh 'py38 local mode' $start_time

buildspec-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ phases:
1818
# run unit tests
1919
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
2020
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
21-
tox -e py36,py37 -- tests/unit
21+
tox -e py36,py37,py38 -- tests/unit
2222

2323
# run a subset of the integration tests
2424
- IGNORE_COVERAGE=- tox -e py36 -- tests/integ -m canary_quick -n 64 --boxed --reruns 2

buildspec-unittests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ phases:
1818
- start_time=`date +%s`
1919
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
2020
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
21-
tox -e py36,py37 --parallel all -- tests/unit
22-
- ./ci-scripts/displaytime.sh 'py36,py37 unit' $start_time
21+
tox -e py36,py37,py38 --parallel all -- tests/unit
22+
- ./ci-scripts/displaytime.sh 'py36,py37,py38 unit' $start_time

buildspec.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ phases:
1111

1212
# run integration tests
1313
- start_time=`date +%s`
14-
- execute-command-if-has-matching-changes "python3.7 -u ci-scripts/queue_build.py" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"
14+
- execute-command-if-has-matching-changes "python3.8 -u ci-scripts/queue_build.py" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"
1515
- ./ci-scripts/displaytime.sh 'build queue' $start_time
1616

1717
- start_time=`date +%s`
1818
- |
19-
execute-command-if-has-matching-changes "env -u AWS_DEFAULT_REGION tox -e py37 -- tests/integ -m \"not local_mode\" -n 512 --reruns 3 --reruns-delay 5 --durations 50 --boto-config '{\"region_name\": \"us-east-2\"}'" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"
20-
- ./ci-scripts/displaytime.sh 'py37 tests/integ' $start_time
19+
execute-command-if-has-matching-changes "env -u AWS_DEFAULT_REGION tox -e py38 -- tests/integ -m \"not local_mode\" -n 512 --reruns 3 --reruns-delay 5 --durations 50 --boto-config '{\"region_name\": \"us-east-2\"}'" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"
20+
- ./ci-scripts/displaytime.sh 'py38 tests/integ' $start_time
2121

2222
post_build:
2323
finally:

doc/amazon_sagemaker_processing.rst

+62-53
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
##############################
1+
###########################
22
Amazon SageMaker Processing
3-
##############################
3+
###########################
44

55

66
Amazon SageMaker Processing allows you to run steps for data pre- or post-processing, feature engineering, data validation, or model evaluation workloads on Amazon SageMaker.
@@ -24,76 +24,85 @@ The fastest way to run get started with Amazon SageMaker Processing is by runnin
2424
You can run notebooks on Amazon SageMaker that demonstrate end-to-end examples of using processing jobs to perform data pre-processing, feature engineering and model evaluation steps. See `Learn More`_ at the bottom of this page for more in-depth information.
2525

2626

27-
Data Pre-Processing and Model Evaluation with Scikit-Learn
28-
==================================================================
27+
Data Pre-Processing and Model Evaluation with scikit-learn
28+
==========================================================
2929

30-
You can run a Scikit-Learn script to do data processing on SageMaker using the `SKLearnProcessor`_ class.
31-
32-
.. _SKLearnProcessor: https://sagemaker.readthedocs.io/en/stable/sagemaker.sklearn.html#sagemaker.sklearn.processing.SKLearnProcessor
30+
You can run a scikit-learn script to do data processing on SageMaker using the :class:`sagemaker.sklearn.processing.SKLearnProcessor` class.
3331

3432
You first create a ``SKLearnProcessor``
3533

3634
.. code:: python
3735
3836
from sagemaker.sklearn.processing import SKLearnProcessor
3937
40-
sklearn_processor = SKLearnProcessor(framework_version='0.20.0',
41-
role='[Your SageMaker-compatible IAM role]',
42-
instance_type='ml.m5.xlarge',
43-
instance_count=1)
38+
sklearn_processor = SKLearnProcessor(
39+
framework_version="0.20.0",
40+
role="[Your SageMaker-compatible IAM role]",
41+
instance_type="ml.m5.xlarge",
42+
instance_count=1,
43+
)
4444
45-
Then you can run a Scikit-Learn script ``preprocessing.py`` in a processing job. In this example, our script takes one input from S3 and one command-line argument, processes the data, then splits the data into two datasets for output. When the job is finished, we can retrive the output from S3.
45+
Then you can run a scikit-learn script ``preprocessing.py`` in a processing job. In this example, our script takes one input from S3 and one command-line argument, processes the data, then splits the data into two datasets for output. When the job is finished, we can retrive the output from S3.
4646

4747
.. code:: python
4848
4949
from sagemaker.processing import ProcessingInput, ProcessingOutput
5050
51-
sklearn_processor.run(code='preprocessing.py',
52-
inputs=[ProcessingInput(
53-
source='s3://your-bucket/path/to/your/data,
54-
destination='/opt/ml/processing/input')],
55-
outputs=[ProcessingOutput(output_name='train_data',
56-
source='/opt/ml/processing/train'),
57-
ProcessingOutput(output_name='test_data',
58-
source='/opt/ml/processing/test')],
59-
arguments=['--train-test-split-ratio', '0.2']
60-
)
51+
sklearn_processor.run(
52+
code="preprocessing.py",
53+
inputs=[
54+
ProcessingInput(source="s3://your-bucket/path/to/your/data", destination="/opt/ml/processing/input"),
55+
],
56+
outputs=[
57+
ProcessingOutput(output_name="train_data", source="/opt/ml/processing/train"),
58+
ProcessingOutput(output_name="test_data", source="/opt/ml/processing/test"),
59+
],
60+
arguments=["--train-test-split-ratio", "0.2"],
61+
)
6162
6263
preprocessing_job_description = sklearn_processor.jobs[-1].describe()
6364
64-
For an in-depth look, please see the `Scikit-Learn Data Processing and Model Evaluation`_ example notebook.
65+
For an in-depth look, please see the `Scikit-learn Data Processing and Model Evaluation`_ example notebook.
6566

66-
.. _Scikit-Learn Data Processing and Model Evaluation: https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker_processing/scikit_learn_data_processing_and_model_evaluation/scikit_learn_data_processing_and_model_evaluation.ipynb
67+
.. _Scikit-learn Data Processing and Model Evaluation: https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker_processing/scikit_learn_data_processing_and_model_evaluation/scikit_learn_data_processing_and_model_evaluation.ipynb
6768

6869

6970
Data Pre-Processing with Spark
7071
==============================
7172

72-
You can use the `ScriptProcessor`_ class to run a script in a processing container, including your own container.
73-
74-
.. _ScriptProcessor: https://sagemaker.readthedocs.io/en/stable/processing.html#sagemaker.processing.ScriptProcessor
73+
You can use the :class:`sagemaker.processing.ScriptProcessor` class to run a script in a processing container, including your own container.
7574

7675
This example shows how you can run a processing job inside of a container that can run a Spark script called ``preprocess.py`` by invoking a command ``/opt/program/submit`` inside the container.
7776

7877
.. code:: python
7978
8079
from sagemaker.processing import ScriptProcessor, ProcessingInput
8180
82-
spark_processor = ScriptProcessor(base_job_name='spark-preprocessor',
83-
image_uri='<ECR repository URI to your Spark processing image>',
84-
command=['/opt/program/submit'],
85-
role=role,
86-
instance_count=2,
87-
instance_type='ml.r5.xlarge',
88-
max_runtime_in_seconds=1200,
89-
env={'mode': 'python'})
90-
91-
spark_processor.run(code='preprocess.py',
92-
arguments=['s3_input_bucket', bucket,
93-
's3_input_key_prefix', input_prefix,
94-
's3_output_bucket', bucket,
95-
's3_output_key_prefix', input_preprocessed_prefix],
96-
logs=False)
81+
spark_processor = ScriptProcessor(
82+
base_job_name="spark-preprocessor",
83+
image_uri="<ECR repository URI to your Spark processing image>",
84+
command=["/opt/program/submit"],
85+
role=role,
86+
instance_count=2,
87+
instance_type="ml.r5.xlarge",
88+
max_runtime_in_seconds=1200,
89+
env={"mode": "python"},
90+
)
91+
92+
spark_processor.run(
93+
code="preprocess.py",
94+
arguments=[
95+
"s3_input_bucket",
96+
bucket,
97+
"s3_input_key_prefix",
98+
input_prefix,
99+
"s3_output_bucket",
100+
bucket,
101+
"s3_output_key_prefix",
102+
input_preprocessed_prefix,
103+
],
104+
logs=False,
105+
)
97106
98107
For an in-depth look, please see the `Feature Transformation with Spark`_ example notebook.
99108

@@ -106,19 +115,19 @@ Learn More
106115
Processing class documentation
107116
------------------------------
108117

109-
- ``Processor``: https://sagemaker.readthedocs.io/en/stable/processing.html#sagemaker.processing.Processor
110-
- ``ScriptProcessor``: https://sagemaker.readthedocs.io/en/stable/processing.html#sagemaker.processing.ScriptProcessor
111-
- ``SKLearnProcessor``: https://sagemaker.readthedocs.io/en/stable/sagemaker.sklearn.html#sagemaker.sklearn.processing.SKLearnProcessor
112-
- ``ProcessingInput``: https://sagemaker.readthedocs.io/en/stable/processing.html#sagemaker.processing.ProcessingInput
113-
- ``ProcessingOutput``: https://sagemaker.readthedocs.io/en/stable/processing.html#sagemaker.processing.ProcessingOutput
114-
- ``ProcessingJob``: https://sagemaker.readthedocs.io/en/stable/processing.html#sagemaker.processing.ProcessingJob
118+
- :class:`sagemaker.processing.Processor`
119+
- :class:`sagemaker.processing.ScriptProcessor`
120+
- :class:`sagemaker.sklearn.processing.SKLearnProcessor`
121+
- :class:`sagemaker.processing.ProcessingInput`
122+
- :class:`sagemaker.processing.ProcessingOutput`
123+
- :class:`sagemaker.processing.ProcessingJob`
115124

116125

117126
Further documentation
118127
---------------------
119128

120-
- Processing class documentation: https://sagemaker.readthedocs.io/en/stable/processing.html
121-
- ​​AWS Documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/processing-job.html
122-
- AWS Notebook examples: https://github.com/awslabs/amazon-sagemaker-examples/tree/master/sagemaker_processing
123-
- Processing API documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateProcessingJob.html
124-
- Processing container specification: https://docs.aws.amazon.com/sagemaker/latest/dg/build-your-own-processing-container.html
129+
- `Processing class documentation <https://sagemaker.readthedocs.io/en/stable/processing.html>`_
130+
- `AWS Documentation <https://docs.aws.amazon.com/sagemaker/latest/dg/processing-job.html>`_
131+
- `AWS Notebook examples <https://github.com/awslabs/amazon-sagemaker-examples/tree/master/sagemaker_processing>`_
132+
- `Processing API documentation <https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateProcessingJob.html>`_
133+
- `Processing container specification <https://docs.aws.amazon.com/sagemaker/latest/dg/build-your-own-processing-container.html>`_

doc/overview.rst

+3
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,9 @@ If you want to keep everything local, and not use Amazon S3 either, you can enab
752752
753753
# pass sagemaker_session to your estimator or model
754754
755+
.. note::
756+
If you enable "local code," then you cannot use the ``dependencies`` parameter in your estimator or model.
757+
755758
We can take the example in `Using Estimators <#using-estimators>`__ , and use either ``local`` or ``local_gpu`` as the instance type.
756759

757760
.. code:: python

doc/requirements.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
sphinx==2.2.2
2-
numpy
3-
requests==2.20
1+
sphinx==3.1.1
2+
sphinx-rtd-theme==0.5.0

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def read_version():
7070
"awslogs",
7171
"black==19.10b0 ; python_version >= '3.6'",
7272
"stopit==1.1.2",
73-
"apache-airflow==1.10.5",
73+
"apache-airflow==1.10.9",
7474
"fabric>=2.0",
7575
"requests>=2.20.0, <3",
7676
],
@@ -96,6 +96,7 @@ def read_version():
9696
"Programming Language :: Python",
9797
"Programming Language :: Python :: 3.6",
9898
"Programming Language :: Python :: 3.7",
99+
"Programming Language :: Python :: 3.8",
99100
],
100101
install_requires=required_packages,
101102
extras_require=extras,
@@ -105,5 +106,4 @@ def read_version():
105106
"sagemaker-upgrade-v2=sagemaker.cli.compatibility.v2.sagemaker_upgrade_v2:main",
106107
]
107108
},
108-
include_package_data=True, # TODO-reinvent-2019 [knakad]: Remove after rule_configs is in PyPI
109109
)

0 commit comments

Comments
 (0)