version: 0.2 phases: pre_build: commands: - start-dockerd build: commands: # prepare the release (update versions, changelog etc.) - git-release --prepare # run linters - tox -e flake8,twine,pylint # run format verification - tox -e black-check # run unit tests - AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN= AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION= tox -e py37,py38 --parallel all -- test/unit # run functional tests - $(aws ecr get-login --no-include-email --region us-west-2) - IGNORE_COVERAGE=- tox -e py37,py38 -- test/functional # build dummy container - python setup.py sdist - 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 us-west-2 | docker login --username AWS --password-stdin 763104351884.dkr.ecr.us-west-2.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 -e py37,py38 -- test/integration/local # generate the distribution package - python3 setup.py sdist # publish the release to github - git-release --publish artifacts: files: - dist/sagemaker_training*.tar.gz name: ARTIFACT_1 discard-paths: yes