-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathJenkinsfile
More file actions
95 lines (85 loc) · 3.13 KB
/
Jenkinsfile
File metadata and controls
95 lines (85 loc) · 3.13 KB
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
#!groovy
def jobMatrix(String type, List specs) {
def nodes = [:]
for (spec in specs) {
def job = ""
def selector = ""
def os = ""
def ver = ""
def dds = ""
if (type == 'build') {
job = "${spec.os}-${spec.ver}-${spec.arch}-${spec.compiler}"
selector = "${spec.os}-${spec.ver}-${spec.arch}"
os = spec.os
ver = spec.ver
dds = spec.dds
} else { // == 'check'
job = "${spec.name}"
selector = 'fedora-39-x86_64'
os = 'fedora'
ver = '39'
dds = '3.12'
}
def label = "${job}"
def extra = spec.extra
nodes[label] = {
node(selector) {
githubNotify(context: "${label}", description: 'Building ...', status: 'PENDING')
try {
deleteDir()
checkout scm
def jobscript = 'job.sh'
def ctestcmd = "ctest -S ODCTest.cmake -VV --output-on-failure"
sh "echo \"set -e\" >> ${jobscript}"
sh "echo \"export LABEL=\\\"\${JOB_BASE_NAME} ${label}\\\"\" >> ${jobscript}"
def containercmd = "singularity exec -B/shared ${env.SINGULARITY_CONTAINER_ROOT}/odc/${os}${ver}_dds${dds}.sif bash -l -c \\\"${ctestcmd} ${extra}\\\""
sh """\
echo \"echo \\\"*** Job started at .......: \\\$(date -R)\\\"\" >> ${jobscript}
echo \"echo \\\"*** Job ID ...............: \\\${SLURM_JOB_ID}\\\"\" >> ${jobscript}
echo \"echo \\\"*** Compute node .........: \\\$(hostname -f)\\\"\" >> ${jobscript}
echo \"unset http_proxy\" >> ${jobscript}
echo \"unset HTTP_PROXY\" >> ${jobscript}
echo \"${containercmd}\" >> ${jobscript}
"""
sh "cat ${jobscript}"
sh "utils/ci/slurm-submit.sh \"ODC \${JOB_BASE_NAME} ${label}\" ${jobscript}"
deleteDir()
githubNotify(context: "${label}", description: 'Success', status: 'SUCCESS')
} catch (e) {
// def tarball = "${type}_${job}_dds_logs.tar.gz"
// if (fileExists("build/test/.DDS")) {
// sh "tar czvf ${tarball} -C \${WORKSPACE}/build/test .DDS/"
// archiveArtifacts tarball
// }
deleteDir()
githubNotify(context: "${label}", description: 'Error', status: 'ERROR')
throw e
}
}
}
}
return nodes
}
pipeline{
agent none
options { ansiColor('xterm') }
stages {
stage("CI") {
steps{
script {
def builds = jobMatrix('build', [
// [os: 'fedora', ver: '36', arch: 'x86_64', compiler: 'gcc-12', dds: '3.7.22'], // temp disable
// [os: 'fedora', ver: '37', arch: 'x86_64', compiler: 'gcc-12', dds: '3.7.22'], // broken flatbuffers detection
[os: 'fedora', ver: '38', arch: 'x86_64', compiler: 'gcc-13', dds: '3.12'],
[os: 'fedora', ver: '39', arch: 'x86_64', compiler: 'gcc-13', dds: '3.12'],
[os: 'fedora', ver: '40', arch: 'x86_64', compiler: 'gcc-14', dds: '3.12'],
])
def checks = jobMatrix('check', [
[name: 'sanitizers', extra: '-DENABLE_SANITIZERS=ON'],
])
parallel(builds + checks)
}
}
}
}
}