forked from daos-stack/daos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
1325 lines (1302 loc) · 60.9 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
/* groovylint-disable-next-line LineLength */
/* groovylint-disable DuplicateMapLiteral, DuplicateNumberLiteral */
/* groovylint-disable DuplicateStringLiteral, NestedBlockDepth, VariableName */
/* Copyright 2019-2024 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') _
/* groovylint-disable-next-line CompileStatic */
job_status_internal = [:]
// groovylint-disable-next-line MethodParameterTypeRequired, NoDef
void job_status_update(String name=env.STAGE_NAME, def value=currentBuild.currentResult) {
jobStatusUpdate(job_status_internal, name, value)
}
// groovylint-disable-next-line MethodParameterTypeRequired, NoDef
void job_step_update(def value=currentBuild.currentResult) {
// job_status_update(env.STAGE_NAME, value)
jobStatusUpdate(job_status_internal, env.STAGE_NAME, value)
}
Map nlt_test() {
// groovylint-disable-next-line NoJavaUtilDate
Date startDate = new Date()
try {
unstash('nltr')
} catch (e) {
print 'Unstash failed, results from NLT stage will not be included'
}
sh label: 'Fault injection testing using NLT',
script: './ci/docker_nlt.sh --class-name el8.fault-injection fi'
List filesList = []
filesList.addAll(findFiles(glob: '*.memcheck.xml'))
int vgfail = 0
int vgerr = 0
if (filesList) {
String rcs = sh label: 'Check for Valgrind errors',
script: "grep -E '<error( |>)' ${filesList.join(' ')} || true",
returnStdout: true
if (rcs) {
vfail = 1
}
String suite = sanitizedStageName()
junitSimpleReport suite: suite,
file: suite + '_valgrind_results.xml',
fails: vgfail,
errors: vgerr,
name: 'Valgrind_Memcheck',
class: 'Valgrind',
message: 'Valgrind Memcheck error detected',
testdata: rcs
}
int runTime = durationSeconds(startDate)
Map runData = ['nlttest_time': runTime]
return runData
}
// For master, this is just some wildly high number
String 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
String 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.startsWith('feature/') &&
!env.BRANCH_NAME.startsWith('ci-') &&
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
Integer getuid() {
if (cached_uid == 0) {
cached_uid = sh(label: 'getuid()',
script: 'id -u',
returnStdout: true).trim()
}
return cached_uid
}
void fixup_rpmlintrc() {
if (env.SCONS_FAULTS_ARGS != 'BUILD_TYPE=dev') {
return
}
List go_bins = ['/usr/bin/dmg',
'/usr/bin/daos',
'/usr/bin/daos_agent',
'/usr/bin/hello_drpc',
'/usr/bin/daos_firmware',
'/usr/bin/daos_admin',
'/usr/bin/daos_server',
'/usr/bin/ddb']
String content = readFile(file: 'utils/rpms/daos.rpmlintrc') + '\n\n' +
'# https://daosio.atlassian.net/browse/DAOS-11534\n'
go_bins.each { bin ->
content += 'addFilter("W: position-independent-executable-suggested ' + bin + '")\n'
}
writeFile(file: 'utils/rpms/daos.rpmlintrc', text: content)
}
String vm9_label(String distro) {
return cachedCommitPragma(pragma: distro + '-VM9-label',
def_val: cachedCommitPragma(pragma: 'VM9-label',
def_val: params.FUNCTIONAL_VM_LABEL))
}
void rpm_test_post(String stage_name, String node) {
sh label: 'Fetch and stage artifacts',
script: 'hostname; ssh -i ci_key jenkins@' + node + ' ls -ltar /tmp; mkdir -p "' + env.STAGE_NAME + '/" && ' +
'scp -i ci_key jenkins@' + node + ':/tmp/{{suite_dmg,daos_{server_helper,{control,agent}}}.log,daos_server.log.*} "' +
env.STAGE_NAME + '/"'
archiveArtifacts artifacts: env.STAGE_NAME + '/**'
job_status_update()
}
/**
* Update default commit pragmas based on files modified.
*/
Map update_default_commit_pragmas() {
String default_pragmas_str = sh(script: 'ci/gen_commit_pragmas.py --target origin/' + target_branch,
returnStdout: true).trim()
println("pragmas from gen_commit_pragmas.py:")
println(default_pragmas_str)
if (default_pragmas_str) {
updatePragmas(default_pragmas_str, false)
}
}
pipeline {
agent { label 'lightweight' }
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')
REPO_FILE_URL = repoFileUrl(env.REPO_FILE_URL)
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',
/* groovylint-disable-next-line UnnecessaryGetter */
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: 'TestNvme',
// defaultValue: '',
// description: 'The launch.py --nvme argument to use for the Functional test ' +
// 'stages of this run (i.e. auto, auto_md_on_ssd, auto:-3DNAND, ' +
// '0000:81:00.0, etc.). Does not apply to MD on SSD stages.')
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.')
string(name: 'TestProvider',
defaultValue: '',
description: 'Test-provider to use for the non-Provider Functional Hardware test ' +
'stages. Specifies the default provider to use the daos_server ' +
'config file when running functional tests (the launch.py ' +
'--provider argument; i.e. "ucx+dc_x", "ofi+verbs", "ofi+tcp")')
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')
// TODO: add parameter support for per-distro CI_PR_REPOS
string(name: 'CI_PR_REPOS',
defaultValue: '',
description: 'Additional repository used for locating packages for the build and ' +
'test nodes, in the project@PR-number[:build] format.')
string(name: 'CI_HARDWARE_DISTRO',
defaultValue: '',
description: 'Distribution to use for CI Hardware Tests')
string(name: 'CI_EL8_TARGET',
defaultValue: '',
description: 'Image to used for EL 8 CI tests. I.e. el8, el8.3, etc.')
string(name: 'CI_EL9_TARGET',
defaultValue: '',
description: 'Image to used for EL 9 CI tests. I.e. el9, el9.1, 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_el8_NOBUILD',
defaultValue: false,
description: 'Do not build RPM packages for EL 8')
booleanParam(name: 'CI_RPM_el9_NOBUILD',
defaultValue: false,
description: 'Do not build RPM packages for EL 9')
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 Test on EL 8 test stage')
booleanParam(name: 'CI_UNIT_TEST_MEMCHECK',
defaultValue: true,
description: 'Run the Unit Test with memcheck on EL 8 test stage')
booleanParam(name: 'CI_FI_el8_TEST',
defaultValue: true,
description: 'Run the Fault injection testing on EL 8 test stage')
booleanParam(name: 'CI_MORE_FUNCTIONAL_PR_TESTS',
defaultValue: false,
description: 'Enable more distros for functional CI tests')
booleanParam(name: 'CI_FUNCTIONAL_el8_VALGRIND_TEST',
defaultValue: false,
description: 'Run the Functional on EL 8 with Valgrind test stage')
booleanParam(name: 'CI_FUNCTIONAL_el8_TEST',
defaultValue: true,
description: 'Run the Functional on EL 8 test stage')
booleanParam(name: 'CI_FUNCTIONAL_el9_TEST',
defaultValue: true,
description: 'Run the Functional on EL 9 test stage')
booleanParam(name: 'CI_FUNCTIONAL_leap15_TEST',
defaultValue: true,
description: 'Run the Functional on Leap 15 test stage' +
' Requires CI_MORE_FUNCTIONAL_PR_TESTS')
booleanParam(name: 'CI_FUNCTIONAL_ubuntu20_TEST',
defaultValue: false,
description: 'Run the Functional on Ubuntu 20.04 test stage' +
' Requires CI_MORE_FUNCTIONAL_PR_TESTS')
booleanParam(name: 'CI_medium_TEST',
defaultValue: true,
description: 'Run the Functional Hardware Medium test stage')
booleanParam(name: 'CI_medium_md_on_ssd_TEST',
defaultValue: true,
description: 'Run the Functional Hardware Medium MD on SSD test stage')
booleanParam(name: 'CI_medium_vmd_TEST',
defaultValue: true,
description: 'Run the Functional Hardware Medium VMD test stage')
booleanParam(name: 'CI_medium_verbs_provider_TEST',
defaultValue: true,
description: 'Run the Functional Hardware Medium Verbs Provider test stage')
booleanParam(name: 'CI_medium_verbs_provider_md_on_ssd_TEST',
defaultValue: true,
description: 'Run the Functional Hardware Medium Verbs Provider MD on SSD test stage')
booleanParam(name: 'CI_medium_ucx_provider_TEST',
defaultValue: true,
description: 'Run the Functional Hardware Medium UCX Provider test stage')
booleanParam(name: 'CI_large_TEST',
defaultValue: true,
description: 'Run the Functional Hardware Large test stage')
booleanParam(name: 'CI_large_md_on_ssd_TEST',
defaultValue: true,
description: 'Run the Functional Hardware Large MD on SSD test stage')
string(name: 'CI_UNIT_VM1_LABEL',
defaultValue: 'ci_vm1',
description: 'Label to use for 1 VM node unit and RPM tests')
string(name: 'CI_UNIT_VM1_NVME_LABEL',
defaultValue: 'ci_ssd_vm1',
description: 'Label to use for 1 VM node unit tests that need NVMe')
string(name: 'FUNCTIONAL_VM_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: 'FUNCTIONAL_HARDWARE_MEDIUM_LABEL',
defaultValue: 'ci_nvme5',
description: 'Label to use for the Functional Hardware Medium (MD on SSD) stages')
string(name: 'FUNCTIONAL_HARDWARE_MEDIUM_VERBS_PROVIDER_LABEL',
defaultValue: 'ci_nvme5',
description: 'Label to use for 5 node Functional Hardware Medium Verbs Provider (MD on SSD) stages')
string(name: 'FUNCTIONAL_HARDWARE_MEDIUM_VMD_LABEL',
defaultValue: 'ci_vmd5',
description: 'Label to use for the Functional Hardware Medium VMD stage')
string(name: 'FUNCTIONAL_HARDWARE_MEDIUM_UCX_PROVIDER_LABEL',
defaultValue: 'ci_ofed5',
description: 'Label to use for 5 node Functional Hardware Medium UCX Provider stage')
string(name: 'FUNCTIONAL_HARDWARE_LARGE_LABEL',
defaultValue: 'ci_nvme9',
description: 'Label to use for 9 node Functional Hardware Large (MD on SSD) stages')
string(name: 'CI_STORAGE_PREP_LABEL',
defaultValue: '',
description: 'Label for cluster to do a DAOS Storage Preparation')
string(name: 'CI_PROVISIONING_POOL',
defaultValue: '',
description: 'The pool of images to provision test nodes from')
string(name: 'CI_BUILD_DESCRIPTION',
defaultValue: '',
description: 'A description of the build')
}
stages {
stage('Set Description') {
steps {
script {
if (params.CI_BUILD_DESCRIPTION) {
buildDescription params.CI_BUILD_DESCRIPTION
}
}
}
}
stage('Prepare Environment Variables') {
// TODO: Could/should these be moved to the environment block?
parallel {
stage('Get Commit Message') {
steps {
pragmasToEnv()
update_default_commit_pragmas()
}
}
stage('Determine Release Branch') {
steps {
script {
env.RELEASE_BRANCH = releaseBranch()
echo 'Release branch == ' + env.RELEASE_BRANCH
}
}
}
}
}
stage('Check PR') {
when { changeRequest() }
parallel {
stage('Used Required Git Hooks') {
steps {
catchError(stageResult: 'UNSTABLE', buildResult: 'SUCCESS',
message: 'PR did not get committed with required git hooks. ' +
'Please see utils/githooks/README.md.') {
sh 'if ! ' + cachedCommitPragma('Required-githooks', 'false') + '''; then
echo 'PR did not get committed with required git hooks. ' +
'Please see utils/githooks/README.md.'
exit 1
fi'''
}
}
post {
unsuccessful {
echo 'PR did not get committed with required git hooks. ' +
'Please see utils/githooks/README.md.'
}
}
} // stage('Used Required Git Hooks')
stage('Branch name check') {
when { changeRequest() }
steps {
script {
if (env.CHANGE_ID.toInteger() > 9742 && !env.CHANGE_BRANCH.contains('/')) {
error('Your PR branch name does not follow the rules. Please rename it ' +
'according to the rules described here: ' +
'https://daosio.atlassian.net/l/cp/UP1sPTvc#branch_names. ' +
'Once you have renamed your branch locally to match the ' +
'format, close this PR and open a new one using the newly renamed ' +
'local branch.')
}
}
}
}
} // parallel
} // stage('Check PR')
stage('Cancel Previous Builds') {
when {
beforeAgent true
expression { !skipStage() }
}
steps {
cancelPreviousBuilds()
}
}
stage('Pre-build') {
when {
beforeAgent true
expression { !skipStage() }
}
parallel {
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 {
job_step_update(pythonBanditCheck())
}
post {
always {
// Bandit will have empty results if it does not
// find any issues.
junit testResults: 'bandit.xml',
allowEmptyResults: true
job_status_update()
}
}
} // 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 EL 8') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
dockerfile {
filename 'packaging/Dockerfile.mockbuild'
dir 'utils/rpms'
label 'docker_runner'
args '--group-add mock' +
' --cap-add=SYS_ADMIN' +
' -v /scratch:/scratch'
additionalBuildArgs dockerBuildArgs()
}
}
steps {
job_step_update(buildRpm())
}
post {
success {
fixup_rpmlintrc()
buildRpmPost condition: 'success', rpmlint: true
}
unstable {
buildRpmPost condition: 'unstable'
}
failure {
buildRpmPost condition: 'failure'
}
unsuccessful {
buildRpmPost condition: 'unsuccessful'
}
cleanup {
buildRpmPost condition: 'cleanup'
job_status_update()
}
}
}
stage('Build RPM on EL 9') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
dockerfile {
filename 'packaging/Dockerfile.mockbuild'
dir 'utils/rpms'
label 'docker_runner'
args '--group-add mock' +
' --cap-add=SYS_ADMIN' +
' -v /scratch:/scratch'
additionalBuildArgs dockerBuildArgs()
}
}
steps {
job_step_update(buildRpm())
}
post {
success {
fixup_rpmlintrc()
buildRpmPost condition: 'success', rpmlint: true
}
unstable {
buildRpmPost condition: 'unstable'
}
failure {
buildRpmPost condition: 'failure'
}
unsuccessful {
buildRpmPost condition: 'unsuccessful'
}
cleanup {
buildRpmPost condition: 'cleanup'
job_status_update()
}
}
}
stage('Build RPM on Leap 15.5') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
dockerfile {
filename 'packaging/Dockerfile.mockbuild'
dir 'utils/rpms'
label 'docker_runner'
args '--group-add mock' +
' --cap-add=SYS_ADMIN' +
' -v /scratch:/scratch'
additionalBuildArgs dockerBuildArgs()
}
}
steps {
job_step_update(buildRpm())
}
post {
success {
fixup_rpmlintrc()
buildRpmPost condition: 'success', rpmlint: true
}
unstable {
buildRpmPost condition: 'unstable'
}
failure {
buildRpmPost condition: 'failure'
}
unsuccessful {
buildRpmPost condition: 'unsuccessful'
}
cleanup {
buildRpmPost condition: 'cleanup'
job_status_update()
}
}
}
stage('Build DEB on Ubuntu 20.04') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
dockerfile {
filename 'packaging/Dockerfile.ubuntu.20.04'
dir 'utils/rpms'
label 'docker_runner'
args '--cap-add=SYS_ADMIN'
additionalBuildArgs dockerBuildArgs()
}
}
steps {
job_step_update(buildRpm())
}
post {
success {
buildRpmPost condition: 'success'
}
unstable {
buildRpmPost condition: 'unstable'
}
failure {
buildRpmPost condition: 'failure'
}
unsuccessful {
buildRpmPost condition: 'unsuccessful'
}
cleanup {
buildRpmPost condition: 'cleanup'
job_status_update()
}
}
}
stage('Build on EL 8') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
dockerfile {
filename 'utils/docker/Dockerfile.el.8'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs(repo_type: 'stable',
deps_build: true,
parallel_build: true) +
" -t ${sanitized_JOB_NAME}-el8 " +
' --build-arg REPOS="' + prRepos() + '"'
}
}
steps {
job_step_update(
sconsBuild(parallel_build: true,
stash_files: 'ci/test_files_to_stash.txt',
build_deps: 'no',
stash_opt: true,
scons_args: sconsFaultsArgs() +
' PREFIX=/opt/daos TARGET_TYPE=release'))
}
post {
unsuccessful {
sh '''if [ -f config.log ]; then
mv config.log config.log-el8-gcc
fi'''
archiveArtifacts artifacts: 'config.log-el8-gcc',
allowEmptyArchive: true
}
cleanup {
job_status_update()
}
}
}
stage('Build on EL 8 Bullseye') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
dockerfile {
filename 'utils/docker/Dockerfile.el.8'
label 'docker_runner'
additionalBuildArgs dockerBuildArgs(repo_type: 'stable',
deps_build: true,
parallel_build: true) +
" -t ${sanitized_JOB_NAME}-el8 " +
' --build-arg BULLSEYE=' + env.BULLSEYE +
' --build-arg REPOS="' + prRepos() + '"'
}
}
steps {
job_step_update(
sconsBuild(parallel_build: true,
stash_files: 'ci/test_files_to_stash.txt',
build_deps: 'yes',
stash_opt: true,
scons_args: sconsFaultsArgs() +
' PREFIX=/opt/daos TARGET_TYPE=release'))
}
post {
unsuccessful {
sh label: 'Save failed Bullseye logs',
script: '''if [ -f config.log ]; then
mv config.log config.log-el8-covc
fi'''
archiveArtifacts artifacts: 'config.log-el8-covc',
allowEmptyArchive: true
}
cleanup {
job_status_update()
}
}
}
stage('Build on Leap 15.5 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',
parallel_build: true,
deps_build: true) +
" -t ${sanitized_JOB_NAME}-leap15" +
' --build-arg COMPILER=icc'
}
}
steps {
job_step_update(
sconsBuild(parallel_build: true,
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
}
cleanup {
job_status_update()
}
}
}
}
}
stage('Unit Tests') {
when {
beforeAgent true
expression { !skipStage() }
}
parallel {
stage('Unit Test on EL 8.8') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label cachedCommitPragma(pragma: 'VM1-label', def_val: params.CI_UNIT_VM1_LABEL)
}
steps {
job_step_update(
unitTest(timeout_time: 60,
unstash_opt: true,
inst_repos: prRepos(),
inst_rpms: unitPackages()))
}
post {
always {
unitTestPost artifacts: ['unit_test_logs/']
job_status_update()
}
}
}
stage('Unit Test bdev on EL 8.8') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label params.CI_UNIT_VM1_NVME_LABEL
}
steps {
job_step_update(
unitTest(timeout_time: 60,
unstash_opt: true,
inst_repos: prRepos(),
inst_rpms: unitPackages()))
}
post {
always {
unitTestPost artifacts: ['unit_test_bdev_logs/']
job_status_update()
}
}
}
stage('NLT on EL 8.8') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label params.CI_NLT_1_LABEL
}
steps {
job_step_update(
unitTest(timeout_time: 60,
inst_repos: prRepos(),
test_script: 'ci/unit/test_nlt.sh',
unstash_opt: true,
unstash_tests: false,
inst_rpms: unitPackages()))
// recordCoverage(tools: [[parser: 'COBERTURA', pattern:'nltir.xml']],
// skipPublishingChecks: true,
// id: 'tlc', name: 'Fault Injection Interim Report')
stash(name:'nltr', includes:'nltr.json', allowEmpty: true)
}
post {
always {
unitTestPost artifacts: ['nlt_logs/'],
testResults: 'nlt-junit.xml',
always_script: 'ci/unit/test_nlt_post.sh',
valgrind_stash: 'el8-gcc-nlt-memcheck'
recordIssues enabledForFailure: true,
failOnError: false,
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')
job_status_update()
}
}
}
stage('Unit Test Bullseye on EL 8.8') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label cachedCommitPragma(pragma: 'VM1-label', def_val: params.CI_UNIT_VM1_LABEL)
}
steps {
job_step_update(
unitTest(timeout_time: 60,
unstash_opt: true,
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/**']
job_status_update()
}
}
} // stage('Unit test Bullseye on EL 8.8')
stage('Unit Test with memcheck on EL 8.8') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label cachedCommitPragma(pragma: 'VM1-label', def_val: params.CI_UNIT_VM1_LABEL)
}
steps {
job_step_update(
unitTest(timeout_time: 60,
unstash_opt: true,
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: 'el8-gcc-unit-memcheck'
job_status_update()
}
}
} // stage('Unit Test with memcheck on EL 8.8')
stage('Unit Test bdev with memcheck on EL 8.8') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label params.CI_UNIT_VM1_NVME_LABEL
}
steps {
job_step_update(
unitTest(timeout_time: 60,
unstash_opt: true,
ignore_failure: true,
inst_repos: prRepos(),
inst_rpms: unitPackages()))
}
post {
always {
unitTestPost artifacts: ['unit_test_memcheck_bdev_logs.tar.gz',
'unit_test_memcheck_bdev_logs/**/*.log'],
valgrind_stash: 'el8-gcc-unit-memcheck-bdev'
job_status_update()
}
}
} // stage('Unit Test bdev with memcheck on EL 8')
}
}
stage('Test') {
when {
beforeAgent true
expression { !skipStage() }
}
parallel {
stage('Functional on EL 8.8 with Valgrind') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label params.CI_FUNCTIONAL_VM9_LABEL
}
steps {
job_step_update(
functionalTest(
inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version, 'tests-internal'),
test_function: 'runTestFunctionalV2'))
}
post {
always {
functionalTestPostV2()
job_status_update()
}
}
} // stage('Functional on EL 8.8 with Valgrind')
stage('Functional on EL 8.8') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label vm9_label('EL8')
}
steps {
job_step_update(
functionalTest(
inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version, 'tests-internal'),
test_function: 'runTestFunctionalV2'))
}
post {
always {
functionalTestPostV2()
job_status_update()
}
}
} // stage('Functional on EL 8.8')
stage('Functional on EL 9') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label vm9_label('EL9')
}
steps {
job_step_update(
functionalTest(
inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version, 'tests-internal'),
test_function: 'runTestFunctionalV2'))
}
post {
always {
functionalTestPostV2()
job_status_update()
}
}
} // stage('Functional on EL 9')
stage('Functional on Leap 15.5') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label vm9_label('Leap15')
}
steps {
job_step_update(
functionalTest(
inst_repos: daosRepos(),
inst_rpms: functionalPackages(1, next_version, 'tests-internal'),
test_function: 'runTestFunctionalV2'))
}
post {
always {
functionalTestPostV2()
job_status_update()
}
} // post
} // stage('Functional on Leap 15.5')
stage('Functional on Ubuntu 20.04') {
when {
beforeAgent true
expression { !skipStage() }
}
agent {
label vm9_label('Ubuntu')
}
steps {
job_step_update(
functionalTest(