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