@@ -79,6 +79,25 @@ phases:
7979 - build_cmd="docker build --cache-from $PROD_IMAGE:$prod_tag -f $GPU_DOCKERFILE -t $PREPROD_IMAGE:$GPU_TAG_PY3 . "
8080 - execute-command-if-has-matching-changes "$build_cmd" "test/" "docker/*" "buildspec.yml"
8181
82+ # build py37 images
83+
84+ # prepare build context
85+ - build_dir="$root_dir/docker/$FRAMEWORK_VERSION/py37"
86+ - cp $build_artifacts/*.py $build_dir/
87+ - cd $build_dir
88+
89+ # build cpu image
90+ - prod_tag="$FRAMEWORK_VERSION-cpu-py37"
91+ - CPU_TAG_PY37="$prod_tag-$build_id"
92+ - build_cmd="docker build --no-cache -f $CPU_DOCKERFILE -t $PREPROD_IMAGE:$CPU_TAG_PY37 . "
93+ - execute-command-if-has-matching-changes "$build_cmd" "test/" "docker/*" "buildspec.yml"
94+
95+ # build gpu image
96+ - prod_tag="$FRAMEWORK_VERSION-gpu-py37"
97+ - GPU_TAG_PY37="$prod_tag-$build_id"
98+ - build_cmd="docker build --no-cache -f $GPU_DOCKERFILE -t $PREPROD_IMAGE:$GPU_TAG_PY37 . "
99+ - execute-command-if-has-matching-changes "$build_cmd" "test/" "docker/*" "buildspec.yml"
100+
82101 # push images to ecr
83102 - $(aws ecr get-login --registry-ids $ACCOUNT --no-include-email --region $AWS_DEFAULT_REGION)
84103 - push_cmd="docker push $PREPROD_IMAGE:$CPU_TAG_PY2"
@@ -89,6 +108,10 @@ phases:
89108 - execute-command-if-has-matching-changes "$push_cmd" "test/" "docker/*" "buildspec.yml"
90109 - push_cmd="docker push $PREPROD_IMAGE:$GPU_TAG_PY3"
91110 - execute-command-if-has-matching-changes "$push_cmd" "test/" "docker/*" "buildspec.yml"
111+ - push_cmd="docker push $PREPROD_IMAGE:$CPU_TAG_PY37"
112+ - execute-command-if-has-matching-changes "$push_cmd" "test/" "docker/*" "buildspec.yml"
113+ - push_cmd="docker push $PREPROD_IMAGE:$GPU_TAG_PY37"
114+ - execute-command-if-has-matching-changes "$push_cmd" "test/" "docker/*" "buildspec.yml"
92115
93116 # launch remote gpu instance
94117 - instance_type='p2.xlarge'
@@ -98,6 +121,8 @@ phases:
98121 # run cpu integration tests
99122 - py3_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $CPU_TAG_PY3 --framework-version $FRAMEWORK_VERSION --py-version 3 --processor cpu --durations 10"
100123 - execute-command-if-has-matching-changes "$py3_cmd" "test/" "docker/*" "buildspec.yml"
124+ - py37_cmd="IGNORE_COVERAGE=- tox -e py37 -- test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $CPU_TAG_PY37 --framework-version $FRAMEWORK_VERSION --py-version 3 --processor cpu --durations 10"
125+ - execute-command-if-has-matching-changes "$py37_cmd" "test/" "docker/*" "buildspec.yml"
101126 - py2_cmd="IGNORE_COVERAGE=- tox -e py27 -- test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $CPU_TAG_PY2 --framework-version $FRAMEWORK_VERSION --py-version 2 --processor cpu --durations 10"
102127 - execute-command-if-has-matching-changes "$py2_cmd" "test/" "docker/*" "buildspec.yml"
103128
@@ -111,11 +136,19 @@ phases:
111136 - py2_cmd="remote-test --github-repo $GITHUB_REPO --test-cmd \"$cmd\" --setup-file $SETUP_FILE --pr-number \"$PR_NUM\" --skip-setup"
112137 - execute-command-if-has-matching-changes "$py2_cmd" "test/" "docker/*" "buildspec.yml"
113138
139+ - cmd="IGNORE_COVERAGE=- tox -e py37 -- test/integration/local -n 4 --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $GPU_TAG_PY37 --framework-version $FRAMEWORK_VERSION --py-version 3 --processor gpu --durations 10"
140+ - py37_cmd="remote-test --github-repo $GITHUB_REPO --test-cmd \"$cmd\" --setup-file $SETUP_FILE --pr-number \"$PR_NUM\" --skip-setup"
141+ - execute-command-if-has-matching-changes "$py37_cmd" "test/" "docker/*" "buildspec.yml"
142+
114143 # run sagemaker tests
115144 - test_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $CPU_TAG_PY3 --py-version 3 --processor cpu --durations 10"
116145 - execute-command-if-has-matching-changes "$test_cmd" "test/" "docker/*" "buildspec.yml"
117146 - test_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $GPU_TAG_PY3 --py-version 3 --processor gpu --durations 10"
118147 - execute-command-if-has-matching-changes "$test_cmd" "test/" "docker/*" "buildspec.yml"
148+ - test_cmd="IGNORE_COVERAGE=- tox -e py37 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $CPU_TAG_PY37 --py-version 3 --processor cpu --durations 10"
149+ - execute-command-if-has-matching-changes "$test_cmd" "test/" "docker/*" "buildspec.yml"
150+ - test_cmd="IGNORE_COVERAGE=- tox -e py37 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $GPU_TAG_PY37 --py-version 3 --processor gpu --durations 10"
151+ - execute-command-if-has-matching-changes "$test_cmd" "test/" "docker/*" "buildspec.yml"
119152 - test_cmd="IGNORE_COVERAGE=- tox -e py27 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $CPU_TAG_PY2 --py-version 2 --processor cpu --durations 10"
120153 - execute-command-if-has-matching-changes "$test_cmd" "test/" "docker/*" "buildspec.yml"
121154 - test_cmd="IGNORE_COVERAGE=- tox -e py27 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $GPU_TAG_PY2 --py-version 2 --processor gpu --durations 10"
@@ -135,3 +168,7 @@ phases:
135168 - execute-command-if-has-matching-changes "$delete_cmd" "test/" "docker/*" "buildspec.yml"
136169 - delete_cmd="aws ecr batch-delete-image --repository-name $ECR_REPO --region $AWS_DEFAULT_REGION --image-ids imageTag=$GPU_TAG_PY3"
137170 - execute-command-if-has-matching-changes "$delete_cmd" "test/" "docker/*" "buildspec.yml"
171+ - delete_cmd="aws ecr batch-delete-image --repository-name $ECR_REPO --region $AWS_DEFAULT_REGION --image-ids imageTag=$CPU_TAG_PY37"
172+ - execute-command-if-has-matching-changes "$delete_cmd" "test/" "docker/*" "buildspec.yml"
173+ - delete_cmd="aws ecr batch-delete-image --repository-name $ECR_REPO --region $AWS_DEFAULT_REGION --image-ids imageTag=$GPU_TAG_PY37"
174+ - execute-command-if-has-matching-changes "$delete_cmd" "test/" "docker/*" "buildspec.yml"
0 commit comments