forked from tarantool/tarantool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
667 lines (568 loc) · 13.3 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
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
stages:
- static_analysis
- test
- long_tests
- perf
- cleanup
# 1. Git strategy disabled as shown at:
# https://docs.gitlab.com/ee/ci/yaml/README.html#git-strategy
# 2. Git clean flags disabled as shown at:
# https://docs.gitlab.com/ee/ci/yaml/README.html#git-clean-flags
variables:
GITLAB_MAKE: "make -f .gitlab.mk"
GIT_STRATEGY: none
GIT_CLEAN_FLAGS: none
OSX_VARDIR: /tmp/tnt
# 1. Git checkout strategy used from:
# https://docs.gitlab.com/ee/ci/yaml/README.html#git-checkout
# 2. Submodule strategy used from:
# https://docs.gitlab.com/ee/ci/yaml/README.html#git-submodule-strategy
# List of steps:
# 1) Check/clone the Tarantool repository with submodules.
# 2) For shell based jobs change ownership of all the sources
# to gitlab-runner user (NOTE: in Docker based jobs the
# gitlab-runner user is not known).
# 3) Fetch Tarantool sources with branches and force checkout
# of the testing commit.
# 4) Drop a tag that points to a current commit (if any) on a job triggered by
# pushing to a branch (as against of pushing a tag). Otherwise we may get
# two jobs for the same x.y.z-0-gxxxxxxxxx build: one is run by pushing a
# branch and another by pushing a tag. The idea is to hide the new tag from
# the branch job as if a tag would be pushed strictly after all branch jobs
# for the same commit. See gh-3745.
# 5) Update submodules recursively (use force where supports).
# 6) Cleanup all the sources from all files except from repository.
before_script:
- /bin/bash -c "pwd && ls -d .git || git clone --recurse-submodules ${CI_REPOSITORY_URL} ."
- /bin/bash -c "! docker -v || (uid=`id -u` ; gid=`id -g` ; docker run -w /source -v ${PWD}:/source -i packpack/packpack:el-7 /bin/bash -c \"chown -R \$uid:\$gid * .[^.]*\")"
- /bin/bash -c "git fetch -p && git checkout -f ${CI_COMMIT_SHORT_SHA}"
- /bin/bash -c "[ -z \"${CI_COMMIT_TAG:-}\" ] && git tag -d \"$(git tag --points-at HEAD)\" 2>/dev/null || true"
- /bin/bash -c "git submodule sync --recursive && git submodule update --force --init --recursive || git submodule update --recursive --init"
- /bin/bash -c "git clean -ffdx && git submodule foreach git clean -ffdx && git submodule foreach git status"
# Jobs templates
.artifacts_files_template: &artifacts_files_definition
artifacts:
expire_in: 1000 yrs
when: always
paths:
- "artifacts"
after_script:
- cp -r test/var/artifacts .
.deploy_only_template: &deploy_only_definition
only:
- master
- tags
except:
- schedules
- external_pull_requests
- merge_requests
.pack_only_template: &pack_only_definition
except:
- master
- tags
.perf_only_template: &perf_only_definition
only:
- master
- tags
- /^.*-perf$/
except:
- schedules
variables: &perf_vars_definition
IMAGE_PERF: "${CI_REGISTRY}/${CI_PROJECT_PATH}/perf/ubuntu-bionic:perf_master"
IMAGE_PERF_BUILT: "${CI_REGISTRY}/${CI_PROJECT_PATH}/perf_tmp/ubuntu-bionic:perf_${CI_COMMIT_SHORT_SHA}"
.docker_test_template: &docker_test_definition
<<: *artifacts_files_definition
image: "${CI_REGISTRY}/${CI_PROJECT_PATH}/testing/debian-stretch:latest"
stage: test
tags:
- docker_test
.docker_test_clang11_template: &docker_test_clang8_definition
<<: *artifacts_files_definition
image: "${CI_REGISTRY}/${CI_PROJECT_PATH}/testing/debian-buster:latest"
stage: test
tags:
- docker_test
.pack_artifacts_files_template: &pack_artifacts_files_definition
<<: *artifacts_files_definition
after_script:
- cp -r build/usr/src/*/tarantool-*/test/var/artifacts .
.pack_template: &pack_definition
<<: *pack_only_definition
stage: test
tags:
- deploy
script:
- ${GITLAB_MAKE} package
.pack_test_template: &pack_test_definition
<<: *pack_only_definition
<<: *pack_artifacts_files_definition
stage: test
tags:
- deploy_test
script:
- ${GITLAB_MAKE} package
.deploy_template: &deploy_definition
<<: *deploy_only_definition
stage: test
tags:
- deploy
script:
- ${GITLAB_MAKE} deploy
.deploy_test_template: &deploy_test_definition
<<: *deploy_only_definition
<<: *pack_artifacts_files_definition
stage: test
tags:
- deploy_test
script:
- ${GITLAB_MAKE} deploy
.osx_template: &osx_definition
<<: *artifacts_files_definition
stage: test
script:
- ${GITLAB_MAKE} test_osx
after_script:
# Artifacts can't be used from outside the project directory, check:
# https://docs.gitlab.com/ee/ci/yaml/README.html#artifactspaths
# "Paths are relative to the project directory ($CI_PROJECT_DIR)"
# "and can’t directly link outside it."
- cp -rf ${OSX_VARDIR}/artifacts .
.vbox_template: &vbox_definition
<<: *artifacts_files_definition
stage: test
after_script:
- >
scp -r -P ${VMS_PORT} ${VMS_USER}@127.0.0.1:tarantool/test/var/artifacts . ;
${GITLAB_MAKE} vms_shutdown
.perf_docker_test_template: &perf_docker_test_definition
<<: *perf_only_definition
image: ${IMAGE_PERF_BUILT}
stage: perf
artifacts:
when: always
paths:
- "*_result.txt"
- "*_t_version.txt"
script:
- ${GITLAB_MAKE} perf_run
.perf_cleanup_definition: &perf_cleanup_definition
<<: *perf_only_definition
stage: cleanup
script:
- ${GITLAB_MAKE} perf_cleanup
.jepsen_test_definition: &jepsen_test_definition
<<: *docker_test_definition
script:
- ${GITLAB_MAKE} test_jepsen
stage: long_tests
when: manual
tags:
- mcs_jepsen_docker
artifacts:
paths:
- jepsen-tests-prefix/src/jepsen-tests/store
expire_in: 6 month
# Static Analysis
luacheck:
<<: *docker_test_definition
stage: static_analysis
tags:
- deploy_test
script:
- ${GITLAB_MAKE} test_debian_docker_luacheck
# Tests
out_of_source:
stage: test
tags:
- deploy_test
script:
- ${GITLAB_MAKE} test_oos_build
release:
<<: *docker_test_definition
script:
- ${GITLAB_MAKE} test_debian_no_deps
debug:
<<: *docker_test_definition
script:
- ${GITLAB_MAKE} test_coverage_debian_no_deps
release_clang:
<<: *docker_test_definition
variables:
CC: clang
CXX: clang++
script:
- ${GITLAB_MAKE} test_debian_no_deps
release_lto:
<<: *docker_test_clang8_definition
variables:
CMAKE_EXTRA_PARAMS: -DENABLE_LTO=ON
script:
- ${GITLAB_MAKE} test_debian_no_deps
release_lto_clang11:
<<: *docker_test_clang8_definition
variables:
CC: clang-11
CXX: clang++-11
CMAKE_EXTRA_PARAMS: -DENABLE_LTO=ON
script:
- ${GITLAB_MAKE} test_debian_no_deps
release_asan_clang11:
<<: *docker_test_clang8_definition
script:
- ${GITLAB_MAKE} test_asan_debian_no_deps
osx_13_release:
tags:
- osx_13
variables:
MACOSX_DEPLOYMENT_TARGET: '10.13'
<<: *osx_definition
osx_14_release:
tags:
- osx_14
<<: *osx_definition
osx_15_release:
tags:
- osx_15
<<: *osx_definition
osx_15_release_lto:
tags:
- osx_15
variables:
CMAKE_EXTRA_PARAMS: -DENABLE_LTO=ON
<<: *osx_definition
freebsd_12_release:
<<: *vbox_definition
tags:
- vms_freebsd_12
variables:
VMS_NAME: 'freebsd_12'
VMS_USER: 'vagrant'
VMS_PORT: '2232'
MAKE: 'gmake'
script:
- ${GITLAB_MAKE} vms_start
- ${GITLAB_MAKE} vms_test_freebsd
jepsen-single-instance:
<<: *jepsen_test_definition
variables:
LEIN_OPT: '--nemesis standard'
jepsen-single-instance-txm:
<<: *jepsen_test_definition
variables:
LEIN_OPT: '--nemesis standard --mvcc'
jepsen-cluster:
<<: *jepsen_test_definition
variables:
LEIN_OPT: '--nemesis standard'
INSTANCE_COUNT: '5'
jepsen-cluster-txm:
<<: *jepsen_test_definition
variables:
LEIN_OPT: '--nemesis standard --mvcc'
INSTANCE_COUNT: '5'
default_gcc_centos_7:
<<: *pack_test_definition
variables:
PACKPACK_EXTRA_DOCKER_RUN_PARAMS: '-e CC=/usr/bin/gcc -e CXX=/usr/bin/g++'
OS: 'el'
DIST: '7'
# ####
# Perf
# ####
# Pre-testing part
perf_bootstrap:
<<: *perf_only_definition
stage: test
tags:
- deploy
script:
- ${GITLAB_MAKE} perf_prepare
after_script:
- ${GITLAB_MAKE} perf_cleanup_image
# Testing part
perf_tpch:
<<: *perf_docker_test_definition
tags:
- docker_sh2_perf
image: ${IMAGE_PERF_BUILT}_tpch
variables:
<<: *perf_vars_definition
BENCH: 'tpch'
artifacts:
when: always
paths:
- "bench-*.csv"
- "*_t_version.txt"
- "*_result.txt"
perf_sysbench:
<<: *perf_docker_test_definition
tags:
- docker_sh3_perf
variables:
<<: *perf_vars_definition
BENCH: 'sysbench'
perf_tpcc:
<<: *perf_docker_test_definition
tags:
- docker_sh3_perf
variables:
<<: *perf_vars_definition
BENCH: 'tpcc'
perf_ycsb_hash:
<<: *perf_docker_test_definition
tags:
- docker_sh2_perf
variables:
<<: *perf_vars_definition
BENCH: 'ycsb'
ARG: 'hash'
perf_ycsb_tree:
<<: *perf_docker_test_definition
tags:
- docker_sh2_perf
variables:
<<: *perf_vars_definition
BENCH: 'ycsb'
ARG: 'tree'
perf_nosqlbench_hash:
<<: *perf_docker_test_definition
tags:
- docker_sh1_perf
variables:
<<: *perf_vars_definition
BENCH: 'nosqlbench'
ARG: 'hash'
perf_nosqlbench_tree:
<<: *perf_docker_test_definition
tags:
- docker_sh1_perf
variables:
<<: *perf_vars_definition
BENCH: 'nosqlbench'
ARG: 'tree'
perf_cbench:
<<: *perf_docker_test_definition
tags:
- docker_sh2_perf
variables:
<<: *perf_vars_definition
BENCH: 'cbench'
perf_linkbench_ssd:
<<: *perf_docker_test_definition
tags:
- docker_perf_ssd
variables:
<<: *perf_vars_definition
BENCH: 'linkbench'
# Post-testing part
remove_images_sh1:
<<: *perf_cleanup_definition
tags:
- sh1_shell
remove_images_sh2:
<<: *perf_cleanup_definition
tags:
- sh2_shell
remove_images_sh3:
<<: *perf_cleanup_definition
tags:
- sh3_shell
remove_images_sh9:
<<: *perf_cleanup_definition
tags:
- sh9_shell
# Packages and sources
sources:
<<: *pack_definition
script:
- ${GITLAB_MAKE} source
centos_6:
<<: *pack_definition
variables:
OS: 'el'
DIST: '6'
centos_7:
<<: *pack_test_definition
variables:
OS: 'el'
DIST: '7'
centos_8:
<<: *pack_test_definition
variables:
OS: 'el'
DIST: '8'
fedora_28:
<<: *pack_test_definition
variables:
OS: 'fedora'
DIST: '28'
fedora_29:
<<: *pack_test_definition
variables:
OS: 'fedora'
DIST: '29'
fedora_30:
<<: *pack_test_definition
variables:
OS: 'fedora'
DIST: '30'
fedora_31:
<<: *pack_test_definition
variables:
OS: 'fedora'
DIST: '31'
ubuntu_14_04:
<<: *pack_definition
variables:
OS: 'ubuntu'
DIST: 'trusty'
ubuntu_16_04:
<<: *pack_definition
variables:
OS: 'ubuntu'
DIST: 'xenial'
ubuntu_18_04:
<<: *pack_definition
variables:
OS: 'ubuntu'
DIST: 'bionic'
ubuntu_19_10:
<<: *pack_definition
variables:
OS: 'ubuntu'
DIST: 'eoan'
ubuntu_20_04:
<<: *pack_definition
variables:
OS: 'ubuntu'
DIST: 'focal'
debian_8:
<<: *pack_definition
variables:
OS: 'debian'
DIST: 'jessie'
debian_9:
<<: *pack_definition
variables:
OS: 'debian'
DIST: 'stretch'
debian_10:
<<: *pack_definition
variables:
OS: 'debian'
DIST: 'buster'
opensuse_15_1:
<<: *pack_test_definition
variables:
OS: 'opensuse-leap'
DIST: '15.1'
opensuse_15_2:
<<: *pack_test_definition
variables:
OS: 'opensuse-leap'
DIST: '15.2'
# Deploy
sources_deploy:
<<: *deploy_definition
script:
- ${GITLAB_MAKE} source_deploy
centos_6_deploy:
<<: *deploy_definition
variables:
OS: 'el'
DIST: '6'
centos_7_deploy:
<<: *deploy_test_definition
variables:
OS: 'el'
DIST: '7'
centos_8_deploy:
<<: *deploy_test_definition
variables:
OS: 'el'
DIST: '8'
fedora_28_deploy:
<<: *deploy_test_definition
variables:
OS: 'fedora'
DIST: '28'
fedora_29_deploy:
<<: *deploy_test_definition
variables:
OS: 'fedora'
DIST: '29'
fedora_30_deploy:
<<: *deploy_test_definition
variables:
OS: 'fedora'
DIST: '30'
fedora_31_deploy:
<<: *deploy_test_definition
variables:
OS: 'fedora'
DIST: '31'
ubuntu_14_04_deploy:
<<: *deploy_definition
variables:
OS: 'ubuntu'
DIST: 'trusty'
ubuntu_16_04_deploy:
<<: *deploy_definition
variables:
OS: 'ubuntu'
DIST: 'xenial'
ubuntu_18_04_deploy:
<<: *deploy_definition
variables:
OS: 'ubuntu'
DIST: 'bionic'
ubuntu_19_10_deploy:
<<: *deploy_definition
variables:
OS: 'ubuntu'
DIST: 'eoan'
ubuntu_20_04_deploy:
<<: *deploy_definition
variables:
OS: 'ubuntu'
DIST: 'focal'
debian_8_deploy:
<<: *deploy_definition
variables:
OS: 'debian'
DIST: 'jessie'
debian_9_deploy:
<<: *deploy_definition
variables:
OS: 'debian'
DIST: 'stretch'
debian_10_deploy:
<<: *deploy_definition
variables:
OS: 'debian'
DIST: 'buster'
opensuse_15_1_deploy:
<<: *deploy_test_definition
variables:
OS: 'opensuse-leap'
DIST: '15.1'
opensuse_15_2_deploy:
<<: *deploy_test_definition
variables:
OS: 'opensuse-leap'
DIST: '15.2'
# Static builds
static_build:
<<: *docker_test_definition
script:
- ${GITLAB_MAKE} test_static_build
static_build_cmake_linux:
<<: *docker_test_definition
script:
- ${GITLAB_MAKE} test_static_build_cmake_linux
static_build_cmake_osx_15:
<<: *osx_definition
tags:
- osx_15
script:
- ${GITLAB_MAKE} test_static_build_cmake_osx