-
Notifications
You must be signed in to change notification settings - Fork 18
/
.gitlab-ci.yml
500 lines (470 loc) · 14.7 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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
stages:
- Build base container
- Build container
- Build benchmark container
- Run tests
- Deploy
- Cleanup
- Benchmark
- Report
cache:
paths:
- apt-cache/
variables:
REBENCH_OPTIONS: "-df $CI_PROJECT_DIR/benchmarks.data -R"
REBENCH_RUN: "/opt/rbenchmarking/Setup/run.sh /opt/rbenchmarking/rebench.conf /opt/rbenchmarking/Benchmarks /opt/rir/build/release"
REBENCH_RUN_BL: "/opt/rbenchmarking/Setup/run.sh /opt/rbenchmarking/rebench.conf /opt/rbenchmarking/Benchmarks . /opt/rir/external/custom-r /opt/graal"
SAVE_LOGS: "sh /opt/rir/tools/copy-logs.sh /opt/rir/external/custom-r/tests $CI_PROJECT_DIR/logs"
rir_container:
stage: Build container
image: registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:stable
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_TLS_CERTDIR: ""
services:
- name: registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:19.03.0-dind
alias: docker
before_script:
- docker info
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER --password-stdin registry.gitlab.com
- docker build --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA -t registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA .
- docker push registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
tags:
- dockerInDocker
retry: 1
benchmark_container:
stage: Build benchmark container
needs:
- rir_container
image: registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:stable
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_TLS_CERTDIR: ""
services:
- name: registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:19.03.0-dind
alias: docker
before_script:
- docker info
tags:
- dockerInDocker
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER --password-stdin registry.gitlab.com
- cd container/benchmark
- docker build --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA -t registry.gitlab.com/rirvm/rir_mirror/benchmark:$CI_COMMIT_SHA .
- docker push registry.gitlab.com/rirvm/rir_mirror/benchmark:$CI_COMMIT_SHA
retry: 1
cpp_check:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
needs:
- rir_container
except:
- schedules
stage: Run tests
needs:
- rir_container
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get -o dir::cache::archives=apt-cache install -y -qq cppcheck
- /opt/rir/tools/cppcheck
# Run check-all in release mode (additionally check pir types)
test_release_1:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 0
PIR_OPT_LEVEL: 2
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- RIR_CHECK_PIR_TYPES=1 bin/tests
- RIR_CHECK_PIR_TYPES=1 bin/gnur-make-tests check-devel || $SAVE_LOGS
- ../../tools/check-gnur-make-tests-error
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week
test_release_2:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 0
PIR_OPT_LEVEL: 1
PIR_MAX_INPUT_SIZE: 4000
PIR_WARMUP: 5
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- bin/gnur-make-tests check-recommended || $SAVE_LOGS
- ../../tools/check-gnur-make-tests-error
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week
# Run some tests in the debug mode
tests_debug_1:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/build-releaseassert.sh
- cd /opt/rir/build/releaseassert
- export UNSOUND_OPTS=off
- R_ENABLE_JIT=0 bin/tests
- R_ENABLE_JIT=1 bin/tests
- R_ENABLE_JIT=2 bin/tests
- R_ENABLE_JIT=3 bin/tests
- PIR_ENABLE=off bin/tests
- PIR_ENABLE=force bin/tests
- PIR_WARMUP=3 bin/tests
- PIR_WARMUP=5 bin/tests
tests_debug_2:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 0
PIR_OPT_LEVEL: 1
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- bin/gnur-make-tests check-devel || $SAVE_LOGS
- ../../tools/check-gnur-make-tests-error
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week
# Run some tests in the full verify (release) mode
tests_fullverify:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_MAX_INPUT_SIZE: 10000
PIR_INLINER_MAX_SIZE: 10000
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- curl 10.200.14.25:8080/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz > /opt/rir/external/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
- mkdir -p /opt/rir/build/fullverifier
- cd /opt/rir/build/fullverifier
- /opt/rir/tools/fetch-llvm.sh
- cmake -DCMAKE_BUILD_TYPE=fullverifier ../..
- make -j6
- bin/tests
# Test particular features, like deoptimization and serialization
test_features_1:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 0
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- PIR_DEOPT_CHAOS=100000 PIR_DEOPT_CHAOS_NO_RETRIGGER=1 bin/tests
- PIR_WARMUP=2 PIR_DEOPT_CHAOS=50000 bin/gnur-make-tests check || $SAVE_LOGS
- PIR_GLOBAL_SPECIALIZATION_LEVEL=0 FAST_TESTS=1 bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=1 FAST_TESTS=1 bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=2 FAST_TESTS=1 bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=3 FAST_TESTS=1 bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=4 FAST_TESTS=1 bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=5 FAST_TESTS=1 bin/tests
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week
test_features_2:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 1
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- bin/gnur-make-tests check || $SAVE_LOGS
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week
test_features_3:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- PIR_LLVM_OPT_LEVEL=0 PIR_OPT_LEVEL=1 PIR_DEOPT_CHAOS=10000 bin/gnur-make-tests check || $SAVE_LOGS
- PIR_LLVM_OPT_LEVEL=0 PIR_OPT_LEVEL=1 RIR_SERIALIZE_CHAOS=1 FAST_TESTS=1 bin/tests
- PIR_LLVM_OPT_LEVEL=0 PIR_OPT_LEVEL=1 PIR_DEOPTLESS=1 bin/tests
- PIR_LLVM_OPT_LEVEL=0 PIR_OPT_LEVEL=1 PIR_OSR=0 bin/tests
- PIR_LLVM_OPT_LEVEL=0 PIR_OPT_LEVEL=0 bin/tests
- PIR_DEOPTLESS=1 bin/tests
- PIR_OSR=0 bin/tests
- PIR_DEOPTLESS=1 RIR_CHECK_PIR_TYPES=1 bin/tests
- PIR_OSR=0 RIR_CHECK_PIR_TYPES=1 bin/tests
- PIR_DEOPTLESS=1 PIR_OSR=0 bin/tests
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week
# Run ubsan and gc torture
test_gctorture_1:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 0
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- R_GCTORTURE=5000 bin/gnur-make-tests check || $SAVE_LOGS
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week
test_gctorture_2:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 0
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- cd /opt/rir/build/release
- PIR_INLINER_MAX_INLINEE_SIZE=2000 bin/tests
- PIR_INLINER_MAX_INLINEE_SIZE=1500 PIR_DEOPT_CHAOS=100000 bin/tests
- /opt/rir/container/build-releaseassert.sh
- cd /opt/rir/build/releaseassert
- PIR_TEST_CLEAR_TEMPS=1 R_GCTORTURE=80 bin/tests
# Test with inlining big functions
test_big_inline:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_MAX_INPUT_SIZE: 4400
PIR_INLINER_MAX_SIZE: 1500
PIR_INLINER_INLINE_UNLIKELY: 1
PIR_INLINER_MAX_INLINEE_SIZE: 400
PIR_LLVM_OPT_LEVEL: 0
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- bin/gnur-make-tests check || $SAVE_LOGS
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week
# Test with asan and ubsan
test_sanitize:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- curl 10.200.14.25:8080/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz > /opt/rir/external/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
- mkdir /opt/rir/build/sanitize
- cd /opt/rir/build/sanitize
- /opt/rir/tools/fetch-llvm.sh
- CC=$(ls ../../external/clang*/bin/clang) CXX=$(ls ../../external/clang*/bin/clang) cmake -DCMAKE_BUILD_TYPE=sanitize ../..
- make -j6
# R_LD_PRELOAD is a feature of the test-runner. To repro this without the testrunner use LD_PRELOAD instead.
# intercept_tls_get_addr=0 helps with leak sanitizer crashes
- ASAN_OPTIONS="intercept_tls_get_addr=0" LSAN_OPTIONS="symbolize=1" ASAN_SYMBOLIZER_PATH=$(ls /opt/rir/external/clang*/bin/llvm-symbolizer) R_LD_PRELOAD=$(ls /opt/rir/external/clang*/lib/clang/12.0.0/lib/linux/libclang_rt.asan-x86_64.so) bin/tests
# sometimes leak sanitizer segfaults
retry: 2
# Test the benchmarks container before deploying
test_benchmarks:
image: registry.gitlab.com/rirvm/rir_mirror/benchmark:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
stage: Run tests
needs:
- benchmark_container
script:
- "sed -i 's/warmup: 5/warmup: 0/' /opt/rbenchmarking/rebench.conf"
- PIR_DEOPT_CHAOS=100000 PATH=~/.local/bin:$PATH /opt/rbenchmarking/Setup/run.sh /opt/rbenchmarking/rebench.conf /opt/rbenchmarking/Benchmarks /opt/rir/build/release/ /opt/rir/external/custom-r "e:PIR-LLVM -R -r --iterations 2"
- PATH=~/.local/bin:$PATH /opt/rbenchmarking/Setup/run.sh /opt/rbenchmarking/rebench.conf /opt/rbenchmarking/Benchmarks /opt/rir/build/release/ /opt/rir/external/custom-r "e:PIR-LLVM -R -r --iterations 3"
deploy:
stage: Deploy
except:
- schedules
image: registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:stable
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_TLS_CERTDIR: ""
services:
- name: registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:19.03.0-dind
alias: docker
before_script:
- docker info
variables:
GIT_STRATEGY: none
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER --password-stdin registry.gitlab.com
- docker pull registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
- docker tag registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA registry.gitlab.com/rirvm/rir_mirror:master
- docker push registry.gitlab.com/rirvm/rir_mirror:master
- docker pull registry.gitlab.com/rirvm/rir_mirror/benchmark:$CI_COMMIT_SHA
- docker tag registry.gitlab.com/rirvm/rir_mirror/benchmark:$CI_COMMIT_SHA registry.gitlab.com/rirvm/rir_mirror/benchmark:master
- docker push registry.gitlab.com/rirvm/rir_mirror/benchmark:master
tags:
- dockerInDocker
only:
- master
cleanup_registry:
stage: Cleanup
image: ruby:2.5
before_script: []
script:
- echo -n "$CI_JOB_TOKEN" | ruby container/cleanup.rb
report_results:
stage: Report
image: ruby:2.5
before_script: []
script:
- ruby tools/report_ci_results.rb
benchmark_llvm:
image: registry.gitlab.com/rirvm/rir_mirror/benchmark:$CI_COMMIT_SHA
stage: Benchmark
needs:
- test_benchmarks
variables:
GIT_STRATEGY: none
tags:
- benchmarks
script:
- $REBENCH_RUN "e:PIR-LLVM $REBENCH_OPTIONS"
- cp /tmp/memory.data $CI_PROJECT_DIR/
artifacts:
paths:
- benchmarks.data
- memory.data
expire_in: 24 month
retry: 1
benchmark_gnur:
image: registry.gitlab.com/rirvm/rir_mirror/benchmark-baseline
stage: Benchmark
variables:
GIT_STRATEGY: none
only:
refs:
- schedules
tags:
- benchmarks
script:
- $REBENCH_RUN_BL "e:GNU-R $REBENCH_OPTIONS"
- cp /tmp/memory.data $CI_PROJECT_DIR/
artifacts:
paths:
- benchmarks.data
- memory.data
expire_in: 6 month
benchmark_fastr:
image: registry.gitlab.com/rirvm/rir_mirror/benchmark-baseline
stage: Benchmark
variables:
GIT_STRATEGY: none
only:
refs:
- schedules
tags:
- benchmarks
script:
- $REBENCH_RUN_BL "e:FASTR $REBENCH_OPTIONS"
- cp /tmp/memory.data $CI_PROJECT_DIR/
artifacts:
paths:
- benchmarks.data
- memory.data
expire_in: 6 month
update_containers:
image: registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:stable
stage: Build base container
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_TLS_CERTDIR: ""
services:
- name: docker:dind
alias: docker
before_script:
- docker info
only:
refs:
- schedules
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER --password-stdin registry.gitlab.com
- docker pull docker.io/library/docker:19.03.0-dind
- docker pull docker.io/library/docker:stable
- docker pull docker.io/library/ubuntu:20.04
- docker tag docker.io/library/docker:19.03.0-dind registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:19.03.0-dind
- docker tag docker.io/library/docker:stable registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:stable
- docker tag docker.io/library/ubuntu:20.04 registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/ubuntu:20.04
- docker push registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:19.03.0-dind
- docker push registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/docker:stable
- docker push registry.gitlab.com/rirvm/rir_mirror/dockerhub_mirror/ubuntu:20.04
- cd container/benchmark-baseline && sh update.sh
tags:
- dockerInDocker
retry: 1