Skip to content

Commit 3a4e37f

Browse files
authored
Merge branch 'master' into PipelineModel
2 parents e7c9a02 + 3816a56 commit 3a4e37f

37 files changed

+632
-80
lines changed

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ CHANGELOG
1414
* doc-fix: move overview content in main README into sphynx project
1515
* bug-fix: pass accelerator_type in ``deploy`` for REST API TFS ``Model``
1616
* feature: ``PipelineModel``: Create a Transformer from a PipelineModel
17+
* doc-fix: move content from tf/README.rst into sphynx project
18+
* doc-fix: Improve new developer experience in README
1719

1820
1.18.3.post1
1921
============

README.rst

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Supported Python Versions
7575
SageMaker Python SDK is tested on:
7676

7777
- Python 2.7
78-
- Python 3.5
78+
- Python 3.6
7979

8080
AWS Permissions
8181
~~~~~~~~~~~~~~~
@@ -97,9 +97,16 @@ Running tests
9797

9898
SageMaker Python SDK has unit tests and integration tests.
9999

100+
You can install the libraries needed to run the tests by running :code:`pip install --upgrade .[test]` or, for Zsh users: :code:`pip install --upgrade .\[test\]`
101+
100102
**Unit tests**
101103

102-
tox is a prerequisite for running unit tests so you need to make sure you have it installed. To run the unit tests:
104+
105+
We run unit tests with tox, which is a program that lets you run unit tests for multiple Python versions, and also make sure the
106+
code fits our style guidelines. We run tox with Python 2.7 and 3.6, so to run unit tests
107+
with the same configuration we do, you'll need to have interpreters for Python 2.7 and Python 3.6 installed.
108+
109+
To run the unit tests with tox, run:
103110

104111
::
105112

@@ -109,23 +116,29 @@ tox is a prerequisite for running unit tests so you need to make sure you have i
109116

110117
To run the integration tests, the following prerequisites must be met
111118

112-
1. Access to an AWS account to run the tests on
113-
2. AWS account credentials available to boto3 clients used in the tests
114-
3. The AWS account has an IAM role named :code:`SageMakerRole`
115-
4. The libraries listed in the ``extras_require`` object in ``setup.py`` for ``test`` are installed.
116-
You can do this by running the following command: :code:`pip install --upgrade .[test]`
119+
1. AWS account credentials are available in the environment for the boto3 client to use.
120+
2. The AWS account has an IAM role named :code:`SageMakerRole` with the AmazonSageMakerFullAccess policy attached.
121+
122+
We recommend selectively running just those integration tests you'd like to run. You can filter by individual test function names with:
123+
124+
::
125+
126+
pytest -k 'test_i_care_about'
127+
117128

118-
You can run integ tests by issuing the following command:
129+
You can also run all of the integration tests by running the following command, which runs them in sequence, which may take a while:
119130

120131
::
121132

122133
pytest tests/integ
123134

124-
You can also filter by individual test function names (usable with any of the previous commands):
135+
136+
You can also run them in parallel:
125137

126138
::
127139

128-
pytest -k 'test_i_care_about'
140+
pytest -n auto tests/integ
141+
129142

130143
Building Sphinx docs
131144
~~~~~~~~~~~~~~~~~~~~

buildspec.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: 0.2
2+
3+
phases:
4+
pre_build:
5+
commands:
6+
- start-dockerd
7+
8+
build:
9+
commands:
10+
# run linters
11+
- tox -e flake8,pylint
12+
13+
# run package and docbuild checks
14+
- tox -e twine
15+
- tox -e sphinx
16+
17+
# run unit tests
18+
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
19+
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
20+
tox -e py27,py36 -- tests/unit
21+
22+
# run notebook test
23+
- |
24+
if has-matching-changes "src/*.py" "setup.py" "setup.cfg"; then
25+
echo "running notebook test"
26+
python setup.py sdist
27+
aws s3 --region us-west-2 cp ./dist/sagemaker-*.tar.gz s3://sagemaker-python-sdk-pr/
28+
aws s3 cp s3://sagemaker-mead-cli/mead-nb-test.tar.gz mead-nb-test.tar.gz
29+
tar -xzf mead-nb-test.tar.gz
30+
git clone --depth 1 https://github.com/awslabs/amazon-sagemaker-examples.git
31+
JAVA_HOME=$(get-java-home)
32+
echo "set JAVA_HOME=$JAVA_HOME"
33+
SAGEMAKER_ROLE_ARN=$(get-sagemaker-role-arn)
34+
echo "set SAGEMAKER_ROLE_ARN=$SAGEMAKER_ROLE_ARN"
35+
./runtime/bin/mead-run-nb-test \
36+
--instance-type ml.c4.8xlarge \
37+
--region us-west-2 \
38+
--lifecycle-config-name install-python-sdk \
39+
--notebook-instance-role-arn $SAGEMAKER_ROLE_ARN \
40+
./amazon-sagemaker-examples/sagemaker-python-sdk/tensorflow_distributed_mnist/tensorflow_batch_transform_mnist.ipynb
41+
else
42+
echo "skipping notebook test"
43+
fi
44+
45+
# run integration tests
46+
- |
47+
if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg"; then
48+
IGNORE_COVERAGE=- tox -e py27,py36 -- -n 24 --boxed tests/integ
49+
else
50+
echo "skipping integration tests"
51+
fi

doc/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ TensorFlow
5050
**********
5151
A managed environment for TensorFlow training and hosting on Amazon SageMaker
5252

53+
.. toctree::
54+
:maxdepth: 1
55+
56+
using_tf
57+
5358
.. toctree::
5459
:maxdepth: 2
5560

0 commit comments

Comments
 (0)