-
Notifications
You must be signed in to change notification settings - Fork 8
/
buildspec.yml
63 lines (63 loc) · 2.69 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
61
62
63
version: 0.2
run-as: root
env:
variables:
"CONTAINER_REPO": "843407916570.dkr.ecr.ap-southeast-2.amazonaws.com"
"CONTAINER_NAME": "umccrise"
phases:
install:
runtime-versions:
docker: 18
python: 3.7
pre_build:
commands:
- df -h
- apt-get update
- apt-get install -y python3 tree python3-pip git libxt-dev
- pip3 install --no-cache --upgrade pip
- pip3 install --no-cache awscli 'dvc[s3]==1.9.1' 'pathspec==0.9.0'
build:
commands:
# Convenience CODEBUILD VARS, need more? Check https://github.com/thii/aws-codebuild-extras
- export SHORT_COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-10)
- export UMCCRISE_GIT_TAG="$(git describe --tags --exact-match 2>/dev/null)"
- if [ -z $UMCCRISE_GIT_TAG ]; then export UMCCRISE_GIT_TAG='NOTAG'; fi
- export CONTAINER_VERSION=$UMCCRISE_GIT_TAG-$SHORT_COMMIT_HASH
- echo $CONTAINER_VERSION
- aws ecr get-login-password | docker login --username AWS --password-stdin 843407916570.dkr.ecr.ap-southeast-2.amazonaws.com
# Build and tag (-t) image
- docker build -t $CONTAINER_REPO/$CONTAINER_NAME:$CONTAINER_VERSION .
- docker images
- docker system df
- df -h
post_build:
commands:
# Pull Umccrise reference data
#- git clone https://github.com/umccr/reference_data reference_data &&
# cd reference_data &&
# dvc config cache.type reflink,hardlink,copy &&
# dvc version &&
# dvc remote list &&
# dvc pull &&
# cd ..
#- du -sh reference_data/genomes
#- tree -L 1 reference_data/genomes
#- df -h
## Run minimal test with downsized sample data
## Clone sample data repo
#- git clone --depth 1 https://github.com/umccr/umccrise_test_data umccrise_test_data
## Create output directory and set permissions for Docker container user
#- mkdir -p umccrise_test_data/results/dragen_test_project_docker/ &&
# chgrp -R 1000 umccrise_test_data/results/ &&
# chmod -R g+w umccrise_test_data/results/
## DRAGEN test run
#- tree -L 1 umccrise_test_data/data/dragen_test_project
#- docker run -t --cpus 1
# -v=$PWD/umccrise_test_data/results/dragen_test_project_docker:/output_dir
# -v=$PWD/umccrise_test_data/data/dragen_test_project:/dragen_project
# -v=$PWD/reference_data/genomes:/work/genomes
# $CONTAINER_REPO/$CONTAINER_NAME:$CONTAINER_VERSION
# umccrise /dragen_project -o /output_dir --genomes /work/genomes -j1
## Push Docker image to ECR
#- $(aws ecr get-login --no-include-email --region ap-southeast-2)
- docker push $CONTAINER_REPO/$CONTAINER_NAME:$CONTAINER_VERSION