blob: 553f02adeb1686148db77b8f2923bcef6777ec6e [file] [log] [blame]
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +00001# Auto generated by ./tcwg/generate-yamlfiles.sh from tcwg-benchmark.yaml.in and tcwg-benchmark/tcwg-benchmark_backend.def. Do not edit.
2#BEGIN: tcwg/default.yaml.inc
3# -*- mode: Yaml -*-
4
5- property:
6 name: default-properties
7 properties:
8 - authorization:
Maxim Kuvyrkov57bfe132021-06-21 14:42:14 +00009 anonymous:
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000010 - job-read
11 - job-extended-read
Benjamin Copeland9dc2eb82022-10-11 12:40:33 +010012 everyone-flat:
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000013 - job-build
14 - job-cancel
Maxim Kuvyrkov48c9f0b2021-06-22 07:16:49 +000015 # Allow users in tcwg-benchmark group (e.g., tcwg-buildslave)
16 # start and stop builds. We use this in tcwg_bmk* CI loops.
17 tcwg-benchmark:
18 - job-build
19 - job-cancel
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000020 - build-discarder:
Maxim Kuvyrkov5e1f6662025-02-20 05:32:41 +000021 days-to-keep: 20
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000022
23- scm:
24 name: jenkins-scripts
25 scm:
26 - git:
Laurent Alfonsi3c7c10a2025-04-17 17:04:51 +020027 url: https://gitlab.com/Linaro/tcwg/jenkins-scripts.git
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000028 refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*
29 branches:
30 - $scripts_branch
31 basedir: jenkins-scripts
32 skip-tag: true
33 reference-repo: /home/tcwg-buildslave/snapshots-ref/jenkins-scripts.git
34 wipe-workspace: false
35 clean:
36 before: true
37 prune: true
38
39- scm:
40 name: bmk-scripts
41 scm:
42 - git:
Laurent Alfonsi50d9de92025-05-27 13:04:04 +020043 url: https://gitlab.com/Linaro/tcwg/bmk-scripts.git
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000044 refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*
45 branches:
46 - $bmk_branch
47 basedir: bmk-scripts
48 skip-tag: true
49 reference-repo: /home/tcwg-buildslave/snapshots-ref/bmk-scripts.git
50 wipe-workspace: false
51 clean:
52 before: true
53 prune: true
54#END: tcwg/default.yaml.inc
55
56- job:
57 name: tcwg-benchmark_backend
58 project-type: freestyle
59 defaults: global
60 properties:
Maxim Kuvyrkov48c9f0b2021-06-22 07:16:49 +000061 - default-properties
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000062 parameters:
63 - choice:
64 name: bmk_hw
65 choices:
Maxim Kuvyrkovae897ac2021-07-31 10:01:53 +000066 - apm
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000067 - sq
68 - stm32
69 - tk1
70 - tx1
Laurent Alfonsiebfa4bd2022-03-17 17:03:20 +010071 - fx
Laurent Alfonsicdc66872023-03-11 12:32:15 +010072 - qc
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000073 description: 'Hardware to use for benchmarking'
74 - string:
75 name: toolchain_url
76 default: ''
Maxim Kuvyrkov59a005b2021-07-28 18:03:19 +000077 description: |
78 Toolchain URL. Either http[s]://xxx.tar.xz,
79 rsync://machine:/path/bin/target-triplet-, or
80 ssh://machine/path/compiler. You need to specify 'builder'
81 setting below when using non-ssh:// toolchain_urls.
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000082 - choice:
83 name: toolchain_type
84 choices:
85 - auto
86 - gnu
87 - llvm
88 - string:
89 name: sysroot
90 default: 'tarball'
91 description: 'Rsync-friendly path to the sysroot to run against; use libs from toolchain_url tarball/rsync if "tarball"; use system libs if empty'
92 - string:
93 name: bench_list
94 default: 'all'
Laurent Alfonsiaf9d76c2022-05-18 11:24:52 +020095 description: 'List of benchmarks to run. Can be for ex : all (i.e. spec2006), spec2017_speed, or coremark'
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +000096 - string:
97 name: cflags
98 default: ''
99 description: 'CFLAGS to use'
100 - string:
101 name: ldflags
102 default: 'default'
103 description: 'LDFLAGS to use'
104 - choice:
105 name: extension
106 choices:
107 - default
108 - O2
109 - O3
110 - O2g
111 - O3g
112 - Ofast
113 - Os
114 description: 'Compilation profile'
115 - choice:
116 name: testmode
117 choices:
118 - verify
119 - build
120 - benchmark
121 description: 'Whether to just build or run full benchmarks'
122 - string:
123 name: iterations
124 default: '1'
125 description: 'Number of benchmark iterations'
126 - string:
Laurent Alfonsi0237d7f2023-06-08 09:34:35 +0200127 name: results_dest
128 default: 'bkp-01.tcwglab:/home/tcwg-benchmark/results-@hw_tag@/tcwg-benchmark/@build_num@'
129 description: 'Destination where to push results..'
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000130 - bool:
131 name: forceinstall
132 default: 'false'
133 description: 'Force clean re-install of benchmark sources'
134 - choice:
135 name: run_profile
136 choices:
Laurent Alfonsi1698a952022-11-11 16:05:36 +0100137 - parallel_0x4
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000138 - parallel
139 - serial
Maxim Kuvyrkov69f2d742021-06-26 17:03:23 +0000140 description: |
Laurent Alfonsi1698a952022-11-11 16:05:36 +0100141 parallel_0x4 - Build benchmark in parallel (all CPU cores), Run benchmark in parallel (max 4)
Maxim Kuvyrkov69f2d742021-06-26 17:03:23 +0000142 parallel - Run benchmarks in parallel on all CPU cores.
143 serial - Run benchmarks serially on a single CPU core.
144 - choice:
145 name: board_selection
146 choices:
147 - balance
Maxim Kuvyrkov114596a2021-06-26 17:09:56 +0000148 - one_board
149 - all_boards
Maxim Kuvyrkov69f2d742021-06-26 17:03:23 +0000150 description: |
151 balance - Distribute benchmarks across all available boards.
152 1board - Run all benchmarks on a single board.
153 allboards - Run all benchmarks on all boards (e.g., to check that all boards give the same performance result).
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000154 - choice:
155 name: image_arch
156 choices:
Maxim Kuvyrkov619e9bd2021-06-18 19:56:48 +0000157 - arm64
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000158 - armhf
Maxim Kuvyrkov8324f622021-07-29 08:40:15 +0000159 - amd64
160 description: 'Docker image architecture'
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000161 - bool:
162 name: reboot
163 default: 'false'
164 description: 'Reboot the board before building and running the benchmarks.'
165 - string:
166 name: displaytag
167 default: '$bmk_hw'
168 description: 'Tag to display in the Jenkins console, so that the build name is more meaningful'
169 - bool:
170 name: ignore_errors
171 default: 'false'
172 description: 'Ignore build errors as much as possible'
173 - string:
174 name: clean_older_than
175 default: '60'
176 description: 'Delete previous results older than X days (on board)'
177 - string:
178 name: builder
Maxim Kuvyrkov8324f622021-07-29 08:40:15 +0000179 default: 'bmk_board'
Maxim Kuvyrkov59a005b2021-07-28 18:03:19 +0000180 description: |
181 Jenkins label or node to procure a builder from and the docker
182 image distro tag to use for the build environment.
183 This is needed only for non-ssh:// toolchain_urls.
Maxim Kuvyrkov8324f622021-07-29 08:40:15 +0000184 Special value of bmk_board uses benchmarking board as the builder
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000185 - string:
186 name: scripts_branch
187 default: master
188 description: 'Jenkins-scripts branch to use'
189 - string:
190 name: bmk_branch
191 default: master
192 description: 'Bmk-scripts branch to use'
193 - node:
194 name: bmk_node
195 default-slaves:
196 - tcwg-bmk-bkp-01
197 allowed-slaves:
198 - tcwg-bmk-bkp-01
Maxim Kuvyrkovae897ac2021-07-31 10:01:53 +0000199 - tcwg-bmk-apm
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000200 - tcwg-bmk-sq
201 - tcwg-bmk-stm32
202 - tcwg-bmk-tk1
203 - tcwg-bmk-tx1
Laurent Alfonsiebfa4bd2022-03-17 17:03:20 +0100204 - tcwg-bmk-fx
Laurent Alfonsicdc66872023-03-11 12:32:15 +0100205 - tcwg-bmk-qc
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000206 description: 'Bmk node; used internally, do not touch'
207 disabled: false
208 concurrent: true
209 display-name: 'TCWG Benchmark_backend'
210 workspace: workspace/tcwg-benchmark-${NODE_NAME}_$EXECUTOR_NUMBER
211 scm:
212 - jenkins-scripts
213 - bmk-scripts
214 wrappers:
215 - timeout:
Laurent Alfonsib26475e2023-09-13 15:50:47 +0200216 timeout: 1200
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000217 - timestamps
218 - ssh-agent-credentials:
219 users:
220 - 'tcwg-benchmark'
221 - build-name:
Laurent Alfonsif30be9e2023-02-08 18:59:08 +0100222 name: '#$BUILD_NUMBER-$displaytag ($bmk_hw:$image_arch)'
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000223 builders:
224 - shell:
225 command: |
226 #!/bin/bash
227
Maxim Kuvyrkovc97056d2021-06-19 19:29:16 +0000228 set -ef -o pipefail
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000229 set -x
230
231 rm -rf artifacts
Maxim Kuvyrkov72158782021-06-19 09:20:55 +0000232 mkdir -p artifacts/jenkins
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000233
Laurent Alfonsib711b982023-06-29 19:34:23 +0200234 case "$bmk_hw:$image_arch" in
235 apm:arm64) hw_tag=apm_64 ;;
236 apm:armhf) hw_tag=apm_32 ;;
237 sq:arm64) hw_tag=sq_64 ;;
238 sq:armhf) hw_tag=sq_32 ;;
239 stm32:amd64) hw_tag=stm32;;
240 tk1:armhf) hw_tag=tk1_32 ;;
241 tx1:arm64) hw_tag=tx1_64 ;;
242 tx1:armhf) hw_tag=tx1_32 ;;
243 fx:arm64) hw_tag=fx_64 ;;
244 fx:armhf) hw_tag=fx_32 ;;
245 qc:arm64) hw_tag=qc_64 ;;
246 qc:armhf) hw_tag=qc_32 ;;
247 *)
248 echo "ERROR: Unsupported bmk_hw:image_arch: $bmk_hw:$image_arch"
249 exit 1
250 ;;
251 esac
252
Maxim Kuvyrkov21fed872021-06-21 07:37:39 +0000253 # Retry benchmarking once, just in case we selected a board that
254 # recently went offline.
Maxim Kuvyrkov7abc65c2021-06-24 13:30:43 +0000255 bmk_retry=true
Maxim Kuvyrkov21fed872021-06-21 07:37:39 +0000256
Maxim Kuvyrkov9b68bfe2021-10-23 20:04:15 +0000257 declare -gA bad_boards
258
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000259 while true; do
Maxim Kuvyrkov9b68bfe2021-10-23 20:04:15 +0000260 good_boards=()
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000261 for lock in $(set +f; ls -tr $HOME/boards/$NODE_NAME-*.lock); do
Maxim Kuvyrkov9b68bfe2021-10-23 20:04:15 +0000262 if [ x"${bad_boards[$lock]-unset}" = x"unset" ]; then
263 good_boards+=("$lock")
264 fi
265 done
266
267 if [ ${#good_boards[@]} = 0 ]; then
268 echo "Ran out of boards to try -- giving up." >> artifacts/jenkins/mail-body.txt
269 exit 125
270 fi
271
272 for lock in "${good_boards[@]}"; do
Maxim Kuvyrkov7abc65c2021-06-24 13:30:43 +0000273 bmk_start=$(date +%s)
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000274 (
Maxim Kuvyrkov21fed872021-06-21 07:37:39 +0000275 flock -en -E 124 9
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000276 touch $lock
Maxim Kuvyrkov79f62dc2021-06-19 09:00:25 +0000277 boardname=$(cat <&9)
278 export boardname
Maxim Kuvyrkov72158782021-06-19 09:20:55 +0000279 echo "#$BUILD_NUMBER-$displaytag-$boardname" > artifacts/jenkins/build-name
Maxim Kuvyrkov8324f622021-07-29 08:40:15 +0000280 exec ./jenkins-scripts/tcwg-benchmark.sh \
281 --boardname "$boardname" \
282 --toolchain_url "$toolchain_url" \
283 --toolchain_type "$toolchain_type" \
284 --sysroot "$sysroot" \
285 --bench_list "$bench_list" \
286 --cflags "$cflags" \
287 --ldflags "$ldflags" \
288 --extension "$extension" \
289 --testmode "$testmode" \
290 --iterations "$iterations" \
Laurent Alfonsi0237d7f2023-06-08 09:34:35 +0200291 --results_dest "$results_dest" \
Maxim Kuvyrkov8324f622021-07-29 08:40:15 +0000292 --forceinstall "$forceinstall" \
293 --run_profile "$run_profile" \
294 --image_arch "$image_arch" \
Laurent Alfonsi0237d7f2023-06-08 09:34:35 +0200295 --hw_tag "$hw_tag" \
Maxim Kuvyrkov8324f622021-07-29 08:40:15 +0000296 --reboot "$reboot" \
297 --ignore_errors "$ignore_errors" \
298 --clean_older_than "$clean_older_than" \
299 --builder "$builder" \
Maxim Kuvyrkov8324f622021-07-29 08:40:15 +0000300 --WORKSPACE "$WORKSPACE"
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000301 ) 9<$lock &
302 res=0 && wait $! || res=$?
Maxim Kuvyrkov21fed872021-06-21 07:37:39 +0000303 if [ $res != 0 ]; then
304 if [ $res = 124 ]; then
305 # Try to lock next board.
306 continue
Maxim Kuvyrkov7abc65c2021-06-24 13:30:43 +0000307 elif $bmk_retry; then
Maxim Kuvyrkov9b68bfe2021-10-23 20:04:15 +0000308 bad_boards[$lock]="1"
Maxim Kuvyrkov7abc65c2021-06-24 13:30:43 +0000309 bmk_retry=false
310 if [ $res = 125 ]; then
Maxim Kuvyrkov788351f2021-06-26 17:39:08 +0000311 echo "Failed to prepare board $lock for benchmarking, retry with a different board." >> artifacts/jenkins/mail-body.txt
Maxim Kuvyrkov7abc65c2021-06-24 13:30:43 +0000312 continue
313 elif [ $(($(date +%s) - $bmk_start)) -le 300 ]; then
Maxim Kuvyrkov788351f2021-06-26 17:39:08 +0000314 echo "Benchmarking on board $lock failed due to /something/ within 5 minutes -- give it another chance." >> artifacts/jenkins/mail-body.txt
Maxim Kuvyrkov7abc65c2021-06-24 13:30:43 +0000315 continue
316 fi
Maxim Kuvyrkov21fed872021-06-21 07:37:39 +0000317 fi
Maxim Kuvyrkov788351f2021-06-26 17:39:08 +0000318 echo "Benchmarking on board $lock failed -- giving up." >> artifacts/jenkins/mail-body.txt
319 fi
320 if [ -f artifacts/jenkins/mail-body.txt ]; then
321 if [ $res = 0 ]; then
322 echo "Benchmarking succeeded" >> artifacts/jenkins/mail-body.txt
323 fi
324 echo "$BUILD_URL" >> artifacts/jenkins/mail-body.txt
Laurent Alfonsi95831342022-03-24 17:13:45 +0100325 echo "maxim.kuvyrkov@linaro.org, laurent.alfonsi@linaro.org" > artifacts/jenkins/mail-recipients.txt
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000326 fi
Maxim Kuvyrkov21fed872021-06-21 07:37:39 +0000327 exit $res
Maxim Kuvyrkov4a7a3c22021-06-18 11:54:30 +0000328 done
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000329 sleep 30
330 done
331 unstable-return: 125
Maxim Kuvyrkov79f62dc2021-06-19 09:00:25 +0000332 - build-name-setter:
333 name: 'artifacts/jenkins/build-name'
334 file: true
Maxim Kuvyrkov975fab12021-06-18 08:16:24 +0000335 publishers:
336 - archive:
337 artifacts: 'artifacts/**'
338 latest-only: false
339 allow-empty: true
Maxim Kuvyrkov788351f2021-06-26 17:39:08 +0000340 - email-ext:
341 recipients: |
342 ${FILE,path="artifacts/jenkins/mail-recipients.txt"}
343 content-type: text
344 body: |
345 ${FILE,path="artifacts/jenkins/mail-body.txt"}
346 failure: true
347 success: true
348 aborted: true
349 send-to:
350 - recipients
Laurent Alfonsi50d9de92025-05-27 13:04:04 +0200351# checksum: d2ea6e214031fbe42111d850cf128679