forked from kernelci/kernelci-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jobs.groovy
428 lines (410 loc) · 15.8 KB
/
jobs.groovy
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
def KCI_CORE_BRANCH = System.getenv("KCI_CORE_BRANCH")
def KCI_CORE_URL = System.getenv("KCI_CORE_URL")
def KCI_STORAGE_URL = System.getenv("KCI_STORAGE_URL")
def KCI_DB_CONFIG = System.getenv("KCI_DB_CONFIG")
def KCI_API_URL = System.getenv("KCI_API_URL")
def KCI_API_TOKEN_ID = System.getenv("KCI_API_TOKEN_ID")
def KCI_DOCKER_BASE = System.getenv("KCI_DOCKER_BASE")
def KCI_CONFIG_LIST = System.getenv("KCI_CONFIG_LIST")
def KCI_LABS_LIST = System.getenv("KCI_LABS_LIST")
def KCI_CALLBACK_ID = System.getenv("KCI_CALLBACK_ID")
def KCI_BISECTION_CALLBACK_ID = System.getenv("KCI_BISECTION_CALLBACK_ID")
def KCI_BISECTION_EMAIL_RECIPIENTS = System.getenv("KCI_BISECTION_EMAIL_RECIPIENTS")
def KCI_BISECTION_TREES_WHITELIST = System.getenv("KCI_BISECTION_TREES_WHITELIST")
def KCI_BISECTION_LABS_WHITELIST = System.getenv("KCI_BISECTION_LABS_WHITELIST")
def KCI_MONITOR_CRON = System.getenv("KCI_MONITOR_CRON")
def KCI_JENKINS_BRANCH = System.getenv("KCI_JENKINS_BRANCH")
def KCI_JENKINS_URL = System.getenv("KCI_JENKINS_URL")
pipelineJob('kernel-tree-monitor') {
definition {
cpsScm {
lightweight(true)
scm {
git {
branch(KCI_JENKINS_BRANCH)
remote {
url(KCI_JENKINS_URL)
}
}
}
scriptPath('jobs/monitor.jpl')
}
if (KCI_MONITOR_CRON) {
triggers {
cron(KCI_MONITOR_CRON)
}
}
}
logRotator {
daysToKeep(7)
numToKeep(200)
}
parameters {
stringParam('KCI_API_URL', KCI_API_URL, 'URL of the KernelCI back-end API.')
stringParam('KCI_API_TOKEN_ID', KCI_API_TOKEN_ID, 'Identifier of the KernelCI backend API token stored in Jenkins.')
stringParam('KCI_STORAGE_URL', KCI_STORAGE_URL, 'URL of the KernelCI storage server.')
stringParam('KCI_CORE_URL', KCI_CORE_URL, 'URL of the kernelci-core repository.')
stringParam('KCI_CORE_BRANCH', KCI_CORE_BRANCH, 'Name of the branch to use in the kernelci-core repository.')
stringParam('DOCKER_BASE', KCI_DOCKER_BASE, 'Dockerhub base address used for the build images.')
stringParam('CONFIG_LIST', KCI_CONFIG_LIST, 'List of build configs to check instead of all the ones in build-configs.yaml.')
}
}
pipelineJob('kernel-build-trigger') {
definition {
cpsScm {
lightweight(true)
scm {
git {
branch(KCI_JENKINS_BRANCH)
remote {
url(KCI_JENKINS_URL)
}
}
}
scriptPath('jobs/build-trigger.jpl')
}
}
configure { project ->
project / 'properties' / 'org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty' {
'switch'('on')
}
}
logRotator {
daysToKeep(7)
numToKeep(48)
}
parameters {
stringParam('BUILD_CONFIG', '', 'Name of the build configuration.')
booleanParam('PUBLISH', true, 'Publish build results via the KernelCI backend API')
booleanParam('EMAIL', true, 'Send build results via email')
stringParam('LABS_WHITELIST', KCI_LABS_LIST, 'List of labs to include in the tests, all labs will be tested by default.')
stringParam('KCI_API_TOKEN_ID', KCI_API_TOKEN_ID, 'Identifier of the KernelCI backend API token stored in Jenkins.')
stringParam('KCI_API_URL', KCI_API_URL, 'URL of the KernelCI Backend API')
stringParam('KCI_STORAGE_URL', KCI_STORAGE_URL, 'URL of the KernelCI storage server.')
stringParam('KCI_CORE_URL', KCI_CORE_URL, 'URL of the kernelci-core repository.')
stringParam('KCI_CORE_BRANCH', KCI_CORE_BRANCH, 'Name of the branch to use in the kernelci-core repository.')
stringParam('DOCKER_BASE', KCI_DOCKER_BASE, 'Dockerhub base address used for the build images.')
booleanParam('ALLOW_REBUILD', false, 'Allow building the same revision again.')
}
}
pipelineJob('kernel-build') {
definition {
cpsScm {
lightweight(true)
scm {
git {
branch(KCI_JENKINS_BRANCH)
remote {
url(KCI_JENKINS_URL)
}
}
}
scriptPath('jobs/build.jpl')
}
}
configure { project ->
project / 'properties' / 'org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty' {
'switch'('on')
}
}
logRotator {
daysToKeep(2)
numToKeep(4096)
}
parameters {
stringParam('ARCH', '', 'CPU architecture as understood by the Linux kernel build system')
stringParam('DEFCONFIG', '', 'Linux kernel defconfig to build')
stringParam('SRC_TARBALL', '', 'URL of the kernel source tarball')
stringParam('BUILD_CONFIG', '', 'Name of the build configuration')
stringParam('GIT_DESCRIBE', '', "Output of 'git describe' at the revision of the snapshot")
stringParam('GIT_DESCRIBE_VERBOSE', '', "Verbose output of 'git describe' at the revision of the snapshot")
stringParam('COMMIT_ID', '', 'Git commit SHA1 at the revision of the snapshot')
stringParam('BUILD_ENVIRONMENT', 'gcc-8', 'Name of the build environment')
stringParam('NODE_LABEL', '', 'Label to use to choose a node on which to run this job')
booleanParam('PUBLISH', true, 'Publish build results via the KernelCI backend API')
booleanParam('EMAIL', true, 'Send build results via email')
stringParam('KCI_DB_CONFIG', KCI_DB_CONFIG, 'Value to use with the --db-config argument')
stringParam('KCI_API_URL', KCI_API_URL, 'URL of the KernelCI back-end API.')
stringParam('KCI_API_TOKEN_ID', KCI_API_TOKEN_ID, 'Identifier of the KernelCI backend API token stored in Jenkins.')
stringParam('KCI_STORAGE_URL', KCI_STORAGE_URL, 'URL of the KernelCI storage server.')
stringParam('KCI_CORE_URL', KCI_CORE_URL, 'URL of the kernelci-core repository.')
stringParam('KCI_CORE_BRANCH', KCI_CORE_BRANCH, 'Name of the branch to use in the kernelci-core repository.')
stringParam('PARALLEL_BUILDS', '4', 'Number of kernel builds to run in parallel')
stringParam('DOCKER_BASE', KCI_DOCKER_BASE, 'Dockerhub base address used for the build images.')
}
}
job('kernel-arch-complete') {
label('build-complete')
logRotator {
daysToKeep(7)
numToKeep(100)
}
wrappers {
preBuildCleanup()
credentialsBinding {
string('EMAIL_AUTH_TOKEN', KCI_API_TOKEN_ID)
}
}
parameters {
stringParam('TREE_NAME', '', 'Name of the tree to be tested')
stringParam('GIT_DESCRIBE', '', "Output of 'git describe' at the revision of the snapshot")
booleanParam('PUBLISH', true, 'Publish build results via the KernelCI backend API')
booleanParam('EMAIL', true, 'Send build results via email')
stringParam('BRANCH', '', '')
stringParam('API', KCI_API_URL, 'URL of the KernelCI backend API.')
}
steps {
shell("""
#!/bin/bash
set -e
rm -rf kernelci-jenkins
git clone --depth 1 -b ${KCI_JENKINS_BRANCH} ${KCI_JENKINS_URL}
./kernelci-jenkins/scripts/kernel-arch-complete.sh
""")
}
}
pipelineJob('test-runner') {
definition {
cpsScm {
lightweight(true)
scm {
git {
branch(KCI_JENKINS_BRANCH)
remote {
url(KCI_JENKINS_URL)
}
}
}
scriptPath('jobs/test-runner.jpl')
}
}
configure { project ->
project / 'properties' / 'org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty' {
'switch'('on')
}
}
logRotator {
daysToKeep(1)
numToKeep(1024)
}
parameters {
stringParam('LABS', '', 'Names of the labs where to submit tests')
stringParam('TRIGGER_JOB_NAME', 'kernel-build-trigger', 'Name of the parent trigger job')
stringParam('TRIGGER_JOB_NUMBER', '', 'Number of the parent trigger job')
stringParam('KCI_STORAGE_URL', KCI_STORAGE_URL, 'URL of the KernelCI storage server.')
stringParam('KCI_CORE_URL', KCI_CORE_URL, 'URL of the kernelci-core repository.')
stringParam('KCI_CORE_BRANCH', KCI_CORE_BRANCH, 'Name of the branch to use in the kernelci-core repository.')
stringParam('DOCKER_BASE', KCI_DOCKER_BASE, 'Dockerhub base address used for the build images.')
stringParam('BUILD_JOB_NAME', 'kernel-build', 'Name of the job that built the kernel')
stringParam('BUILD_JOB_NUMBER', '', 'Number of the job that built the kernel')
stringParam('CALLBACK_ID', KCI_CALLBACK_ID, 'Identifier of the callback to look up an authentication token')
stringParam('CALLBACK_URL', KCI_API_URL, 'Base URL where to send the callbacks')
}
}
pipelineJob('rootfs-build-trigger') {
definition {
cpsScm {
lightweight(true)
scm {
git {
branch(KCI_JENKINS_BRANCH)
remote {
url(KCI_JENKINS_URL)
}
}
}
scriptPath('jobs/rootfs-trigger.jpl')
}
}
configure { project ->
project / 'properties' / 'org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty' {
'switch'('on')
}
}
logRotator {
daysToKeep(7)
numToKeep(200)
}
parameters {
stringParam('KCI_CORE_URL', KCI_CORE_URL, 'URL of the kernelci-core repository.')
stringParam('KCI_CORE_BRANCH', KCI_CORE_BRANCH, 'Name of the branch to use in the kernelci-core repository.')
stringParam('DOCKER_BASE', KCI_DOCKER_BASE, 'Dockerhub base address used for the rootfs build images.')
stringParam('ROOTFS_CONFIG','','Name of the rootfs configuration, all rootfs will be built by default.')
stringParam('ROOTFS_ARCH','','Name of the rootfs arch config, all given arch will be built by default.')
}
}
pipelineJob('rootfs-builder') {
definition {
cpsScm {
lightweight(true)
scm {
git {
branch(KCI_JENKINS_BRANCH)
remote {
url(KCI_JENKINS_URL)
}
}
}
scriptPath('jobs/rootfs-builder.jpl')
}
}
configure { project ->
project / 'properties' / 'org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty' {
'switch'('on')
}
}
logRotator {
daysToKeep(7)
numToKeep(200)
}
parameters {
stringParam('KCI_API_TOKEN_ID', KCI_API_TOKEN_ID, 'Identifier of the KernelCI backend API token stored in Jenkins.')
stringParam('KCI_API_URL', KCI_API_URL, 'URL of the KernelCI Backend API')
stringParam('KCI_CORE_URL', KCI_CORE_URL, 'URL of the kernelci-core repository.')
stringParam('KCI_CORE_BRANCH', KCI_CORE_BRANCH, 'Name of the branch to use in the kernelci-core repository.')
stringParam('DOCKER_BASE', KCI_DOCKER_BASE, 'Dockerhub base address used for the rootfs build images.')
stringParam('ROOTFS_CONFIG','','Name of the rootfs configuration, all rootfs will be built by default.')
stringParam('ROOTFS_ARCH','','Name of the rootfs arch config, all given arch will be built by default.')
stringParam('ROOTFS_TYPE','debos','Name of the rootfs type which can be debos or buildroot.')
stringParam('PIPELINE_VERSION','','Unique string identifier for the series of rootfs build jobs.')
}
}
pipelineJob('lava-bisection') {
definition {
cpsScm {
lightweight(true)
scm {
git {
branch(KCI_JENKINS_BRANCH)
remote {
url(KCI_JENKINS_URL)
}
}
}
scriptPath('jobs/bisect.jpl')
}
}
configure { project ->
project / 'properties' / 'org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty' {
'switch'('on')
}
}
logRotator {
daysToKeep(7)
numToKeep(200)
}
parameters {
stringParam('KERNEL_URL', '', 'URL of the kernel Git repository')
stringParam('KERNEL_BRANCH', '', 'Name of the branch to bisect in the kernel Git repository')
stringParam('KERNEL_TREE', '', 'Name of the kernel Git repository (tree)')
stringParam('KERNEL_NAME', '', 'Identifier of the kernel (typically `git describe`)')
stringParam('GOOD_COMMIT', '', 'Good known Git revision (SHA1 or any valid reference)')
stringParam('BAD_COMMIT', '', 'Bad known Git revision (SHA1 or any valid reference)')
stringParam('REF_KERNEL_URL',
'git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git',
'URL of the reference kernel Git repository used to find merge bases')
stringParam('REF_KERNEL_BRANCH', 'master', 'Name of the branch from the reference kernel Git repository')
stringParam('REF_KERNEL_TREE', 'mainline', 'Name of the reference kernel Git repository')
stringParam('ARCH', '', 'CPU architecture as understood by the Linux kernel build system')
stringParam('DEFCONFIG', 'defconfig', 'Name of the Linux kernel defconfig')
stringParam('TARGET', '', 'Name of the device type to test (typically LAVA device type name)')
stringParam('BUILD_ENVIRONMENT', '', 'Name of the build environment')
stringParam('LAB', '', 'Name of the lab in which to run the bisection tests')
stringParam('TEST_PLAN_VARIANT', '', 'Name of the KernelCI test plan variant (e.g. baseline_qemu)')
stringParam('TEST_CASE', '', 'Test case path in dotted syntax (e.g. baseline.dmesg.crit)')
stringParam('TEST_RUNS', '1', 'Number of LAVA jobs to run before considering pass or fail.')
stringParam('LAVA_CALLBACK', KCI_BISECTION_CALLBACK_ID, 'Description of the LAVA auth token to look up and use in LAVA callbacks')
stringParam('EMAIL_RECIPIENTS', KCI_BISECTION_EMAIL_RECIPIENTS, 'List of recipients for all emails generated by this job')
stringParam('LABS_WHITELIST', KCI_BISECTION_LABS_WHITELIST, 'If defined, jobs will abort if the LAB is not on that list.')
stringParam('TREES_WHITELIST', KCI_BISECTION_TREES_WHITELIST, 'If defined, jobs will abort if the KERNEL_TREE is not on that list.')
stringParam('KCI_API_URL', KCI_API_URL, 'URL of the KernelCI back-end API.')
stringParam('KCI_API_TOKEN_ID', KCI_API_TOKEN_ID, 'Identifier of the KernelCI backend API token stored in Jenkins.')
stringParam('KCI_STORAGE_URL', KCI_STORAGE_URL, 'URL of the KernelCI storage server.')
stringParam('KCI_DB_CONFIG', KCI_DB_CONFIG, 'Value to use with the --db-config argument')
stringParam('KCI_CORE_URL', KCI_CORE_URL, 'URL of the kernelci-core repository.')
stringParam('KCI_CORE_BRANCH', KCI_CORE_BRANCH, 'Name of the branch to use in the kernelci-core repository.')
stringParam('DOCKER_BASE', KCI_DOCKER_BASE, 'Dockerhub base address used for the build images.')
}
}
matrixJob('buildroot') {
logRotator {
daysToKeep(7)
numToKeep(100)
}
scm {
git {
remote {
url('https://github.com/kernelci/buildroot.git')
}
branch('kernelci/latest')
}
}
wrappers {
credentialsBinding {
string('API_TOKEN', KCI_API_TOKEN_ID)
}
}
parameters {
stringParam('API', KCI_API_URL, 'URL of the KernelCI backend API.')
stringParam('STORAGE', KCI_STORAGE_URL, 'URL of the KernelCI storage server.')
}
axes {
label('label', 'buildroot')
text('ARCH', [
'arc', 'armeb', 'armel', 'arm64', 'arm64be', 'mipsel', 'riscv', 'x86'
])
text('FRAG', 'baseline')
}
steps {
shell("""
#!/bin/bash
set -e
rm -rf kernelci-jenkins
git clone --depth 1 -b ${KCI_JENKINS_BRANCH} ${KCI_JENKINS_URL}
export PATH=\$PWD/kernelci-jenkins/scripts:\$PATH
rm -rf output
./kernelci-jenkins/scripts/buildroot-builder.sh \$ARCH \$FRAG
""")
}
}
matrixJob('buildroot-staging') {
logRotator {
daysToKeep(7)
numToKeep(100)
}
scm {
git {
remote {
url('https://github.com/kernelci/buildroot.git')
}
branch('staging.kernelci.org')
}
}
wrappers {
credentialsBinding {
string('API_TOKEN', KCI_API_TOKEN_ID)
}
}
parameters {
stringParam('API', KCI_API_URL, 'URL of the KernelCI backend API.')
stringParam('STORAGE', KCI_STORAGE_URL, 'URL of the KernelCI storage server.')
}
axes {
label('label', 'buildroot')
text('ARCH', [
'arc', 'armeb', 'armel', 'arm64', 'arm64be', 'mipsel', 'riscv', 'x86'
])
text('FRAG', 'baseline')
}
steps {
shell("""
#!/bin/bash
set -e
rm -rf kernelci-jenkins
git clone --depth 1 -b staging.kernelci.org ${KCI_JENKINS_URL}
export PATH=\$PWD/kernelci-jenkins/scripts:\$PATH
rm -rf output
./kernelci-jenkins/scripts/buildroot-builder.sh \$ARCH \$FRAG
""")
}
}