forked from daos-stack/daos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
1051 lines (1041 loc) · 46.8 KB
/
Jenkinsfile
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
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/groovy
/* Copyright 2019-2022 Intel Corporation
* All rights reserved.
*
* This file is part of the DAOS Project. It is subject to the license terms
* in the LICENSE file found in the top-level directory of this distribution
* and at https://img.shields.io/badge/License-BSD--2--Clause--Patent-blue.svg.
* No part of the DAOS Project, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*/
// To use a test branch (i.e. PR) until it lands to master
// I.e. for testing library changes
//@Library(value="pipeline-lib@your_branch") _
// For master, this is just some wildly high number
next_version = "1000"
// Don't define this as a type or it loses it's global scope
target_branch = env.CHANGE_TARGET ? env.CHANGE_TARGET : env.BRANCH_NAME
def sanitized_JOB_NAME = JOB_NAME.toLowerCase().replaceAll('/', '-').replaceAll('%2f', '-')
// bail out of branch builds that are not on a whitelist
if (!env.CHANGE_ID &&
(!env.BRANCH_NAME.startsWith("weekly-testing") &&
!env.BRANCH_NAME.startsWith("release/") &&
env.BRANCH_NAME != "master")) {
currentBuild.result = 'SUCCESS'
return
}
// The docker agent setup and the provisionNodes step need to know the
// UID that the build agent is running under.
cached_uid = 0
def getuid() {
if (cached_uid == 0)
cached_uid = sh(label: 'getuid()',
script: "id -u",
returnStdout: true).trim()
return cached_uid
}
pipeline {
agent { label 'lightweight' }
triggers {
cron(env.BRANCH_NAME == 'master' ? 'TZ=America/Toronto\n0 0 * * *\n' : '' +
env.BRANCH_NAME == 'weekly-testing' ? 'H 0 * * 6' : '' )
}
environment {
BULLSEYE = credentials('bullseye_license_key')
GITHUB_USER = credentials('daos-jenkins-review-posting')
SSH_KEY_ARGS = "-ici_key"
CLUSH_ARGS = "-o$SSH_KEY_ARGS"
TEST_RPMS = cachedCommitPragma(pragma: 'RPM-test', def_val: 'true')
COVFN_DISABLED = cachedCommitPragma(pragma: 'Skip-fnbullseye', def_val: 'true')
SCONS_FAULTS_ARGS = sconsFaultsArgs()
}
options {
// preserve stashes so that jobs can be started at the test stage
preserveStashes(buildCount: 5)
ansiColor('xterm')
buildDiscarder(logRotator(artifactDaysToKeepStr: '100', daysToKeepStr: '730'))
}
parameters {
string(name: 'BuildPriority',
defaultValue: getPriority(),
description: 'Priority of this build. DO NOT USE WITHOUT PERMISSION.')
string(name: 'TestTag',
defaultValue: "",
description: 'Test-tag to use for this run (i.e. pr, daily_regression, full_regression, etc.)')
string(name: 'BuildType',
defaultValue: "",
description: 'Type of build. Passed to scons as BUILD_TYPE. (I.e. dev, release, debug, etc.). Defaults to release on an RC or dev otherwise.')
string(name: 'TestRepeat',
defaultValue: "",
description: 'Test-repeat to use for this run. Specifies the ' +
'number of times to repeat each functional test. ' +
'CAUTION: only use in combination with a reduced ' +
'number of tests specified with the TestTag ' +
'parameter.')
booleanParam(name: 'CI_BUILD_PACKAGES_ONLY',
defaultValue: false,
description: 'Only build RPM and DEB packages, Skip unit tests.')
string(name: 'CI_RPM_TEST_VERSION',
defaultValue: '',
description: 'Package version to use instead of building. example: 1.3.103-1, 1.2-2')
string(name: 'CI_HARDWARE_DISTRO',
defaultValue: '',
description: 'Distribution to use for CI Hardware Tests')
string(name: 'CI_CENTOS7_TARGET',
defaultValue: '',
description: 'Image to used for Centos 7 CI tests. I.e. el7, el7.9, etc.')
string(name: 'CI_CENTOS8_TARGET',
defaultValue: '',
description: 'Image to used for Centos 8 CI tests. I.e. el8, el8.3, etc.')
string(name: 'CI_LEAP15_TARGET',
defaultValue: '',
description: 'Image to use for OpenSUSE Leap CI tests. I.e. leap15, leap15.2, etc.')
string(name: 'CI_UBUNTU20.04_TARGET',
defaultValue: '',
description: 'Image to used for Ubuntu 20 CI tests. I.e. ubuntu20.04, etc.')
booleanParam(name: 'CI_RPM_el7_NOBUILD',
defaultValue: false,
description: 'Do not build RPM packages for CentOS 7')
booleanParam(name: 'CI_RPM_el8_NOBUILD',
defaultValue: false,
description: 'Do not build RPM packages for CentOS 8')
booleanParam(name: 'CI_RPM_leap15_NOBUILD',
defaultValue: false,
description: 'Do not build RPM packages for Leap 15')
booleanParam(name: 'CI_DEB_Ubuntu20_NOBUILD',
defaultValue: false,
description: 'Do not build DEB packages for Ubuntu 20')
booleanParam(name: 'CI_ALLOW_UNSTABLE_TEST',
defaultValue: false,
description: 'Continue testing if a previous stage is Unstable')
booleanParam(name: 'CI_UNIT_TEST',
defaultValue: true,
description: 'Run the Unit CI tests')
booleanParam(name: 'CI_UNIT_TEST_MEMCHECK',
defaultValue: true,
description: 'Run the Unit Memcheck CI tests')
booleanParam(name: 'CI_FUNCTIONAL_el7_TEST',
defaultValue: true,
description: 'Run the functional CentOS 7 CI tests')
booleanParam(name: 'CI_MORE_FUNCTIONAL_PR_TESTS',
defaultValue: false,
description: 'Enable more distros for functional CI tests')
booleanParam(name: 'CI_FUNCTIONAL_el8_TEST',
defaultValue: true,
description: 'Run the functional CentOS 8 CI tests' +
' Requires CI_MORE_FUNCTIONAL_PR_TESTS')
booleanParam(name: 'CI_FUNCTIONAL_leap15_TEST',
defaultValue: true,
description: 'Run the functional OpenSUSE Leap 15 CI tests' +
' Requires CI_MORE_FUNCTIONAL_PR_TESTS')
booleanParam(name: 'CI_FUNCTIONAL_ubuntu20_TEST',
defaultValue: false,
description: 'Run the functional Ubuntu 20 CI tests' +
' Requires CI_MORE_FUNCTIONAL_PR_TESTS')
booleanParam(name: 'CI_RPMS_el7_TEST',
defaultValue: true,
description: 'Run the CentOS 7 RPM CI tests')
booleanParam(name: 'CI_SCAN_RPMS_el7_TEST',
defaultValue: true,
description: 'Run the Malware Scan for CentOS 7 RPM CI tests')
booleanParam(name: 'CI_small_TEST',
defaultValue: true,
description: 'Run the Small Cluster CI tests')
booleanParam(name: 'CI_medium_TEST',
defaultValue: true,
description: 'Run the Medium Cluster CI tests')
booleanParam(name: 'CI_large_TEST',
defaultValue: true,
description: 'Run the Large Cluster CI tests')
string(name: 'CI_UNIT_VM1_LABEL',
defaultValue: 'ci_vm1',
description: 'Label to use for 1 VM node unit and RPM tests')
string(name: 'CI_FUNCTIONAL_VM9_LABEL',
defaultValue: 'ci_vm9',
description: 'Label to use for 9 VM functional tests')
string(name: 'CI_NLT_1_LABEL',
defaultValue: 'ci_nlt_1',
description: "Label to use for NLT tests")
string(name: 'CI_NVME_3_LABEL',
defaultValue: 'ci_nvme3',
description: 'Label to use for 3 node NVMe tests')
string(name: 'CI_NVME_5_LABEL',
defaultValue: 'ci_nvme5',
description: 'Label to use for 5 node NVMe tests')
string(name: 'CI_NVME_9_LABEL',
defaultValue: 'ci_nvme9',
description: 'Label to use for 9 node NVMe tests')
string(name: 'CI_STORAGE_PREP_LABEL',
defaultValue: '',
description: 'Label for cluster to do a DAOS Storage Preparation')
}
stages {
stage('Get Commit Message') {
steps {
script {
env.COMMIT_MESSAGE = sh(script: 'git show -s --format=%B',
returnStdout: true).trim()
}
}
}
stage('Cancel Previous Builds') {
when { changeRequest() }
steps {
cancelPreviousBuilds()
}
}
stage('Pre-build') {
when {
beforeAgent true
expression { ! skipStage() }
}
parallel {
stage('checkpatch') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'Dockerfile.checkpatch'
dir 'utils/docker'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs(add_repos: false)
}
}
steps {
checkPatch user: GITHUB_USER_USR,
password: GITHUB_USER_PSW,
ignored_files: "src/control/vendor/*:" +
"src/include/daos/*.pb-c.h:" +
"src/common/*.pb-c.[ch]:" +
"src/mgmt/*.pb-c.[ch]:" +
"src/engine/*.pb-c.[ch]:" +
"src/security/*.pb-c.[ch]:" +
"src/client/java/daos-java/src/main/java/io/daos/dfs/uns/*:" +
"src/client/java/daos-java/src/main/java/io/daos/obj/attr/*:" +
"src/client/java/daos-java/src/main/native/include/daos_jni_common.h:" +
"src/client/java/daos-java/src/main/native/*.pb-c.[ch]:" +
"src/client/java/daos-java/src/main/native/include/*.pb-c.[ch]:" +
"*.crt:" +
"*.pem:" +
"*_test.go:" +
"src/cart/_structures_from_macros_.h:" +
"src/tests/ftest/*.patch:" +
"src/tests/ftest/large_stdout.txt"
}
post {
always {
archiveArtifacts artifacts: 'pylint.log', allowEmptyArchive: true
/* when JENKINS-39203 is resolved, can probably use stepResult
here and remove the remaining post conditions
stepResult name: env.STAGE_NAME,
context: 'build/' + env.STAGE_NAME,
result: ${currentBuild.currentResult}
*/
}
/* temporarily moved into stepResult due to JENKINS-39203
success {
githubNotify credentialsId: 'daos-jenkins-commit-status',
description: env.STAGE_NAME,
context: 'pre-build/' + env.STAGE_NAME,
status: 'SUCCESS'
}
unstable {
githubNotify credentialsId: 'daos-jenkins-commit-status',
description: env.STAGE_NAME,
context: 'pre-build/' + env.STAGE_NAME,
status: 'FAILURE'
}
failure {
githubNotify credentialsId: 'daos-jenkins-commit-status',
description: env.STAGE_NAME,
context: 'pre-build/' + env.STAGE_NAME,
status: 'ERROR'
}
*/
}
} // stage('checkpatch')
stage('Python Bandit check') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'Dockerfile.code_scanning'
dir 'utils/docker'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs(add_repos: false)
}
}
steps {
pythonBanditCheck()
}
post {
always {
// Bandit will have empty results if it does not
// find any issues.
junit testResults: 'bandit.xml',
allowEmptyResults: true
}
}
} // stage('Python Bandit check')
}
}
stage('Build') {
/* Don't use failFast here as whilst it avoids using extra resources
* and gives faster results for PRs it's also on for master where we
* do want complete results in the case of partial failure
*/
//failFast true
when {
beforeAgent true
expression { ! skipStage() }
}
parallel {
stage('Build RPM on CentOS 7') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'Dockerfile.mockbuild'
dir 'utils/rpms/packaging'
label 'docker_ce_runner'
additionalBuildArgs dockerBuildArgs()
args '--group-add mock --cap-add=SYS_ADMIN --privileged=true'
}
}
steps {
buildRpm()
}
post {
success {
buildRpmPost condition: 'success'
}
unstable {
buildRpmPost condition: 'unstable'
}
failure {
buildRpmPost condition: 'failure'
}
unsuccessful {
buildRpmPost condition: 'unsuccessful'
}
cleanup {
buildRpmPost condition: 'cleanup'
}
}
}
stage('Build RPM on CentOS 8') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'Dockerfile.mockbuild'
dir 'utils/rpms/packaging'
label 'docker_ce_runner'
additionalBuildArgs dockerBuildArgs()
args '--group-add mock --cap-add=SYS_ADMIN --privileged=true'
}
}
steps {
buildRpm()
}
post {
success {
buildRpmPost condition: 'success'
}
unstable {
buildRpmPost condition: 'unstable'
}
failure {
buildRpmPost condition: 'failure'
}
unsuccessful {
buildRpmPost condition: 'unsuccessful'
}
cleanup {
buildRpmPost condition: 'cleanup'
}
}
}
stage('Build RPM on Leap 15') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'Dockerfile.mockbuild'
dir 'utils/rpms/packaging'
label 'docker_ce_runner'
additionalBuildArgs dockerBuildArgs()
args '--group-add mock --cap-add=SYS_ADMIN --privileged=true'
}
}
steps {
buildRpm()
}
post {
success {
buildRpmPost condition: 'success'
}
unstable {
buildRpmPost condition: 'unstable'
}
failure {
buildRpmPost condition: 'failure'
}
unsuccessful {
buildRpmPost condition: 'unsuccessful'
}
cleanup {
buildRpmPost condition: 'cleanup'
}
}
}
stage('Build DEB on Ubuntu 20.04') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'Dockerfile.ubuntu.20.04'
dir 'utils/rpms/packaging'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs()
args '--cap-add=SYS_ADMIN --privileged=true'
}
}
steps {
buildRpm()
}
post {
success {
buildRpmPost condition: 'success'
}
unstable {
buildRpmPost condition: 'unstable'
}
failure {
buildRpmPost condition: 'failure'
}
unsuccessful {
buildRpmPost condition: 'unsuccessful'
}
cleanup {
buildRpmPost condition: 'cleanup'
}
}
}
stage('Build on CentOS 7') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'utils/docker/Dockerfile.centos.7'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs(repo_type: 'stable',
qb: quickBuild()) +
" -t ${sanitized_JOB_NAME}-centos7 " +
' --build-arg QUICKBUILD_DEPS="' +
quickBuildDeps('centos7') + '"' +
' --build-arg REPOS="' + prRepos() + '"'
}
}
steps {
sconsBuild parallel_build: parallelBuild(),
stash_files: 'ci/test_files_to_stash.txt',
scons_exe: 'scons-3',
scons_args: sconsFaultsArgs()
}
post {
unsuccessful {
sh """if [ -f config.log ]; then
mv config.log config.log-centos7-gcc
fi"""
archiveArtifacts artifacts: 'config.log-centos7-gcc',
allowEmptyArchive: true
}
}
}
stage('Build on CentOS 7 Bullseye') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'utils/docker/Dockerfile.centos.7'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs(repo_type: 'stable',
qb: quickBuild()) +
" -t ${sanitized_JOB_NAME}-centos7 " +
' --build-arg BULLSEYE=' + env.BULLSEYE +
' --build-arg QUICKBUILD_DEPS="' +
quickBuildDeps('centos7') + '"' +
' --build-arg REPOS="' + prRepos() + '"'
}
}
steps {
sconsBuild parallel_build: parallelBuild(),
stash_files: 'ci/test_files_to_stash.txt',
scons_exe: 'scons-3',
scons_args: sconsFaultsArgs()
}
post {
unsuccessful {
sh """if [ -f config.log ]; then
mv config.log config.log-centos7-covc
fi"""
archiveArtifacts artifacts: 'config.log-centos7-covc',
allowEmptyArchive: true
}
}
}
stage('Build on Leap 15 with Intel-C and TARGET_PREFIX') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'utils/docker/Dockerfile.leap.15'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs(repo_type: 'stable',
deps_build: true) +
" -t ${sanitized_JOB_NAME}-leap15" +
" --build-arg COMPILER=icc"
}
}
steps {
sconsBuild parallel_build: parallelBuild(),
scons_args: sconsFaultsArgs() + " PREFIX=/opt/daos TARGET_TYPE=release",
build_deps: "no"
}
post {
unsuccessful {
sh """if [ -f config.log ]; then
mv config.log config.log-leap15-intelc
fi"""
archiveArtifacts artifacts: 'config.log-leap15-intelc',
allowEmptyArchive: true
}
}
}
}
}
stage('Unit Tests') {
when {
beforeAgent true
expression { ! skipStage() }
}
parallel {
stage('Unit Test') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_UNIT_VM1_LABEL
}
steps {
unitTest timeout_time: 60,
inst_repos: prRepos(),
inst_rpms: unitPackages()
}
post {
always {
unitTestPost artifacts: ['unit_test_logs/*']
}
}
}
stage('NLT') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_NLT_1_LABEL
}
steps {
unitTest timeout_time: 60,
inst_repos: prRepos(),
test_script: 'ci/unit/test_nlt.sh',
inst_rpms: unitPackages()
}
post {
always {
unitTestPost artifacts: ['nlt_logs/*'],
testResults: 'nlt-junit.xml',
always_script: 'ci/unit/test_nlt_post.sh',
valgrind_stash: 'centos7-gcc-nlt-memcheck'
recordIssues enabledForFailure: true,
failOnError: false,
ignoreFailedBuilds: true,
ignoreQualityGate: true,
name: "NLT server leaks",
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]],
tool: issues(pattern: 'nlt-server-leaks.json',
name: 'NLT server results',
id: 'NLT_server')
}
}
}
stage('Unit Test Bullseye') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_UNIT_VM1_LABEL
}
steps {
unitTest timeout_time: 60,
ignore_failure: true,
inst_repos: prRepos(),
inst_rpms: unitPackages()
}
post {
always {
// This is only set while dealing with issues
// caused by code coverage instrumentation affecting
// test results, and while code coverage is being
// added.
unitTestPost ignore_failure: true,
artifacts: ['covc_test_logs/*',
'covc_vm_test/**']
}
}
} // stage('Unit test Bullseye')
stage('Unit Test with memcheck') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_UNIT_VM1_LABEL
}
steps {
unitTest timeout_time: 35,
ignore_failure: true,
inst_repos: prRepos(),
inst_rpms: unitPackages()
}
post {
always {
unitTestPost artifacts: ['unit_test_memcheck_logs.tar.gz',
'unit_test_memcheck_logs/*.log'],
valgrind_stash: 'centos7-gcc-unit-memcheck'
}
}
} // stage('Unit Test with memcheck')
}
}
stage('Test') {
when {
beforeAgent true
expression { ! skipStage() }
}
parallel {
stage('Coverity on CentOS 7') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'utils/docker/Dockerfile.centos.7'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs(repo_type: 'stable',
qb: true) +
" -t ${sanitized_JOB_NAME}-centos7 " +
' --build-arg QUICKBUILD_DEPS="' +
quickBuildDeps('centos7', true) + '"' +
' --build-arg REPOS="' + prRepos() + '"'
}
}
steps {
sconsBuild coverity: "daos-stack/daos",
parallel_build: parallelBuild(),
scons_exe: 'scons-3'
}
post {
success {
coverityPost condition: 'success'
}
unsuccessful {
coverityPost condition: 'unsuccessful'
}
}
} // stage('Coverity on CentOS 7')
stage('Functional on CentOS 7') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_FUNCTIONAL_VM9_LABEL
}
steps {
functionalTest inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version),
test_function: 'runTestFunctionalV2'
}
post {
always {
functionalTestPostV2()
}
}
} // stage('Functional on CentOS 7')
stage('Functional on CentOS 8 with Valgrind') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_FUNCTIONAL_VM9_LABEL
}
steps {
functionalTest inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version),
test_function: 'runTestFunctionalV2'
}
post {
always {
functionalTestPostV2()
}
}
} // stage('Functional on CentOS 8 with Valgrind')
stage('Functional on CentOS 8') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_FUNCTIONAL_VM9_LABEL
}
steps {
functionalTest inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version),
test_function: 'runTestFunctionalV2'
}
post {
always {
functionalTestPostV2()
}
}
} // stage('Functional on CentOS 8')
stage('Functional on Leap 15') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_FUNCTIONAL_VM9_LABEL
}
steps {
functionalTest inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version),
test_function: 'runTestFunctionalV2'
}
post {
always {
functionalTestPostV2()
}
} // post
} // stage('Functional on Leap 15')
stage('Functional on Ubuntu 20.04') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_FUNCTIONAL_VM9_LABEL
}
steps {
functionalTest inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version),
test_function: 'runTestFunctionalV2'
}
post {
always {
functionalTestPostV2()
}
} // post
} // stage('Functional on Ubuntu 20.04')
stage('Test CentOS 7 RPMs') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_UNIT_VM1_LABEL
}
steps {
testRpm inst_repos: daosRepos(),
daos_pkg_version: daosPackagesVersion(next_version)
}
} // stage('Test CentOS 7 RPMs')
stage('Test CentOS 8.3.2011 RPMs') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_UNIT_VM1_LABEL
}
steps {
testRpm inst_repos: daosRepos(),
target: 'el8.3',
daos_pkg_version: daosPackagesVersion("centos8", next_version)
}
} // stage('Test CentOS 7 RPMs')
stage('Test Leap 15.2 RPMs') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_UNIT_VM1_LABEL
}
steps {
testRpm inst_repos: daosRepos(),
target: 'leap15.2',
daos_pkg_version: daosPackagesVersion(next_version)
}
} // stage('Test Leap 15 RPMs')
stage('Scan CentOS 7 RPMs') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_UNIT_VM1_LABEL
}
steps {
scanRpms inst_repos: daosRepos(),
daos_pkg_version: daosPackagesVersion(next_version)
}
post {
always {
junit 'maldetect.xml'
}
}
} // stage('Scan CentOS 7 RPMs')
stage('Scan CentOS 8 RPMs') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_UNIT_VM1_LABEL
}
steps {
scanRpms inst_repos: daosRepos(),
daos_pkg_version: daosPackagesVersion(next_version)
}
post {
always {
junit 'maldetect.xml'
}
}
} // stage('Scan CentOS 8 RPMs')
stage('Scan Leap 15 RPMs') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
label params.CI_UNIT_VM1_LABEL
}
steps {
scanRpms inst_repos: daosRepos(),
daos_pkg_version: daosPackagesVersion(next_version)
}
post {
always {
junit 'maldetect.xml'
}
}
} // stage('Scan Leap 15 RPMs')
stage('Fault injection testing') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
dockerfile {
filename 'utils/docker/Dockerfile.centos.7'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs(repo_type: 'stable',
deps_build: true)
args '--tmpfs /mnt/daos_0'
}
}
steps {
sconsBuild parallel_build: true,
scons_exe: 'scons-3',
scons_args: "PREFIX=/opt/daos TARGET_TYPE=release BUILD_TYPE=debug",
build_deps: "no"
sh (script:"""./utils/docker_nlt.sh --class-name centos7.fault-injection fi""",
label: 'Fault injection testing using NLT')
}
post {
always {
discoverGitReferenceBuild referenceJob: 'daos-stack/daos/master',
scm: 'daos-stack/daos'
recordIssues enabledForFailure: true,
failOnError: false,
ignoreFailedBuilds: true,
ignoreQualityGate: true,
qualityGates: [[threshold: 1, type: 'TOTAL_ERROR'],
[threshold: 1, type: 'TOTAL_HIGH'],
[threshold: 1, type: 'NEW_NORMAL', unstable: true],
[threshold: 1, type: 'NEW_LOW', unstable: true]],
tools: [issues(pattern: 'nlt-errors.json',
name: 'Fault injection issues',
id: 'Fault_Injection'),
issues(pattern: 'nlt-client-leaks.json',
name: 'Fault injection leaks',
id: 'NLT_client')]
junit testResults: 'nlt-junit.xml'
archiveArtifacts artifacts: 'nlt_logs/centos7.fault-injection/'
}
}
} // stage('Fault inection testing')
} // parallel
} // stage('Test')
stage('Test Storage Prep') {
when {
beforeAgent true
expression { params.CI_STORAGE_PREP_LABEL != '' }
}
agent {
label params.CI_STORAGE_PREP_LABEL
}
steps {
storagePrepTest inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version)
}
} // stage('Test Storage Prep')
stage('Test Hardware') {
when {
beforeAgent true
expression { ! skipStage() }
}
parallel {
stage('Functional Hardware Small') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
// 2 node cluster with 1 IB/node + 1 test control node
label params.CI_NVME_3_LABEL
}
steps {
functionalTest inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version),
test_function: 'runTestFunctionalV2'
}
post {
always {
functionalTestPostV2()
}
}
} // stage('Functional_Hardware_Small')
stage('Functional Hardware Medium') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
// 4 node cluster with 2 IB/node + 1 test control node
label params.CI_NVME_5_LABEL
}
steps {
functionalTest inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version),
test_function: 'runTestFunctionalV2'
}
post {
always {
functionalTestPostV2()
}
}
} // stage('Functional_Hardware_Medium')
stage('Functional Hardware Large') {
when {
beforeAgent true
expression { ! skipStage() }
}
agent {
// 8+ node cluster with 1 IB/node + 1 test control node
label params.CI_NVME_9_LABEL
}
steps {
functionalTest inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version),
test_function: 'runTestFunctionalV2'
}