forked from pytorch/glow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
100 lines (91 loc) · 3.39 KB
/
config.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
version: 2
# NOTE: We only perform the merge in build step and not in test step, because
# all source files will be shared from build to test
merge_with_master: &merge_with_master
name: Merge Onto Master
command: |
if [[ "${CIRCLE_BRANCH}" != "master" ]]; then
git config --global user.email "[email protected]"
git config --global user.name "CircleCI"
git config remote.origin.url "$CIRCLE_REPOSITORY_URL"
git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch --tags --progress "$CIRCLE_REPOSITORY_URL" +refs/heads/master:refs/remotes/origin/master --depth=50 --quiet
export GIT_MERGE_TARGET=`git log -n 1 --pretty=format:"%H" origin/master`
echo "GIT_MERGE_TARGET: " ${GIT_MERGE_TARGET}
export GIT_COMMIT=${CIRCLE_SHA1}
echo "GIT_COMMIT: " ${GIT_COMMIT}
git checkout -f ${GIT_COMMIT}
git reset --hard ${GIT_COMMIT}
git merge --no-edit --no-ff ${GIT_MERGE_TARGET}
fi
update_submodule: &update_submodule
name: Update Submodule
command: |
git submodule sync
git submodule update --recursive --init
linux_default: &linux_default
resource_class: large
machine:
image: default
steps:
- checkout
- run:
<<: *merge_with_master
- run:
<<: *update_submodule
- run:
name: Launch Docker Container
no_output_timeout: "1h"
command: |
set -e
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_FOR_ECR_READ_WRITE}
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY_FOR_ECR_READ_WRITE}
sudo pip install awscli==1.16.35 -qqq
eval $(aws ecr get-login --region us-east-1 --no-include-email)
docker pull ${DOCKER_IMAGE}
sudo pkill -SIGHUP dockerd
WORKDIR=/var/lib/jenkins/workspace
pid=$(docker run -t -d -w $WORKDIR ${DOCKER_IMAGE})
docker cp /home/circleci/project/. "$pid:$WORKDIR"
docker exec -u jenkins ${pid} sudo chown -R jenkins ${WORKDIR}
echo ${pid} > .docker_pid
- run:
name: Build
no_output_timeout: "1h"
command: |
docker exec -e CIRCLE_JOB=${CIRCLE_JOB} -e SCCACHE_BUCKET=${SCCACHE_BUCKET} -e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_FOR_SCCACHE_S3_BUCKET} -e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY_FOR_SCCACHE_S3_BUCKET} -u jenkins $(cat .docker_pid) .circleci/build.sh
- run:
name: Test
no_output_timeout: "1h"
command: |
docker exec -e CIRCLE_JOB=${CIRCLE_JOB} -u jenkins $(cat .docker_pid) .circleci/test.sh
jobs:
DEBUG:
environment:
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/py2-clang6.0-ubuntu16.04:230"
<<: *linux_default
ASAN:
environment:
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/py2-clang6.0-ubuntu16.04:230"
<<: *linux_default
TSAN:
environment:
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/py2-clang6.0-ubuntu16.04:230"
<<: *linux_default
SHARED:
environment:
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/py2-clang6.0-ubuntu16.04:230"
<<: *linux_default
RELEASE_WITH_EXPENSIVE_TESTS:
environment:
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/caffe2/py2-clang6.0-ubuntu16.04:230"
<<: *linux_default
workflows:
version: 2
build:
jobs:
- DEBUG
- ASAN
- TSAN
- SHARED
- RELEASE_WITH_EXPENSIVE_TESTS