|
1 | 1 | version: 0.2
|
2 | 2 |
|
3 |
| -env: |
4 |
| - variables: |
5 |
| - FRAMEWORK_VERSION: '1.15.0' |
6 |
| - GPU_INSTANCE_TYPE: 'ml.p2.xlarge' |
7 |
| - SETUP_FILE: 'setup_cmds.sh' |
8 |
| - SETUP_CMDS: '#!/bin/bash\npip install --upgrade pip\npip install -U -e .\npip install -U -e .[test]' |
9 |
| - |
10 | 3 | phases:
|
11 |
| - pre_build: |
12 |
| - commands: |
13 |
| - - start-dockerd |
14 |
| - - ACCOUNT=$(aws --region $AWS_DEFAULT_REGION sts --endpoint-url https://sts.$AWS_DEFAULT_REGION.amazonaws.com get-caller-identity --query 'Account' --output text) |
15 |
| - |
16 | 4 | build:
|
17 | 5 | commands:
|
18 | 6 | # prepare the release (update versions, changelog etc.)
|
19 |
| - - git-release --min-version 2.0.0 --prepare |
| 7 | + - git-release --prepare |
20 | 8 |
|
21 |
| - # run linter |
22 |
| - - tox -e flake8 |
| 9 | + # run linters |
| 10 | + - tox -e flake8,twine |
23 | 11 |
|
24 | 12 | # run unit tests
|
25 |
| - - tox -e py36,py27 test/unit |
26 |
| - |
27 |
| - # Create pip archive |
28 |
| - - build_dir="docker/$FRAMEWORK_VERSION" |
29 |
| - - python3 setup.py sdist |
30 |
| - - tar_name=$(ls dist) |
31 |
| - - cp dist/$tar_name $build_dir |
32 |
| - |
33 |
| - # Build all images |
34 |
| - - python3 scripts/build_all.py --account $ACCOUNT --region $AWS_DEFAULT_REGION |
| 13 | + - AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN= |
| 14 | + AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION= |
| 15 | + tox -e py27,py36 -- test/unit |
35 | 16 |
|
36 |
| - # Publish all images |
37 |
| - - python3 scripts/publish_all.py --account $ACCOUNT --region $AWS_DEFAULT_REGION |
| 17 | + # run local integ tests |
| 18 | + #- $(aws ecr get-login --no-include-email --region us-west-2) |
| 19 | + #- IGNORE_COVERAGE=- tox -e py27,py36 -- test/integ/local |
38 | 20 |
|
39 |
| - - base_name="$ACCOUNT.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/sagemaker-tensorflow-scriptmode" |
40 |
| - # run local cpu integ tests |
41 |
| - - $(aws ecr get-login --registry-ids $ACCOUNT --no-include-email --region $AWS_DEFAULT_REGION) |
42 |
| - - IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --docker-base-name $base_name --framework-version $FRAMEWORK_VERSION --processor cpu |
43 |
| - - IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --docker-base-name $base_name --py-version 2 --framework-version $FRAMEWORK_VERSION --processor cpu |
| 21 | + # run sagemaker integ tests |
| 22 | + #- IGNORE_COVERAGE=- tox -e py27,py36 -- test/integ/sagemaker |
44 | 23 |
|
45 |
| - # launch remote gpu instance |
46 |
| - - prefix='ml.' |
47 |
| - - instance_type=${GPU_INSTANCE_TYPE#"$prefix"} |
48 |
| - - create-key-pair |
49 |
| - - launch-ec2-instance --instance-type $instance_type --ami-name dlami-ubuntu |
50 |
| - - printf "$SETUP_CMDS" > $SETUP_FILE |
51 |
| - |
52 |
| - - py2_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --docker-base-name $base_name --py-version 2 --framework-version $FRAMEWORK_VERSION --processor gpu" |
53 |
| - - remote-test --github-repo sagemaker-tensorflow-container --setup-file $SETUP_FILE --branch script-mode --test-cmd "$py2_cmd" |
54 |
| - - py3_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --docker-base-name $base_name --framework-version $FRAMEWORK_VERSION --processor gpu" |
55 |
| - - remote-test --github-repo sagemaker-tensorflow-container --branch script-mode --test-cmd "$py3_cmd" --skip-setup |
56 |
| - |
57 |
| - - IGNORE_COVERAGE=- tox -e py36 -- test/integration/sagemaker -n 24 --region $AWS_DEFAULT_REGION --account-id 142577830533 --docker-base-name sagemaker-tensorflow-scriptmode --framework-version $FRAMEWORK_VERSION --processor cpu,gpu --py-version 2,3 |
58 |
| - |
59 |
| - - | |
60 |
| - echo '[{ |
61 |
| - "repository": "sagemaker-tensorflow-scriptmode", |
62 |
| - "tags": [{ |
63 |
| - "source": "1.15.0-cpu-py2", |
64 |
| - "dest": ["1.15.0-cpu-py2", "1.15-cpu-py2", "1.15.0-cpu-py2-'${CODEBUILD_BUILD_ID#*:}'"] |
65 |
| - },{ |
66 |
| - "source": "1.15.0-cpu-py3", |
67 |
| - "dest": ["1.15.0-cpu-py3", "1.15-cpu-py3", "1.15.0-cpu-py3-'${CODEBUILD_BUILD_ID#*:}'"] |
68 |
| - },{ |
69 |
| - "source": "1.15.0-gpu-py2", |
70 |
| - "dest": ["1.15.0-gpu-py2", "1.15-gpu-py2", "1.15.0-gpu-py2-'${CODEBUILD_BUILD_ID#*:}'"] |
71 |
| - },{ |
72 |
| - "source": "1.15.0-gpu-py3", |
73 |
| - "dest": ["1.15.0-gpu-py3", "1.15-gpu-py3", "1.15.0-gpu-py3-'${CODEBUILD_BUILD_ID#*:}'"] |
74 |
| - }], |
75 |
| - "test": [ |
76 |
| - "IGNORE_COVERAGE=- tox -e py36 -- -m deploy_test test/integration/sagemaker -n 4 --region {region} --account-id {aws-id} --instance-type {cpu-instance-type} --docker-base-name sagemaker-tensorflow-scriptmode --framework-version 1.15.0 --processor cpu --py-version 2,3", |
77 |
| - "IGNORE_COVERAGE=- tox -e py36 -- -m deploy_test test/integration/sagemaker -n 4 --region {region} --account-id {aws-id} --docker-base-name sagemaker-tensorflow-scriptmode --framework-version 1.15.0 --processor gpu --py-version 2,3" |
78 |
| - ] |
79 |
| - }]' > deployments.json |
| 24 | + # generate the distribution package |
| 25 | + - python3 setup.py sdist |
80 | 26 |
|
81 | 27 | # publish the release to github
|
82 | 28 | - git-release --publish
|
83 | 29 |
|
84 |
| - finally: |
85 |
| - # shut down remote gpu instance |
86 |
| - - cleanup-gpu-instances |
87 |
| - - cleanup-key-pairs |
88 |
| - |
89 | 30 | artifacts:
|
90 | 31 | files:
|
91 |
| - - deployments.json |
| 32 | + - dist/sagemaker_tensorflow_training-*.tar.gz |
92 | 33 | name: ARTIFACT_1
|
| 34 | + discard-paths: yes |
0 commit comments