forked from aws/deep-learning-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
60 lines (59 loc) · 2.52 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
53
54
55
56
57
58
59
60
version: 0.2
#TODO: Move all constatns to environment variables
phases:
install:
runtime-versions:
docker: 18
pre_build:
commands:
- start-dockerd
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
- pip install -r src/requirements.txt
- bash src/setup.sh $FRAMEWORK
- python src/parse_partner_developers.py
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- |
if expr "${CODEBUILD_BUILD_ARN}" : ".*eia" >/dev/null; then
if expr "${CODEBUILD_BUILD_ARN}" : ".*tensorflow-1" >/dev/null; then
python src/main.py --buildspec $FRAMEWORK/buildspec-tf1-eia.yml --framework $FRAMEWORK
else
python src/main.py --buildspec $FRAMEWORK/buildspec-eia.yml --framework $FRAMEWORK
fi
elif expr "${CODEBUILD_BUILD_ARN}" : ".*neuron" >/dev/null; then
if expr "${CODEBUILD_BUILD_ARN}" : ".*tensorflow-1" >/dev/null; then
python src/main.py --buildspec $FRAMEWORK/buildspec-tf1-neuron.yml --framework $FRAMEWORK
else
python src/main.py --buildspec $FRAMEWORK/buildspec-neuron.yml --framework $FRAMEWORK
fi
elif expr "${CODEBUILD_BUILD_ARN}" : ".*graviton" >/dev/null; then
# no TF1 support for Graviton hardware
python src/main.py --buildspec $FRAMEWORK/buildspec-graviton.yml --framework $FRAMEWORK
else
if expr "${CODEBUILD_BUILD_ARN}" : ".*tensorflow-1" >/dev/null; then
python src/main.py --buildspec $FRAMEWORK/buildspec-tf1.yml --framework $FRAMEWORK
else
if expr "${CODEBUILD_BUILD_ARN}" : ".*huggingface.*" >/dev/null; then
# In HuggingFace case FRAMEWORK looks like "huggingface_<framework_name>"
# converting "huggingface_<framework_name>" into huggingface/<framework_name>
# to create a correct path to buildspec files
PATH_TO_BULDSPEC=$(echo "$FRAMEWORK" | tr _ /)
python src/main.py --buildspec $PATH_TO_BULDSPEC/buildspec.yml --framework $FRAMEWORK
else
python src/main.py --buildspec $FRAMEWORK/buildspec.yml --framework $FRAMEWORK
fi
fi
fi
post_build:
commands:
- echo Build step finished on `date`
- echo Starting test jobs
- python src/start_testbuilds.py
artifacts:
files:
- $HOME/test_type_images.json
name: DLC_IMAGES_JSON
discard-paths: yes