-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.core
160 lines (151 loc) · 7.86 KB
/
Jenkinsfile.core
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
@Library('SPiFI-1.2.1') _
properties([
[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false]
])
node("${params.P_NODE_LABEL}") {
//TODO: This needs to accept parameters and setup/load accordingly
//TODO: Use a package manager instead of modules?
withEnv(["INSTALL_DIR=$WORKSPACE/sst-core-install",
"SST_CORE_MODULES=module load mpi/openmpi-2.1.3 glpk/glpk-4.54 metis/metis-5.1.0 &> SST_CORE_MODULES.out"]) {
stage('Cloning') {
sh 'echo "----"; env | grep "P_" || true; echo "----"'
if (params.P_CLEAN) {
sh 'rm -rf sst-core; rm -rf sst-core-install'
}
String[] sstsimulatorRepos = ['sst-core']
String[] sstsimulatorBranches = ['devel']
def git_helper = new gov.sandia.sems.spifi.Git()
sstsimulatorRepos.eachWithIndex {repo, i ->
println "Cloning: $repo:" + sstsimulatorBranches[i]
git_helper.clone(env: this,
dir: repo,
url: "https://github.com/sstsimulator/" + repo + ".git",
branch: sstsimulatorBranches[i],
retries: 3,
retry_delay: 30,
timeout: 30,
timeout_units: "MINUTES",
verbose: true)
}
}
stage('Download artifacts') {
if (params.P_DOWNLOAD_ARTIFACTS) {
//TODO
}
}
stage('Configure') {
if (params.P_CONFIGURE) {
//TODO: Ask will about output truncation: core/115
//def shell = new gov.sandia.sems.spifi.Shell()
//def output = shell.execute(env: this,
// command: "eval $SST_CORE_MODULES; " +
// "cd sst-core; ./autogen.sh; " +
// "mkdir -p $INSTALL_DIR; " +
// "./configure --prefix=$INSTALL_DIR",
// verbose: true)
//println "Shell Output:\n" +
// "- status: ${output.status}\n" +
// "- stdout: ${output.output}\n"
//TODO: bamboo.sh: config args = --disable-silent-rules --prefix=/home/sstbuild/jenkins/workspace/SST__Nightly_Mainline_RHEL_8_OMPI-2.1.3/210_2019-12-12_04-20-04/local/sst-core --with-zoltan=/home/sstbuild/jenkins/workspace/SST__Nightly_Mainline_RHEL_8_OMPI-2.1.3/210_2019-12-12_04-20-04/local/packages/Zoltan CC=/usr/bin/gcc CXX=/usr/bin/g++ MPICC=/usr/local/module-pkgs/mpi/OpenMPI/openmpi-2.1.3/bin/mpicc MPICXX=/usr/local/module-pkgs/mpi/OpenMPI/openmpi-2.1.3/bin/mpicxx
sh '''
eval $SST_CORE_MODULES
cd sst-core
env PATH=$PATH ./autogen.sh
mkdir -p $INSTALL_DIR; ./configure --prefix=$INSTALL_DIR
'''
}
}
stage('Build') {
if (params.P_BUILD) {
sh '''
eval $SST_CORE_MODULES
cd sst-core
make -j4
'''
}
}
stage('Install') {
if (params.P_INSTALL) {
//TODO: use SPiFI shell command
sh '''
eval $SST_CORE_MODULES
cd sst-core
make -j4 install
echo "INSTALL_DIR=$INSTALL_DIR"
ls -lat $INSTALL_DIR
'''
}
}
stage('Upload artifacts') {
if (params.P_UPLOAD_ARTIFACTS) {
//TODO
//echo '[STATUS]: archiving artifacts...'
//archiveArtifacts artifacts: 'sst-core/src/sst/core/*.o, sst-core/src/sst/core/**/*.o, sst-core/src/sst/core/libltdl/.libs/*.a', fingerprint: true
}
}
stage('Test') {
if (params.P_RUN_TESTS) {
echo 'Testing...'
//sh 'cd sst-core; ./src/sst/core/sstunit -ojunit || true'
//junit 'sst-core/*.xml'
}
}
stage('Creating sub-jobs') {
// String[] sstsimulatorRepos = ['sst-core', 'sst-elements', 'sst-macro', 'sst-external-element', 'juno', 'balar']
// String[] sstsimulatorBranches = ['devel', 'devel', 'devel', 'master', 'master', 'master']
// String[] purdueaalpRepos = ['sst-gpgpusim-external']
// String[] purdueaalpBranches = ['master']
String[] sstsimulatorRepos = ['sst-elements', 'sst-macro'] //, 'sst-macro', 'sst-external-element', 'juno', 'balar'
String[] purdueaalpRepos = ['sst-gpgpusim-external']
def launcher = new gov.sandia.sems.spifi.JobLauncher(this)
//TODO: Point SST_CORE_INSTALL to proper install dir.
sstsimulatorRepos.eachWithIndex {repo, i ->
launcher.appendJob(label: repo,
job_name: "${params.SST_BASE_JOB_NAME}" + "-" + repo,
parameters: [
(string(name:"SST_CORE_INSTALL", value:"$INSTALL_DIR"+"s/34")),
(string(name:"SST_CORE_MODULES", value:"$SST_CORE_MODULES")),
(string(name:"P_NODE_LABEL", value:"${params.P_NODE_LABEL}")),
booleanParam(name:"P_DOWNLOAD_ARTIFACTS", value: "${params.P_DOWNLOAD_ARTIFACTS}"),
booleanParam(name:"P_CLEAN", value: "${params.P_CLEAN}"),
booleanParam(name:"P_CONFIGURE", value: "${params.P_CONFIGURE}"),
booleanParam(name:"P_BUILD", value: "${params.P_BUILD}"),
booleanParam(name:"P_INSTALL", value: "${params.P_INSTALL}"),
booleanParam(name:"P_UPLOAD_ARTIFACTS", value: "${params.P_UPLOAD_ARTIFACTS}"),
booleanParam(name:"P_RUN_TESTS", value: "${params.P_RUN_TESTS}"),
booleanParam(name:"P_RUN_ANALYSIS", value: "${params.P_RUN_ANALYSIS}"),
booleanParam(name:"P_DEPLOY", value: "${params.P_DEPLOY}")
]
)
//dry_run: true,
//dry_run_status: true)
}
//purdueaalpRepos.eachWithIndex {repo, i ->
// launcher.appendJob(label: repo, job_name: "$SST_BASE_JOB_NAME" + "-" + repo, dry_run: true, dry_run_status: true)
//}
launcher.printJobList()
println "lost control"
launcher.launchInParallel()
println "got control back"
def summary = launcher.getLastResultSummary()
def results_util = new gov.sandia.sems.spifi.ResultsUtility(env: this)
println results_util.genResultSummaryTable(format: "ASCII", summary: summary)
if(summary.NUMJOBS != summary.NUMSUCCESS) {
currentBuild.result = 'FAILURE'
return
}
}
stage('Analyse') {
if (params.P_RUN_ANALYSIS) {
echo 'Static Analysis...'
//TODO
}
}
stage('Deploy') {
if (params.P_DEPLOY) {
echo 'Deploying....'
//TODO
}
}
}
}