-
Notifications
You must be signed in to change notification settings - Fork 123
/
buildspec.yml
47 lines (37 loc) · 1.7 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
version: 0.2
phases:
pre_build:
commands:
- start-dockerd
build:
commands:
# run linters
- TOX_PARALLEL_NO_SPINNER=1
- tox -e flake8,black-check,pylint --parallel all
# run README check
- tox -e twine
# run unit tests
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
tox -v -e py38,py39,py310 -- test/unit
# build toolkit
- python setup.py sdist
# run functional tests
- $(aws ecr get-login --no-include-email --region us-west-2)
- IGNORE_COVERAGE=- tox -v -e py38,py39,py310 -- test/functional
# build dummy container
- cp dist/sagemaker_training-*.tar.gz test/container/dummy/sagemaker_training.tar.gz
- cd test/container
- docker build -t sagemaker-training-toolkit-test:dummy -f dummy/Dockerfile .
- rm dummy/sagemaker_training.tar.gz
# build tensorflow container
- cd ../..
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin 763104351884.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com
- cp dist/sagemaker_training-*.tar.gz test/container/dummy/sagemaker_training.tar.gz
- cd test/container
- docker build -t sagemaker-training-toolkit-test:tensorflow -f tensorflow/Dockerfile .
#- docker tag sagemaker-training-toolkit-test:tensorflow sagemaker-training-toolkit-test:tensorflow$(($(date +%s%N)/1000000)) #append currenttime to the tag name.
- rm dummy/sagemaker_training.tar.gz
- cd ../..
# run local integration tests
- IGNORE_COVERAGE=- tox -v -e py38,py39,py310 -- test/integration/local