forked from arbor-sim/arbor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
185 lines (167 loc) · 4.78 KB
/
.gitlab-ci.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
include:
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.cscs.yml'
stages:
- build
- allocate
- test
- upload_reports
- cleanup
# Builds a docker image on kubernetes
.build_docker_images:
extends: .dind
stage: build
only: ['master', 'staging', 'trying']
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -f $BUILD_DOCKERFILE --network=host --cache-from $BUILD_IMAGE --build-arg BUILDKIT_INLINE_CACHE=1 -t $BUILD_IMAGE .
- docker push $BUILD_IMAGE
- docker build -f $DEPLOY_DOCKERFILE --network=host --build-arg BUILD_ENV=$BUILD_IMAGE -t $DEPLOY_IMAGE .
- docker push $DEPLOY_IMAGE
build release:
extends: .build_docker_images
variables:
BUILD_DOCKERFILE: ci/release/build.Dockerfile
BUILD_IMAGE: $CI_REGISTRY_IMAGE/release/build:latest
DEPLOY_DOCKERFILE: ci/release/deploy.Dockerfile
DEPLOY_IMAGE: $CI_REGISTRY_IMAGE/release/deploy:$CI_COMMIT_SHA
build codecov:
extends: .build_docker_images
variables:
BUILD_DOCKERFILE: ci/codecov/build.Dockerfile
BUILD_IMAGE: $CI_REGISTRY_IMAGE/codecov/build:latest
DEPLOY_DOCKERFILE: ci/codecov/deploy.Dockerfile
DEPLOY_IMAGE: $CI_REGISTRY_IMAGE/codecov/deploy:$CI_COMMIT_SHA
notify_github_start:
stage: build
allow_failure: true
only: ['master', 'staging', 'trying']
tags: ['kubernetes']
image: stabbles/git-curl
script: ./ci/set_github_status.sh pending
# Some variables used for running on daint
variables:
CRAY_CUDA_MPS: 1
USE_MPI: 'YES'
DISABLE_AFTER_SCRIPT: 'YES'
PULL_IMAGE: 'NO'
SLURM_CONSTRAINT: gpu
SLURM_JOB_NUM_NODES: 2
SLURM_PARTITION: normal
SLURM_TIMELIMIT: '15:00'
SLURM_EXCLUSIVE: '' # make sure resources are not shared
### Release tests ###
allocate release:
stage: allocate
image: $CI_REGISTRY_IMAGE/release/deploy:$CI_COMMIT_SHA
only: ['master', 'staging', 'trying']
extends: .daint_alloc
variables:
PULL_IMAGE: 'YES'
ALLOCATION_NAME: arbor-ci-release-$CI_PIPELINE_ID
single node release:
extends: .daint
image: $CI_REGISTRY_IMAGE/release/deploy:$CI_COMMIT_SHA
only: ['master', 'staging', 'trying']
stage: test
script:
- unit
- unit-local
- unit-modcc
variables:
SLURM_JOB_NUM_NODES: 1
SLURM_NTASKS: 1
ALLOCATION_NAME: arbor-ci-release-$CI_PIPELINE_ID
multi node release:
extends: .daint
image: $CI_REGISTRY_IMAGE/release/deploy:$CI_COMMIT_SHA
only: ['master', 'staging', 'trying']
stage: test
script:
- unit-mpi
variables:
SLURM_JOB_NUM_NODES: 2
SLURM_NTASKS: 2
ALLOCATION_NAME: arbor-ci-release-$CI_PIPELINE_ID
deallocate release:
only: ['master', 'staging', 'trying']
image: $CI_REGISTRY_IMAGE/release/deploy:$CI_COMMIT_SHA
stage: cleanup
extends: .daint_dealloc
variables:
ALLOCATION_NAME: arbor-ci-release-$CI_PIPELINE_ID
### Codecov tests ###
allocate codecov:
stage: allocate
only: ['master', 'staging', 'trying']
image: $CI_REGISTRY_IMAGE/codecov/deploy:$CI_COMMIT_SHA
extends: .daint_alloc
variables:
PULL_IMAGE: 'YES'
ALLOCATION_NAME: arbor-ci-codecov-$CI_PIPELINE_ID
single node codecov:
extends: .daint
only: ['master', 'staging', 'trying']
image: $CI_REGISTRY_IMAGE/codecov/deploy:$CI_COMMIT_SHA
stage: test
script:
- codecov_pre
- unit
- unit-local
- unit-modcc
- codecov_post
variables:
SLURM_JOB_NUM_NODES: 1
SLURM_NTASKS: 1
ALLOCATION_NAME: arbor-ci-codecov-$CI_PIPELINE_ID
artifacts:
paths:
- codecov-reports/
multi node codecov:
extends: .daint
only: ['master', 'staging', 'trying']
image: $CI_REGISTRY_IMAGE/codecov/deploy:$CI_COMMIT_SHA
stage: test
script:
- codecov_pre
- unit-mpi
- codecov_post
variables:
SLURM_JOB_NUM_NODES: 2
SLURM_NTASKS: 2
ALLOCATION_NAME: arbor-ci-codecov-$CI_PIPELINE_ID
artifacts:
paths:
- codecov-reports/
upload codecov reports:
extends: .daint
only: ['master', 'staging', 'trying']
image: $CI_REGISTRY_IMAGE/codecov/deploy:$CI_COMMIT_SHA
stage: upload_reports
variables:
SLURM_JOB_NUM_NODES: 1
SLURM_NTASKS: 1
ALLOCATION_NAME: arbor-ci-codecov-$CI_PIPELINE_ID
script: upload_codecov
deallocate codecov:
only: ['master', 'staging', 'trying']
image: $CI_REGISTRY_IMAGE/codecov/deploy:$CI_COMMIT_SHA
stage: cleanup
extends: .daint_dealloc
variables:
ALLOCATION_NAME: arbor-ci-codecov-$CI_PIPELINE_ID
notify_github_success:
stage: cleanup
when: on_success
only: ['master', 'staging', 'trying']
tags: ['kubernetes']
image: stabbles/git-curl
script: ./ci/set_github_status.sh success
notify_github_failure:
stage: cleanup
when: on_failure
only: ['master', 'staging', 'trying']
tags: ['kubernetes']
image: stabbles/git-curl
script: ./ci/set_github_status.sh failure