-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
206 lines (190 loc) · 7 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
def SDACCEL_WRAPPER_VERSION = ''
pipeline {
agent { label "master" }
parameters {
string(name: 'SDACCEL_WRAPPER_VERSION', defaultValue: '')
booleanParam(name: 'FORCE_HARDWARE_TEST', defaultValue: false, description: 'Force this to build hardware if on master.')
booleanParam(name: 'UPLOAD', defaultValue: true, description: 'Upload this after building')
booleanParam(name: 'SIMULATE', defaultValue: false, description: 'Force a simulation')
booleanParam(name: 'DEPLOY', defaultValue: false, description: 'Force a deploy for testing')
}
environment {
VERSION = "${env.BRANCH_NAME}"
AWS_DEFAULT_REGION = "us-east-1"
}
options {
buildDiscarder(logRotator(daysToKeepStr: '', numToKeepStr: '20'))
disableConcurrentBuilds()
}
post {
failure {
slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
success {
slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
stages {
stage("notify") {
steps {
slackSend (color: '#FFFF00', message: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
stage('config') {
steps {
script {
if(params.SDACCEL_WRAPPER_VERSION == ''){
SDACCEL_WRAPPER_VERSION = sh (returnStdout: true, script: 'make print-SDACCEL_WRAPPER_VERSION').trim()
}else{
SDACCEL_WRAPPER_VERSION = params.SDACCEL_WRAPPER_VERSION
}
echo "${SDACCEL_WRAPPER_VERSION}"
}
}
}
stage('install') {
steps {
sh 'docker-compose build'
}
}
stage('pre clean') {
steps {
sh 'git clean -fdx'
sh 'docker-compose run --rm test make clean'
}
}
stage('lint') {
steps {
sh 'docker-compose run --rm test make lint'
}
}
stage('build dist images') {
steps {
sh "make SDACCEL_WRAPPER_VERSION=${SDACCEL_WRAPPER_VERSION} docker-image"
}
}
stage('test go') {
steps {
sh "docker-compose run --rm test make test"
}
}
stage('deploy examples') {
when {
expression { env.BRANCH_NAME in ["auto", "rollup", "try"] || params.SIMULATE || params.DEPLOY || params.FORCE_HARDWARE_TEST}
}
steps {
sh "make SDACCEL_WRAPPER_VERSION=${SDACCEL_WRAPPER_VERSION} VERSION=${env.VERSION} aws"
}
}
stage('test simulation') {
when {
expression { env.BRANCH_NAME in ["auto", "rollup", "try"] || params.SIMULATE || params.FORCE_HARDWARE_TEST }
}
steps {
parallel "histogram array": {
dir('examples/histogram-array'){
sh '../../reco-aws/reco-aws test test-histogram'
}
},
addition: {
dir('examples/addition'){
sh '../../reco-aws/reco-aws test test-addition'
}
},
memcopy: {
dir('examples/memcopy'){
sh '../../reco-aws/reco-aws test test-memcopy'
}
},
regression: {
dir('examples/regression'){
sh '../../reco-aws/reco-aws test test-regression'
}
},
popcount: {
dir('examples/popcount'){
sh '../../reco-aws/reco-aws test test-popcount'
}
},
"parallel histogram": {
dir('examples/histogram-parallel'){
sh '../../reco-aws/reco-aws test test-histogram'
}
},
"md5": {
dir('examples/md5'){
sh '../../reco-aws/reco-aws test test-md5'
}
},
"memory benchmark": {
dir('examples/memory-benchmark'){
sh '../../reco-aws/reco-aws test test-memory-benchmark'
}
},
"smi single access": {
dir('examples/smi-single-access'){
sh '../../reco-aws/reco-aws test smi-single-access-test'
}
},
"smi burst access": {
dir('examples/smi-burst-access'){
sh '../../reco-aws/reco-aws test smi-burst-access-test'
}
}
}
}
stage('test hw builds') {
when {
expression { (env.BRANCH_NAME in ["auto", "rollup", "try"] || params.FORCE_HARDWARE_TEST) && !params.TEST_AFI}
}
steps {
parallel "histogram array": {
sh './ci/test_afi_generation.sh histogram-array test-histogram histogram "`git rev-parse HEAD`"'
},
"memory benchmark": {
sh './ci/test_afi_generation.sh memory-benchmark test-memory-benchmark memory-benchmark "`git rev-parse HEAD`"'
},
memcopy: {
sh './ci/test_afi_generation.sh memcopy test-memcopy memcopy "`git rev-parse HEAD`"'
}
}
}
// We'll upload from auto, which if merged, will have the same SHA as master
stage('show benchmarks'){
when {
expression { env.BRANCH_NAME in ["auto", "rollup", "try"] }
}
steps {
sh 'cat bench_tmp/* | ./benchmarks/log2csv -'
sh './ci/upload_benchmarks.sh'
}
}
// We'll only publish benchmarks from master
stage('trigger benchmarks job'){
when {
expression { env.BRANCH_NAME in ["master"] }
}
steps {
build job: 'reco-sdaccel-publish-benchmarks', wait: false
}
}
stage('build') {
steps {
sh "make SDACCEL_WRAPPER_VERSION=${SDACCEL_WRAPPER_VERSION} VERSION=${env.VERSION}"
}
}
stage('upload') {
when {
expression { env.BRANCH_NAME in ["master"] && env.UPLOAD}
}
steps {
sh "make SDACCEL_WRAPPER_VERSION=${SDACCEL_WRAPPER_VERSION} VERSION=${env.VERSION} upload"
}
}
stage('clean') {
steps {
sh 'make clean'
}
}
}
}