forked from CARV-ICS-FORTH/arax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
317 lines (288 loc) · 8.55 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
image: carvicsforth/arch_carv
stages:
- style
- build
- test
- controller
- build_all
- docs
- publish
- publish_controller
- trigger_deps
- report
- release
.build_base: &build_base
stage: build
needs: []
.build_all: &build_all
stage: build_all
needs: []
when: manual
.mutext_utest: &mutext_utest
stage: test
needs: [build_mutex]
dependencies:
- build_mutex
retry: 2
.only_master: &only_master
only:
refs:
- master
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
style_check:
stage: style
rules:
- if: $CI_PIPELINE_SOURCE == "push"
needs: []
script:
- mkdir -p build
- cd build; cmake ../;make pre-commit-all
report_stale_branches:
stage: report
needs: []
script:
- python ./ci_scripts/report_stale_branches.py
when: always
build_spin:
<<: *build_base
script:
- mkdir -p build
- cd build; cmake -DDEBUG=ON -DARAX_CONFIG_FILE="$PWD/../araxconf" -Dasync_architecture=spin ../; make -j 4; cd ../
- ./ci_scripts/pack.sh 0 . spin
artifacts:
paths:
- spin.tgz
expire_in: 2 hour
when: manual
build_mutex:
<<: *build_base
script:
- mkdir -p build
- cd build; cmake -DCMAKE_BUILD_TYPE=DEBUG -DDEBUG=ON -DARAX_CONFIG_FILE="$PWD/../araxconf" -Dasync_architecture=mutex ../; make -j 4; cd ../
- ./ci_scripts/pack.sh 0 . mutex
artifacts:
paths:
- mutex.tgz
expire_in: 24 hour
build_ivshmem:
<<: *build_base
script:
- mkdir -p build
- cd build; cmake -DDEBUG=ON -DARAX_CONFIG_FILE="$PWD/../araxconf" -Dasync_architecture=ivshmem ../; make -j 4; cd ../
- ./ci_scripts/pack.sh 0 . ivshmem
artifacts:
paths:
- ivshmem.tgz
expire_in: 2 hour
when: manual
build_all_spin:
<<: *build_all
script:
- export gen_art=spin;./tools/build_check.sh spin
build_all_mutex:
<<: *build_all
script:
- export gen_art=mutex;./tools/build_check.sh mutex
build_all_ivshmem:
<<: *build_all
script:
- export gen_art=ivshmem;./tools/build_check.sh ivshmem
utest_spin:
stage: test
needs: [build_spin]
script:
- ./ci_scripts/pack.sh 1 . spin
- cd build && ctest -V -W
dependencies:
- build_spin
when: manual
utest_mutex:
<<: *mutext_utest
script:
- ulimit -c 0
- ./ci_scripts/pack.sh 1 . mutex
- cd build && ctest -V -W
utest_ivshmem:
stage: test
needs: [build_ivshmem]
script:
- ./ci_scripts/pack.sh 1 . ivshmem
- cd build && ctest -V -W
dependencies:
- build_ivshmem
when: manual
coverage_mutex:
<<: *mutext_utest
script:
- ./ci_scripts/pack.sh 1 . mutex
- cd build
- echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=true]\r\e[0KCMake"
- cmake .. -DCOVERAGE=ON -DBUILD_TESTS=ON
- echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K"
- echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=true]\r\e[0KMake"
- make -j 4
- echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K"
- make cov
- pip install htmlark
- htmlark -o cov.html ./coverage/coverage.html
artifacts:
paths:
- build/cov.html
expire_in: 7 Day
pahole:
<<: *mutext_utest
script:
- ./ci_scripts/pack.sh 1 . mutex
- python ./tools/pahole.py
build_doc:
stage: build
needs: []
script:
- mkdir -p build
- cd build
- cmake ../
- make doc
- cd docs
- mv html AraxDocs
- zip -gr AraxDocs.zip AraxDocs/*
artifacts:
paths:
- build/docs/AraxDocs.zip
expire_in: 1 Day
only:
refs:
- master
publish_doc:
<<: *only_master
stage: publish
needs: [build_doc]
script:
- bash ci_scripts/pub_doc.sh
dependencies:
- build_doc
publish_docker:
stage: publish
variables:
BUILDAH_LAYERS: "true"
DEVEL_TAG: "${DOCK_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}-devel:${CI_BUILD_REF_NAME}"
RUNTIME_TAG: "${DOCK_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}-runtime:${CI_BUILD_REF_NAME}"
INSTALL_TAG: "${DOCK_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}-install:${CI_BUILD_REF_NAME}"
needs: [utest_mutex,controller]
script:
- echo "${DOCK_PASS}" | buildah login -u "${DOCK_USER}" --password-stdin ${DOCK_HOST}
- buildah build --target ${CI_PROJECT_NAME}-devel -t ${DEVEL_TAG} -f ./docker/Dockerfile .
- buildah build --target ${CI_PROJECT_NAME}-runtime -t ${RUNTIME_TAG} -f ./docker/Dockerfile .
- buildah build --target ${CI_PROJECT_NAME}-install -t ${INSTALL_TAG} -f ./docker/Dockerfile .
- buildah push ${DEVEL_TAG}
- buildah push ${RUNTIME_TAG}
- buildah push ${INSTALL_TAG}
- buildah rm -a
- buildah rmi -a
publish_controller_docker:
stage: publish_controller
needs: [publish_docker]
variables:
BUILDAH_LAYERS: "true"
DEVEL_TAG: "${DOCK_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}controller-devel:${CI_BUILD_REF_NAME}"
RUNTIME_TAG: "${DOCK_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}controller-runtime:${CI_BUILD_REF_NAME}"
INSTALL_TAG: "${DOCK_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}controller-install:${CI_BUILD_REF_NAME}"
script:
- cd controller
- sed -i "s/ARAX_BRANCH/${CI_BUILD_REF_NAME}/g" docker/Dockerfile
- echo "${DOCK_PASS}" | buildah login -u "${DOCK_USER}" --password-stdin ${DOCK_HOST}
- buildah build --target ${CI_PROJECT_NAME}controller-devel -t ${DEVEL_TAG} --volume '/usr/lib/libcuda.so:/usr/lib/libcuda.so' -f ./docker/Dockerfile .
- buildah build --target ${CI_PROJECT_NAME}controller-runtime -t ${RUNTIME_TAG} --volume '/usr/lib/libcuda.so:/usr/lib/libcuda.so' -f ./docker/Dockerfile .
- buildah build --target ${CI_PROJECT_NAME}controller-install -t ${INSTALL_TAG} --volume '/usr/lib/libcuda.so:/usr/lib/libcuda.so' -f ./docker/Dockerfile .
- buildah push -q ${DEVEL_TAG}
- buildah push -q ${RUNTIME_TAG}
- buildah push -q ${INSTALL_TAG}
- buildah rm -a
- buildah rmi -a
package_build:
<<: *only_master
stage: build
needs: []
script:
- tar czvf ${CI_PROJECT_NAME}_${CI_BUILD_REF_NAME}.tgz *
artifacts:
paths:
- ${CI_PROJECT_NAME}_${CI_BUILD_REF_NAME}.tgz
expire_in: 1 Day
package_publish:
<<: *only_master
stage: publish
needs: [package_build]
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${CI_PROJECT_NAME}_${CI_BUILD_REF_NAME}.tgz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_BUILD_REF_NAME}/${CI_PROJECT_NAME}_${CI_BUILD_REF_NAME}.tgz"'
dependencies:
- package_build
controller:
stage: test
needs: []
script:
- echo "shm_file /dev/shm/${CI_JOB_TOKEN}" > ~/.arax
- echo -e "\e[0Ksection_start:`date +%s`:vtbuild[collapsed=true]\r\e[0KBuild Arax"
- mkdir -p build
- cd build
- cmake .. -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=DEBUG -DJAVA_WRAPS=ON -Dasync_architecture=mutex
- make -j all noop noop_stress
- make install
- export VT_BUILD=`pwd`
- echo ${VT_BUILD}
- ls
- cd -
- cd controller
- echo -e "\e[0Ksection_end:`date +%s`:vtbuild\r\e[0K"
- cp ci/rr_cpu.json conf.json
- mkdir -p build
- cd build
- pwd
- echo -e "\e[0Ksection_start:`date +%s`:vcconf[collapsed=true]\r\e[0KConfigure Controller"
- cmake -DARAX_BUILD_PATH=${VT_BUILD} ..
- echo -e "\e[0Ksection_end:`date +%s`:vcconf\r\e[0K"
- echo -e "\e[0Ksection_start:`date +%s`:vcbuild[collapsed=true]\r\e[0KBuild Controller"
- make -j
- echo -e "\e[0Ksection_end:`date +%s`:vcbuild\r\e[0K"
- cat ../conf.json
- make run &
- cd ${VT_BUILD}
- sleep 1
- gdb -batch -ex "set logging on" -ex "run" -ex "bt full" -ex "quit" --args ./noop/noop '!skrow C nialP'
- ./araxgrind/araxgrind --all
- java -jar JArax.jar '!skrow avaJ'
- ./araxgrind/araxgrind --all
- gdb -batch -ex "set logging on" -ex "run" -ex "bt full" -ex "quit" --args ./noop/noop_stress
- killall -SIGINT arax_controller
- sleep 1
after_script:
- rm /dev/shm/${CI_JOB_TOKEN}
retry: 2
trigger_autotalk:
stage: trigger_deps
needs: [publish_controller_docker]
trigger:
project: accelerators/auto_talk
branch: ${CI_BUILD_REF_NAME}
trigger_cufft:
stage: trigger_deps
needs: [publish_controller_docker]
trigger:
project: accelerators/arax_fft
branch: ${CI_BUILD_REF_NAME}
report:
stage: report
script:
- python ./ci_scripts/report.py
when: always
release:
stage: release
parallel:
matrix:
- REPO: ['carvgit.ics.forth.gr:accelerators/internal_release.git']
script:
- git config --global user.email "${CI_EMAIL}"
- git config --global user.name "${CI_USERNAME}"
- git remote rm origin && git remote add origin git@${REPO}
- git push origin HEAD:master