blob: b6d650f580f49346997559cccf81158a1d5c96ce [file] [log] [blame]
Laurent Alfonsi9b9125f2023-02-24 17:25:48 +01001# Auto generated by ./tcwg/generate-yamlfiles.sh from tcwg_bmk.yaml.in and tcwg_bmk/tcwg_bmk-code_speed-cpu2017speed--llvm.def. Do not edit.
Laurent Alfonsi701c52f2023-02-16 11:38:46 +01002# Beware: git branch names need the 'refs/heads/' prefix, while tags need 'refs/tags/'
3- project:
Laurent Alfonsi9b9125f2023-02-24 17:25:48 +01004 name: tcwg_bmk-code_speed-cpu2017speed-llvm
Laurent Alfonsi701c52f2023-02-16 11:38:46 +01005 llvm_url: https://github.com/llvm/llvm-project.git
6
7 toolchain_name: llvm
Laurent Alfonsi701c52f2023-02-16 11:38:46 +01008
9 # BMK defined in def files
10 bmk:
Laurent Alfonsi9f55e932023-02-20 12:09:13 +010011 - cpu2017speed
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010012
Laurent Alfonsi9b9125f2023-02-24 17:25:48 +010013 target:
Laurent Alfonsieaf47502023-03-09 11:09:05 +010014 - aarch64:
15 docker_arch: arm64
16
Laurent Alfonsi9b9125f2023-02-24 17:25:48 +010017
Maxim Kuvyrkov4589cc32023-03-02 08:36:56 +000018 # PROFILE_NAME defined in def files
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010019 cflags:
20 - O2
Laurent Alfonsi9f55e932023-02-20 12:09:13 +010021 - O2_LTO
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010022 - O3
Laurent Alfonsi9f55e932023-02-20 12:09:13 +010023 - O3_LTO
Antoine Moynault17ab9382024-04-24 06:54:10 +000024 - Os
25 - Os_LTO
26 - Oz
27 - Oz_LTO
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010028
29 jobs:
30 - 'tcwg_bmk-llvm-master'
31
Laurent Alfonsi6375a162023-02-23 11:57:15 +010032
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010033- job-group:
34 name: tcwg_bmk-llvm-master
35 toolchain_ver: master
Laurent Alfonsi0cacf302024-06-13 14:32:10 +020036 llvm_branch: main
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010037 distro: default
38 cron_schedule: 'H H H/3 * *'
39 jobs:
Laurent Alfonsi9b9125f2023-02-24 17:25:48 +010040 - 'tcwg_bmk-code_speed-cpu2017speed--llvm-{target}-{toolchain_ver}-{cflags}-build'
41 - 'tcwg_bmk-code_speed-cpu2017speed--llvm-{target}-{toolchain_ver}-{cflags}-bisect'
Laurent Alfonsi6375a162023-02-23 11:57:15 +010042 ci_project: 'tcwg_bmk-code_speed-cpu2017speed'
Laurent Alfonsi9b9125f2023-02-24 17:25:48 +010043 ci_config: 'llvm-{target}-{toolchain_ver}-{cflags}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010044
45#BEGIN: tcwg/round-robin.yaml.inc
46# -*- mode: Yaml -*-
47
48#BEGIN: tcwg/default.yaml.inc
49# -*- mode: Yaml -*-
50
51- property:
52 name: default-properties
53 properties:
54 - authorization:
55 anonymous:
56 - job-read
57 - job-extended-read
58 everyone-flat:
59 - job-build
60 - job-cancel
61 - build-discarder:
Maxim Kuvyrkov5e1f6662025-02-20 05:32:41 +000062 days-to-keep: 20
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010063
64- scm:
65 name: jenkins-scripts
66 scm:
67 - git:
Laurent Alfonsi3c7c10a2025-04-17 17:04:51 +020068 url: https://gitlab.com/Linaro/tcwg/jenkins-scripts.git
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010069 refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*
70 branches:
71 - $scripts_branch
72 basedir: jenkins-scripts
73 skip-tag: true
74 reference-repo: /home/tcwg-buildslave/snapshots-ref/jenkins-scripts.git
75 wipe-workspace: false
76 clean:
77 before: true
78 prune: true
79
80- scm:
81 name: bmk-scripts
82 scm:
83 - git:
Laurent Alfonsi50d9de92025-05-27 13:04:04 +020084 url: https://gitlab.com/Linaro/tcwg/bmk-scripts.git
Laurent Alfonsi701c52f2023-02-16 11:38:46 +010085 refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*
86 branches:
87 - $bmk_branch
88 basedir: bmk-scripts
89 skip-tag: true
90 reference-repo: /home/tcwg-buildslave/snapshots-ref/bmk-scripts.git
91 wipe-workspace: false
92 clean:
93 before: true
94 prune: true
95#END: tcwg/default.yaml.inc
96
97- parameter:
98 name: default-parameters
99 parameters:
100 - string:
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100101 name: extra_build_params
102 default: ""
103 description: "Extra parameters to pass to the build script; can be used to override settings extracted from ci_project/ci_config"
104 - string:
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100105 name: distro
106 default: '{distro}'
107 description: 'Distro image to use'
108 - string:
109 name: scripts_branch
110 default: master
111 description: 'Scripts revision to use'
112 - string:
113 name: bmk_branch
114 default: master
115 description: 'Benchmark scripts revision to use'
116
117- parameter:
118 name: component-parameters
119 parameters:
120 - string:
121 name: '{component}_git'
122 default: '{default_git}'
Christophe Lyon1290bab2024-02-13 22:23:45 +0000123 description: "{component} git_url#branch/sha1 to build, or 'default', 'baseline' or 'jenkins-scm', or pw://series/<id> to build with patches from patchwork ('precommit' mode, use 'pw://series/<id>/retrigger/' to force a rebuild)"
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100124
125- parameter:
Maxim Kuvyrkovc81e4722023-11-22 18:11:33 +0000126 name: all-component-parameters
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100127 parameters:
128 - component-parameters:
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100129 component: llvm
130 default_git: '{default_git}'
Maxim Kuvyrkovc81e4722023-11-22 18:11:33 +0000131
132- parameter:
133 name: build-parameters
134 parameters:
135 - all-component-parameters:
136 default_git: '{default_git}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100137 - choice:
138 name: update_baseline
139 choices:
140 - onsuccess
141 - force
142 - init
143 - ignore
144 description: "What to do with baseline in this build"
Maxim Kuvyrkov069813f2023-05-06 19:17:00 +0000145 - choice:
146 name: notify
147 choices:
148 - ignore
149 - onregression
Maxim Kuvyrkov333b2962023-08-14 08:55:46 +0000150 - precommit
Maxim Kuvyrkov069813f2023-05-06 19:17:00 +0000151 description: "Whether to notify developers about the result of this build"
Laurent Alfonsi464db222024-05-28 14:09:45 +0200152 - string:
Laurent Alfonsi8527d662024-05-24 16:27:08 +0200153 name: rr_stage
154 default: build
155 description: "Describe the current round-robin stage for this run (informative only)"
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100156 - default-parameters:
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100157 distro: '{distro}'
158
Laurent Alfonsi87ab4de2024-04-25 07:34:20 +0200159
Laurent Alfonsi2ac30aa2023-08-23 16:13:37 +0200160- property:
161 name: build-properties
162 properties:
163 - default-properties
164 - build-blocker:
165 blocking-jobs:
166 - '{ci_project}--{ci_config}-bisect'
167 queue-scanning: 'ALL'
168
Maxim Kuvyrkovab90c432024-01-08 08:51:26 +0000169
Laurent Alfonsi2ac30aa2023-08-23 16:13:37 +0200170- property:
171 name: bisect-properties
172 properties:
173 - default-properties
174 - build-blocker:
175 # Run at most 1 bisect job for all configurations.
176 # Bisect jobs can easily run for 5+ hours, and a few of them
177 # can hog the entire TCWG build farm for a long time. Since
178 # same regression tends to appear in multiple configurations,
179 # run bisections for all configurations in-order.
180 blocking-jobs:
181 # We can't have same regressions between GNU and LLVM toolchains,
182 # do allow parallel bisections of those.
183 - '{ci_project}--llvm-.*-bisect'
184 queue-scanning: 'BUILDABLE'
185
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100186# Beware: git branch names need the 'refs/heads/' prefix while tags
187# need 'refs/tags/'.
188- scm:
189 name: component-scm
190 scm:
191 - git:
192 url: '{url}'
193 branches:
Laurent Alfonsi0cacf302024-06-13 14:32:10 +0200194 - 'refs/heads/{branch}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100195 basedir: '{component}'
Laurent Alfonsicdf084e2024-06-28 14:50:37 +0200196 do-not-fetch-tags: true
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100197 reference-repo: '/home/tcwg-buildslave/snapshots-ref/{reference}'
Laurent Alfonsi1ed7e3f2024-06-25 14:52:06 +0200198 refspec: '+refs/heads/{branch}:refs/remotes/origin/{branch}'
Laurent Alfonsi0cde2752024-06-13 14:32:10 +0200199 shallow-clone: true
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100200 wipe-workspace: false
201 clean:
202 before: true
203 prune: true
204
205# SCMs must start with jenkins-scripts and then be ordered alphabetically.
206# Same alphabetical order must be followed in .def files. The reason behind
207# this is that jenkins sets $GIT_COMMIT to sha1 of jenkins-scripts, and then
208# sets $GIT_COMMIT_1, $GIT_COMMIT_2, etc. to sha1s of component SCM /in the
209# order that they are declared here/.
210- scm:
211 name: build-scms
212 scm:
213 - jenkins-scripts
Laurent Alfonsi2d485072025-05-20 16:06:45 +0000214 - component-scm:
215 component: llvm
216 url: '{llvm_url}'
217 branch: '{llvm_branch}'
218 reference: llvm-project.git
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100219
220- wrapper:
221 name: build-wrappers
222 wrappers:
223 - timeout:
224 timeout: '{timeout}'
225 - timestamps
226 - ssh-agent-credentials:
227 # tcwg-buildslave user id
228 users:
229 - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
Christophe Lyonee8d3e82025-04-29 13:50:15 +0000230 - 'tcwg-buildslave-20220725'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100231 - credentials-binding:
232 - text:
233 credential-id: TCWG_JIRA_TOKEN
234 variable: TCWG_JIRA_TOKEN
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100235
236- builder:
Maxim Kuvyrkovccd89ea2023-06-30 17:16:10 +0000237 name: trigger-followup-builds-1
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100238 builders:
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000239 - shell: |
240 #!/bin/bash
Maxim Kuvyrkov8adf09b2023-07-01 15:47:55 +0000241 source artifacts/jenkins/run-build.env
Maxim Kuvyrkov8c8e4aa2023-11-22 18:56:53 +0000242 set -ex
Maxim Kuvyrkov8adf09b2023-07-01 15:47:55 +0000243
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000244 for i in artifacts/trigger-build-* artifacts/trigger-bisect; do
245 if [ -f $i ]; then
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000246 echo "distro=$distro" >> $i
247 echo "scripts_branch=$scripts_branch" >> $i
248 echo "bmk_branch=$bmk_branch" >> $i
249 fi
250 done
Maxim Kuvyrkovccd89ea2023-06-30 17:16:10 +0000251
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000252 trap "" EXIT
253
Maxim Kuvyrkovccd89ea2023-06-30 17:16:10 +0000254- builder:
255 name: trigger-followup-builds-2
256 builders:
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000257 - trigger-builds:
Maxim Kuvyrkov52c3cc22024-01-05 15:40:26 +0000258 - project: '{ci_project}--{ci_config}-build'
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000259 parameter-factories:
260 - factory: filebuild
261 file-pattern: artifacts/trigger-build-*
Maxim Kuvyrkov52c3cc22024-01-05 15:40:26 +0000262 - project: '{ci_project}--{ci_config}-bisect'
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000263 property-file: artifacts/trigger-bisect
Maxim Kuvyrkov12858ec2023-05-03 18:38:05 +0000264
265- builder:
Maxim Kuvyrkov333b2962023-08-14 08:55:46 +0000266 name: run-build-notify
Maxim Kuvyrkov12858ec2023-05-03 18:38:05 +0000267 builders:
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000268 - shell: |
269 #!/bin/bash
Maxim Kuvyrkov8adf09b2023-07-01 15:47:55 +0000270 source artifacts/jenkins/run-build.env
Maxim Kuvyrkov8c8e4aa2023-11-22 18:56:53 +0000271 set -ex
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100272
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000273 if [ -f artifacts/failed ]; then
Maxim Kuvyrkovab01ec02023-08-14 08:52:38 +0000274 # Only send notifications for forced successful
275 # (aka "onregression") builds; never for failed builds.
Laurent Alfonsia723e002023-10-02 15:25:05 +0200276 echo "Build failed. Using option notify=ignore."
Maxim Kuvyrkovab01ec02023-08-14 08:52:38 +0000277 notify=ignore
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000278 fi
Maxim Kuvyrkovb1f99992023-05-25 15:16:53 +0000279
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000280 # Basic notification -- create entry in interesting-commits.
Maxim Kuvyrkov835cfc22023-07-04 15:40:32 +0000281 # Note that we add --notify to the manifest -- we will need this
282 # later in round-robin-baseline.sh when re-writing history
283 # to update notifications files in interesting-commits and jira.
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000284 build_container_exec \
Maxim Kuvyrkovd2207ec2024-06-28 14:10:30 +0000285 ./jenkins-scripts/rr/round-robin-notify.sh \
Maxim Kuvyrkov835cfc22023-07-04 15:40:32 +0000286 @@rr[top_artifacts] artifacts --notify "$notify" \
287 __stage init __verbose true \
Thiago Jung Bauermann676c14a2023-09-12 12:37:40 -0300288 __build_script {build_script} \
Maxim Kuvyrkov333b2962023-08-14 08:55:46 +0000289 &> ./artifacts/jenkins/notify-init.log &
Maxim Kuvyrkov3966f7e2023-06-16 13:36:25 +0000290
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000291 if ! wait $!; then
292 echo "maxim.kuvyrkov@linaro.org, laurent.alfonsi@linaro.org" \
293 > artifacts/jenkins/error-mail-recipients.txt
294 echo -e "$BUILD_URL\nERROR: notify-init failed\n" \
295 >> artifacts/jenkins/error-mail-body.txt
Laurent Alfonsi53446912023-09-10 15:14:16 +0200296 echo "ERROR: notify-init failed"
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000297 exit 1
298 fi
Maxim Kuvyrkov3966f7e2023-06-16 13:36:25 +0000299
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000300 # Full notification
301 echo "NOTE: Notify developers about this build"
Maxim Kuvyrkove8a19542023-12-26 10:12:55 +0000302
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000303 build_container_exec \
Maxim Kuvyrkovd2207ec2024-06-28 14:10:30 +0000304 ./jenkins-scripts/rr/round-robin-notify.sh \
Maxim Kuvyrkove8a19542023-12-26 10:12:55 +0000305 @@rr[top_artifacts] artifacts __stage full __verbose true \
Thiago Jung Bauermann676c14a2023-09-12 12:37:40 -0300306 __build_script {build_script} \
Maxim Kuvyrkov333b2962023-08-14 08:55:46 +0000307 &> ./artifacts/jenkins/notify-full.log &
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100308
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000309 if ! wait $!; then
310 echo "maxim.kuvyrkov@linaro.org, laurent.alfonsi@linaro.org" \
311 > artifacts/jenkins/error-mail-recipients.txt
312 echo -e "$BUILD_URL\nERROR: notify-full failed\n" \
313 >> artifacts/jenkins/error-mail-body.txt
Laurent Alfonsi53446912023-09-10 15:14:16 +0200314 echo "ERROR: notify-full failed"
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000315 fi
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100316
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000317 # Failsafe for avoid spamming developers.
318 if [ "$notify" = "ignore" ] \
319 && [ -f artifacts/jenkins/mail-recipients.txt ]; then
320 echo "maxim.kuvyrkov@linaro.org, laurent.alfonsi@linaro.org" \
321 > artifacts/jenkins/error-mail-recipients.txt
322 echo -e "$BUILD_URL\nERROR: tried to unexpectedly notify developers\n" \
323 >> artifacts/jenkins/error-mail-body.txt
324 mv artifacts/jenkins/mail-recipients.txt \
325 artifacts/jenkins/mail-recipients.bak
326 fi
Maxim Kuvyrkovdc5adc12023-07-01 08:02:24 +0000327
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000328 trap "" EXIT
329
Maxim Kuvyrkovdc5adc12023-07-01 08:02:24 +0000330- builder:
331 name: run-exit-on-failure
332 builders:
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000333 - shell: |
334 #!/bin/bash
Maxim Kuvyrkov8adf09b2023-07-01 15:47:55 +0000335 source artifacts/jenkins/run-build.env
Maxim Kuvyrkov8c8e4aa2023-11-22 18:56:53 +0000336 set -ex
Maxim Kuvyrkov5a415222023-05-25 15:43:31 +0000337
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000338 if [ -f artifacts/failed ]; then
339 # Mark failed build as FAILURE; no further steps will run.
340 exit $(cat artifacts/failed)
341 fi
342 # Only successful builds run beyond this point.
Maxim Kuvyrkov909dfbe2023-05-06 19:56:28 +0000343
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000344 trap "" EXIT
345
Maxim Kuvyrkovb1f99992023-05-25 15:16:53 +0000346- builder:
347 name: run-push-baseline
348 builders:
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000349 - shell: |
350 #!/bin/bash
Maxim Kuvyrkov8adf09b2023-07-01 15:47:55 +0000351 source artifacts/jenkins/run-build.env
Maxim Kuvyrkov8c8e4aa2023-11-22 18:56:53 +0000352 set -ex
Maxim Kuvyrkovb1f99992023-05-25 15:16:53 +0000353
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000354 # Update baseline branch of base-artifacts.
355 # If we made it this far, then the build is successful
356 # (possibly because it was forced to be declared successful).
357 if [ "$update_baseline" = "ignore" ]; then
Maxim Kuvyrkova5f21f42023-08-18 16:07:57 +0000358 trap "" EXIT
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000359 exit 0
360 fi
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100361
Laurent Alfonsie6cb4ea2024-04-26 15:15:08 +0200362 # We may need jira token while rewriting history.
Laurent Alfonsic7a40952024-04-26 19:44:08 +0200363 if [ -f $HOME/.jipdate.yml ]; then
Laurent Alfonsie6cb4ea2024-04-26 15:15:08 +0200364 (
365 # BE CAREFUL WITH TCWG_JIRA_TOKEN
366 set +x
367 build_container_exec \
368 sed -i -e "s/#TCWG_JIRA_TOKEN#/$TCWG_JIRA_TOKEN/" \
369 "$HOME/.jipdate.yml"
370 )
371 fi
372
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000373 build_container_exec \
Maxim Kuvyrkovd2207ec2024-06-28 14:10:30 +0000374 ./jenkins-scripts/rr/round-robin-baseline.sh \
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000375 @@rr[top_artifacts] artifacts \
Maxim Kuvyrkov570e5ea2023-07-01 19:43:07 +0000376 __build_script {build_script} \
Maxim Kuvyrkove5b3c062023-07-01 12:45:48 +0000377 __push_base_artifacts true \
Maxim Kuvyrkov5e3db0f2023-07-01 12:46:59 +0000378 __rewrite_base_artifacts true \
Laurent Alfonsi87ab4de2024-04-25 07:34:20 +0200379 __commit_artifacts {commit_artifacts} \
Laurent Alfonsi9d6f3c82024-04-19 15:32:04 +0000380 __rewrite_num 100 \
Laurent Alfonsie2a36ca2024-11-04 13:04:24 +0100381 &> ./artifacts/jenkins/rewrite-{commit_artifacts}.log &
Maxim Kuvyrkovdbee9522023-05-06 19:39:52 +0000382
Maxim Kuvyrkovbdf8f062025-02-20 05:53:02 +0000383 res=0 && wait $! || res=$?
384
385 # Compress big files in artifacts/NN-* directories to save disk space
386 # on ci.linaro.org.
387 find artifacts/ -size +1M ! -name "*.xz" \
388 -path "artifacts/[0-9]*" -print0 \
Maxim Kuvyrkov2fc30f92025-02-20 23:33:00 +0000389 | xargs -0 -i@ xz -T0 @
Maxim Kuvyrkovbdf8f062025-02-20 05:53:02 +0000390
391 if [ $res != 0 ]; then
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000392 echo "maxim.kuvyrkov@linaro.org, laurent.alfonsi@linaro.org" \
393 > artifacts/jenkins/error-mail-recipients.txt
Maxim Kuvyrkov25379cc2024-03-28 07:30:27 +0000394 echo -e "$BUILD_URL\nERROR: round-robin-baseline.sh failed" \
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000395 >> artifacts/jenkins/error-mail-body.txt
Laurent Alfonsi53446912023-09-10 15:14:16 +0200396 echo "ERROR: round-robin-baseline.sh failed"
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000397 # We have failed to update the baseline, so let's fail and
398 # not notify developers.
399 exit 1
400 fi
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100401
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000402 trap "" EXIT
403
Laurent Alfonsia8284ec2023-11-16 10:05:38 +0100404- builder:
405 name: run-push-lnt-results
406 builders:
407 - trigger-builds:
Laurent Alfonsi1678ed72023-11-20 22:06:39 +0100408 - project: tcwg-update-lnt-results
Laurent Alfonsia8284ec2023-11-16 10:05:38 +0100409 predefined-parameters: |
Maxim Kuvyrkov67698ea2024-01-05 15:26:07 +0000410 ci_project={ci_project}
411 ci_config={ci_config}
Laurent Alfonsia8284ec2023-11-16 10:05:38 +0100412
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100413
414- builder:
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000415 name: run-build-init
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100416 builders:
417 - shell:
418 command: |
419 #!/bin/bash
420 set -ex
421 # Delete artifacts now to avoid re-using stale artifacts if
422 # below docker-run.sh fails to start up a container.
423 rm -rf artifacts/
424 mkdir -p artifacts/jenkins
425
Maxim Kuvyrkovbc309d52023-05-25 16:08:50 +0000426 build_name="#$BUILD_NUMBER"
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000427 echo "$build_name" > artifacts/jenkins/build-name
428
Laurent Alfonsia9572792024-10-24 12:00:20 +0200429 git -C jenkins-scripts submodule update --init --remote
Maxim Kuvyrkovd2207ec2024-06-28 14:10:30 +0000430
Maxim Kuvyrkov5d4ddd82024-01-17 15:12:28 +0000431 if [ "{precommit}" = "True" ]; then
Maxim Kuvyrkov02987c12024-01-10 09:43:41 +0000432 cat >> artifacts/jenkins/run-build.env <<EOF
433 update_baseline=ignore
434 EOF
435 fi
436
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000437 cat >> artifacts/jenkins/run-build.env <<EOF
438 build_name="$build_name"
439 EOF
440 unstable-return: 125
441
442- builder:
443 name: run-build-skip-if-queue
444 builders:
445 - shell:
446 command: |
447 #!/bin/bash
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000448 source artifacts/jenkins/run-build.env
Maxim Kuvyrkov8c8e4aa2023-11-22 18:56:53 +0000449 set -ex
Maxim Kuvyrkovbc309d52023-05-25 16:08:50 +0000450
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100451 # Skip SCM-triggered builds if there are other builds in
452 # the queue. We need to process all pending bisection-triggered
453 # builds before fetching a new batch of upstream changes.
Maxim Kuvyrkovb4872112023-07-01 18:33:31 +0000454 # Re. skipping post-commit build if pre-commit queue is
455 # not empty -- it's just a favor to pre-commit builds.
Maxim Kuvyrkoveb378e42024-01-08 06:50:57 +0000456 if [ x"${{BUILD_CAUSE_SCMTRIGGER-false}}" = x"true" ] \
457 || [ x"${{BUILD_CAUSE_TIMERTRIGGER-false}}" = x"true" ]; then
Maxim Kuvyrkovb4872112023-07-01 18:33:31 +0000458 for job_type in build; do
Maxim Kuvyrkove8e49eb2023-07-01 18:52:20 +0000459 url="${{JOB_URL%-build/}}-$job_type"
Laurent Alfonsib81499a2025-01-06 15:32:36 +0100460 inQueue=$(curl --retry 5 --max-time 5 -s "$url/api/xml?tree=inQueue" \
Maxim Kuvyrkovb4872112023-07-01 18:33:31 +0000461 | sed -e "s#.*<inQueue>\(.*\)</inQueue>.*#\1#")
462 if [ "$inQueue" != "false" ]; then
463 echo "SKIP SCM BUILD"
464 touch artifacts/jenkins/skip-scm-build
465 build_name="$build_name-skip-scm-build"
466 echo "$build_name" > artifacts/jenkins/build-name
Maxim Kuvyrkov3782aea2023-05-25 15:24:41 +0000467
Maxim Kuvyrkovb4872112023-07-01 18:33:31 +0000468 # Mark build unstable aka a skipped build
469 exit 125
470 fi
471 done
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100472 fi
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000473
474 trap "" EXIT
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000475 unstable-return: 125
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100476
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000477- builder:
478 name: run-build-start-manifest
479 builders:
480 - shell:
481 command: |
482 #!/bin/bash
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000483 source artifacts/jenkins/run-build.env
Maxim Kuvyrkov8c8e4aa2023-11-22 18:56:53 +0000484 set -ex
Maxim Kuvyrkov8adf09b2023-07-01 15:47:55 +0000485
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000486 docker_opts=(
Maxim Kuvyrkovbc309d52023-05-25 16:08:50 +0000487 --distro $distro
488 --arch {docker_arch}
489 --node $NODE_NAME
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000490 --ssh_info true
Maxim Kuvyrkov843ba812024-09-30 06:24:27 +0000491 --node_labels "$NODE_LABELS"
Maxim Kuvyrkovbc309d52023-05-25 16:08:50 +0000492 )
493
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000494 ./jenkins-scripts/start-container-docker.sh --prefix build_ \
495 "${{docker_opts[@]}}" > build_container.sh
496 source build_container.sh
497 trap "cleanup_all_containers" EXIT
498
Maxim Kuvyrkov8da7e852023-05-25 16:26:30 +0000499 # Run the build script to fetch base-artifacts/, which are
500 # required to fetch baseline sources to apply patches to in
501 # pw-apply.sh below. This also initializes the build manifest
502 # with all below settings; we then import this manifest below.
503 #
504 # The parameter __finish_after makes the build script stop
505 # after fetching the baseline and "__" avoids saving this parameter
506 # in the manifest, so that we don't see this option in the main
507 # run of the build script below.
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000508 build_container_exec \
Maxim Kuvyrkov8da7e852023-05-25 16:26:30 +0000509 ./jenkins-scripts/{build_script} \
510 %%rr[top_artifacts] artifacts \
Maxim Kuvyrkov67698ea2024-01-05 15:26:07 +0000511 ==rr[ci_project] '{ci_project}' \
512 ==rr[ci_config] '{ci_config}' \
Maxim Kuvyrkov8da7e852023-05-25 16:26:30 +0000513 $extra_build_params \
514 --bmk_branch "$bmk_branch" \
515 --scripts_branch "$scripts_branch" \
516 ==rr[mode] "build" \
517 ==rr[update_baseline] "$update_baseline" \
518 --BUILD_URL "$BUILD_URL" \
Maxim Kuvyrkov8da7e852023-05-25 16:26:30 +0000519 __finish_at reset_artifacts
520
Laurent Alfonsiaf2d9852024-07-02 14:09:46 +0200521 echo "$rr_stage" > artifacts/rr_stage.txt
522
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000523 cat >> artifacts/jenkins/run-build.env <<EOF
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000524 docker_opts=(${{docker_opts[@]+$(printf "%q$IFS" "${{docker_opts[@]}}")}})
525 source build_container.sh
526 trap "cleanup_all_containers" EXIT
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000527 EOF
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000528
529 # Now that we have "trap cleanup_all_containers EXIT" in
530 # run-build.env we need to reset the trap at the end of every
531 # step to preserve container[s] for the next step.
532 trap "" EXIT
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000533 unstable-return: 125
534
535- builder:
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000536 name: run-build-process-params
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000537 builders:
538 - shell:
539 command: |
540 #!/bin/bash
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000541 source artifacts/jenkins/run-build.env
Maxim Kuvyrkov8c8e4aa2023-11-22 18:56:53 +0000542 set -ex
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000543
544 branch_opt=()
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100545 # 1 to skip jenkins-scripts
546 i=1
Maxim Kuvyrkov55290762024-01-05 15:47:34 +0000547 for c in llvm; do
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100548 eval "g=\$$$${{c}}_git"
549 if [ x"$g" = x"default" ]; then
Maxim Kuvyrkoveb378e42024-01-08 06:50:57 +0000550 if [ x"${{BUILD_CAUSE_SCMTRIGGER-false}}" = x"true" ] \
551 || [ x"${{BUILD_CAUSE_TIMERTRIGGER-false}}" = x"true" ]; then
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100552 g="jenkins-scm"
553 else
554 g="baseline"
555 fi
556 fi
557 if [ x"$g" = x"jenkins-scm" ]; then
Laurent Alfonsi2d485072025-05-20 16:06:45 +0000558 eval "gb=\$GIT_BRANCH_$i"
559 gb=$(echo $gb | sed 's+origin/++')
560 eval "g=\$GIT_URL_$i#$gb"
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100561 fi
562 i=$(($i+1))
Maxim Kuvyrkovbc309d52023-05-25 16:08:50 +0000563
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100564 if [ x"$g" != x"baseline" ]; then
565 build_name="$build_name-$c"
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000566 branch_opt+=("==rr[${{c}}_git]" "$g")
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100567 fi
568 done
569
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000570 echo "$build_name" > artifacts/jenkins/build-name
571
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000572 cat >> artifacts/jenkins/run-build.env <<EOF
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000573 build_name="$build_name"
Maxim Kuvyrkovfcbaf902023-07-01 19:20:46 +0000574 branch_opt=(${{branch_opt[@]+$(printf "%q$IFS" "${{branch_opt[@]}}")}})
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000575 EOF
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000576
577 trap "" EXIT
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000578 unstable-return: 125
579
580- builder:
581 name: run-build-main
582 builders:
583 - shell:
584 command: |
585 #!/bin/bash
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000586 source artifacts/jenkins/run-build.env
Maxim Kuvyrkov8c8e4aa2023-11-22 18:56:53 +0000587 set -ex
Maxim Kuvyrkov3a78c872023-05-28 10:25:15 +0000588
Maxim Kuvyrkov86efb0b2023-05-29 09:58:03 +0000589 # Run the build script to from the manifest created above.
590 #
591 # The parameter __start_at makes the build script start right
592 # where the above run finished. This allows us to use read-only
593 # bind-mount for base-artifacts/, which, otherwise, may require
594 # multi-gig rsync.
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000595 build_container_exec \
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100596 ./jenkins-scripts/{build_script} \
Maxim Kuvyrkov8da7e852023-05-25 16:26:30 +0000597 @@rr[top_artifacts] artifacts \
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000598 "${{branch_opt[@]}}" \
Maxim Kuvyrkov86efb0b2023-05-29 09:58:03 +0000599 __start_at reset_artifacts+ &
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100600 res=0 && wait $! || res=$?
601
Maxim Kuvyrkov5a415222023-05-25 15:43:31 +0000602 # Update build_name
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000603 if [ -f artifacts/results ]; then
604 build_name="$build_name-R$(tail -n1 artifacts/results)"
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100605 fi
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000606 if [ "$update_baseline" != "onsuccess" ]; then
607 build_name="$build_name-$update_baseline"
608 fi
609
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100610 if [ -f artifacts/trigger-bisect ]; then
611 build_name="$build_name-trigger-bisect"
612 fi
613 echo "$build_name" > artifacts/jenkins/build-name
Maxim Kuvyrkov5a415222023-05-25 15:43:31 +0000614
615 # Everything but 0 and $INTERNAL_FAILURE is an unexpected exit code,
616 # so stop here and do nothing else. From jenkins point of view ...
617 # - if $res==0: build is successful, so proceed with all
618 # followup steps -- notify, push, trigger precommit.
619 # - if $res==123: build has a regression, so proceed with triggering
620 # followup builds and sending precommit notifications; but stop
621 # before run-push-baseline by checking artifacts/failed.
622 # - if $res is anything else: build has an unexpected failure, so
623 # skip the rest of the steps by setting UNSTABLE build status.
624 # This will cause all followup conditional-steps to skip due to
625 # "current-status" condition.
626 #
627 # See comment before round-robin.sh:check_regression() for details.
628 case $res in
Maxim Kuvyrkov8441bde2023-06-30 16:07:03 +0000629 0)
630 ;;
Maxim Kuvyrkov5a415222023-05-25 15:43:31 +0000631 123)
632 echo 123 > artifacts/failed
633 ;;
634 *)
635 res=125
636 ;;
637 esac
638
639 if [ $res = 125 ]; then
640 # We had unexpected failure in the build scripts, so can't
641 # proceed with triggers and notifications. Mark this build
642 # as UNSTABLE, which will skip all following conditional-steps.
643 exit 125
644 fi
Maxim Kuvyrkov307e26e2023-08-11 10:41:28 +0000645
646 cat >> artifacts/jenkins/run-build.env <<EOF
647 build_name="$build_name"
648 EOF
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000649
650 trap "" EXIT
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100651 unstable-return: 125
Maxim Kuvyrkovac7ff472023-06-28 07:35:50 +0000652
653- builder:
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000654 name: run-build-fini
655 builders:
656 - shell:
657 command: |
658 #!/bin/bash
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000659 source artifacts/jenkins/run-build.env
Maxim Kuvyrkov8c8e4aa2023-11-22 18:56:53 +0000660 set -ex
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000661 # The "trap cleanup_all_containers EXIT" statement in
662 # artifacts/jenkins/run-build.env will remove build and precommit
663 # containers.
664
665- builder:
Maxim Kuvyrkovac7ff472023-06-28 07:35:50 +0000666 name: run-build
667 builders:
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000668 - conditional-step:
669 condition-kind: current-status
670 steps:
Maxim Kuvyrkov5deb8a82023-06-30 13:51:06 +0000671 - run-build-init:
Maxim Kuvyrkov02987c12024-01-10 09:43:41 +0000672 precommit: false
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000673 - build-name-setter:
674 name: 'artifacts/jenkins/build-name'
675 file: true
676 - conditional-step:
677 condition-kind: current-status
678 steps:
Maxim Kuvyrkov5deb8a82023-06-30 13:51:06 +0000679 - run-build-skip-if-queue:
680 dummy: dummy
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000681 - build-name-setter:
682 name: 'artifacts/jenkins/build-name'
683 file: true
684 - conditional-step:
685 condition-kind: current-status
686 steps:
687 - run-build-start-manifest:
Maxim Kuvyrkov67698ea2024-01-05 15:26:07 +0000688 ci_project: '{ci_project}'
689 ci_config: '{ci_config}'
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000690 build_script: '{build_script}'
691 docker_arch: '{docker_arch}'
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000692 - build-name-setter:
693 name: 'artifacts/jenkins/build-name'
694 file: true
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000695 - conditional-step:
696 condition-kind: current-status
697 steps:
Maxim Kuvyrkovd3bf8272023-06-28 17:51:53 +0000698 - run-build-process-params:
Maxim Kuvyrkov55290762024-01-05 15:47:34 +0000699 dummy: dummy
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000700 - build-name-setter:
701 name: 'artifacts/jenkins/build-name'
702 file: true
703 - conditional-step:
704 condition-kind: current-status
705 steps:
Laurent Alfonsi87ab4de2024-04-25 07:34:20 +0200706 - run-push-baseline:
707 build_script: '{build_script}'
Laurent Alfonsi5a667f72024-04-25 14:49:44 +0200708 commit_artifacts: 'false'
Laurent Alfonsi87ab4de2024-04-25 07:34:20 +0200709 - conditional-step:
710 condition-kind: current-status
711 steps:
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000712 - run-build-main:
713 build_script: '{build_script}'
714 - build-name-setter:
715 name: 'artifacts/jenkins/build-name'
716 file: true
717 - conditional-step:
718 condition-kind: current-status
719 steps:
Maxim Kuvyrkovccd89ea2023-06-30 17:16:10 +0000720 - trigger-followup-builds-1:
Maxim Kuvyrkov52c3cc22024-01-05 15:40:26 +0000721 dummy: dummy
Maxim Kuvyrkovccd89ea2023-06-30 17:16:10 +0000722 - trigger-followup-builds-2:
Maxim Kuvyrkov52c3cc22024-01-05 15:40:26 +0000723 ci_project: '{ci_project}'
724 ci_config: '{ci_config}'
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000725 - build-name-setter:
726 name: 'artifacts/jenkins/build-name'
727 file: true
728 - conditional-step:
729 condition-kind: current-status
730 steps:
Maxim Kuvyrkov333b2962023-08-14 08:55:46 +0000731 - run-build-notify:
Thiago Jung Bauermann676c14a2023-09-12 12:37:40 -0300732 build_script: '{build_script}'
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000733 - build-name-setter:
734 name: 'artifacts/jenkins/build-name'
735 file: true
736 - conditional-step:
737 condition-kind: current-status
738 steps:
Maxim Kuvyrkovdc5adc12023-07-01 08:02:24 +0000739 - run-exit-on-failure:
740 dummy: dummy
741 - build-name-setter:
742 name: 'artifacts/jenkins/build-name'
743 file: true
744 - conditional-step:
745 condition-kind: current-status
746 steps:
Maxim Kuvyrkov5deb8a82023-06-30 13:51:06 +0000747 - run-push-baseline:
Maxim Kuvyrkov570e5ea2023-07-01 19:43:07 +0000748 build_script: '{build_script}'
Laurent Alfonsiaa30fa72024-04-26 10:53:34 +0200749 commit_artifacts: 'true'
Laurent Alfonsia8284ec2023-11-16 10:05:38 +0100750 - conditional-step:
751 condition-kind: current-status
752 steps:
753 - run-push-lnt-results:
Maxim Kuvyrkov67698ea2024-01-05 15:26:07 +0000754 ci_project: '{ci_project}'
755 ci_config: '{ci_config}'
Maxim Kuvyrkov99695092023-06-28 09:52:05 +0000756 - build-name-setter:
757 name: 'artifacts/jenkins/build-name'
758 file: true
Maxim Kuvyrkov3ab321b2023-08-14 08:28:29 +0000759 - conditional-step:
760 condition-kind: current-status
761 steps:
762 - run-build-fini:
763 dummy: dummy
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100764
Maxim Kuvyrkovac7ff472023-06-28 07:35:50 +0000765
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100766- publisher:
767 name: build-publishers
768 publishers:
769 - archive:
770 artifacts: 'artifacts/**'
Laurent Alfonsiaa30fa72024-04-26 10:53:34 +0200771 latest-only: false
Laurent Alfonsicbf9a992023-11-23 16:09:27 +0100772 - html-publisher:
773 name: 'HTML Report'
774 dir: 'artifacts/jenkins'
775 files: 'status.html'
776 keep-all: true
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100777 - email-ext:
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100778 recipients: |
Maxim Kuvyrkovf2ea7b72023-08-16 07:59:14 +0000779 ${{FILE,path="artifacts/jenkins/mail-recipients.txt"}}
780 reply-to: linaro-toolchain@lists.linaro.org
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100781 subject: |
Maxim Kuvyrkovf2ea7b72023-08-16 07:59:14 +0000782 ${{FILE,path="artifacts/jenkins/mail-subject.txt"}}
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100783 content-type: text
784 body: |
Maxim Kuvyrkovf2ea7b72023-08-16 07:59:14 +0000785 ${{FILE,path="artifacts/jenkins/mail-body.txt"}}
786 failure: {email_on_failure}
787 success: {email_on_success}
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100788 aborted: false
789 send-to:
790 - recipients
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100791 - email-ext:
792 recipients: |
Maxim Kuvyrkovf2ea7b72023-08-16 07:59:14 +0000793 ${{FILE,path="artifacts/jenkins/error-mail-recipients.txt"}}
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100794 body: |
Maxim Kuvyrkovf2ea7b72023-08-16 07:59:14 +0000795 ${{FILE,path="artifacts/jenkins/error-mail-body.txt"}}
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100796 failure: true
797 success: true
798 aborted: true
799 send-to:
800 - recipients
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100801
802- parameter:
803 name: bisect-parameters
804 parameters:
805 - string:
806 name: current_project
807 default: ""
808 description: "Project to bisect"
809 - string:
810 name: bad_git
811 default: ""
812 description: "Bad git_url#branch/SHA1"
813 - file:
814 name: jenkins-scripts/replay_log
815 description: "Replay part of bisect using provided bisect log"
816 - default-parameters:
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100817 distro: '{distro}'
818
819- wrapper:
820 name: bisect-wrappers
821 wrappers:
822 - build-wrappers:
823 timeout: '{timeout}'
824
825- builder:
826 name: run-bisect
827 builders:
828 - shell:
829 command: |
830 #!/bin/bash
831 set -ex
832 # Delete artifacts now to avoid re-using stale artifacts if
833 # below docker-run.sh fails to start up a container.
834 rm -rf artifacts/
835 mkdir -p artifacts/jenkins
836 build_name="#$BUILD_NUMBER-$current_project"
837 echo "$build_name" > artifacts/jenkins/build-name
838
Maxim Kuvyrkov1fbec982023-07-01 18:39:54 +0000839 cat >> artifacts/jenkins/run-build.env <<EOF
840 build_name="$build_name"
841 EOF
842
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100843 ./jenkins-scripts/docker-run.sh \
844 --distro $distro \
845 --ssh_info true \
Maxim Kuvyrkov687da882023-04-10 15:37:40 +0000846 --arch {docker_arch} \
847 --node $NODE_NAME \
Maxim Kuvyrkov843ba812024-09-30 06:24:27 +0000848 --node_labels "$NODE_LABELS" \
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100849 -- \
Maxim Kuvyrkovd2207ec2024-06-28 14:10:30 +0000850 ./jenkins-scripts/rr/round-robin-bisect.sh \
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100851 %%rel_artifacts artifacts \
852 --BUILD_URL "$BUILD_URL" \
853 --current_project "$current_project" \
854 --bad_git "$bad_git" \
855 --replay_log "$(pwd)/jenkins-scripts/replay_log" \
856 --build_script "./jenkins-scripts/{build_script}" \
857 -- \
Maxim Kuvyrkov67698ea2024-01-05 15:26:07 +0000858 ==rr[ci_project] '{ci_project}' \
859 ==rr[ci_config] '{ci_config}' \
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100860 $extra_build_params \
861 --bmk_branch "$bmk_branch" \
862 --scripts_branch "$scripts_branch" &
863 res=0 && wait $! || res=$?
864
865 if [ $res != 0 ]; then
866 echo $res > artifacts/failed
867 fi
868 unstable-return: 125
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000869 - build-name-setter:
870 name: 'artifacts/jenkins/build-name'
871 file: true
Maxim Kuvyrkovb9fe6a92023-05-29 15:15:14 +0000872 - conditional-step:
Maxim Kuvyrkovb9fe6a92023-05-29 15:15:14 +0000873 condition-kind: current-status
874 steps:
Maxim Kuvyrkovc4245672023-06-30 17:22:57 +0000875 - trigger-followup-builds-1:
Maxim Kuvyrkov52c3cc22024-01-05 15:40:26 +0000876 dummy: dummy
Maxim Kuvyrkovc4245672023-06-30 17:22:57 +0000877 - trigger-followup-builds-2:
Maxim Kuvyrkov52c3cc22024-01-05 15:40:26 +0000878 ci_project: '{ci_project}'
879 ci_config: '{ci_config}'
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000880 - conditional-step:
881 condition-kind: current-status
882 steps:
883 - shell: |
884 #!/bin/bash
885 set -ex
Maxim Kuvyrkovb9fe6a92023-05-29 15:15:14 +0000886
Maxim Kuvyrkov7b799fb2023-06-28 16:01:34 +0000887 if [ -f artifacts/failed ]; then
888 # Mark failed build as FAILURE; no further steps will run.
889 exit $(cat artifacts/failed)
890 fi
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100891
892- publisher:
893 name: bisect-publishers
894 publishers:
895 - archive:
896 artifacts: 'artifacts/**'
897 latest-only: false
898 - email-ext:
899 recipients: |
900 maxim.kuvyrkov@linaro.org, laurent.alfonsi@linaro.org
901 failure: true
902 success: false
903 aborted: true
904 send-to:
905 - recipients
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100906#END: tcwg/round-robin.yaml.inc
907
908- job-template:
Laurent Alfonsi9b9125f2023-02-24 17:25:48 +0100909 name: tcwg_bmk-code_speed-cpu2017speed--llvm-{target}-{toolchain_ver}-{cflags}-build
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100910 project-type: freestyle
911 defaults: global
912 properties:
Laurent Alfonsi2ac30aa2023-08-23 16:13:37 +0200913 - build-properties:
914 ci_project: '{ci_project}'
915 ci_config: '{ci_config}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100916 parameters:
917 - build-parameters:
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100918 default_git: 'default'
919 distro: '{distro}'
Maxim Kuvyrkov186ad342023-09-07 12:08:44 +0000920 # We are waiting for tcwg-bmk-apm-* machines to get PDU control,
921 # so that we can recover from crashes.
922 # See https://linaro.atlassian.net/browse/STG-4212 .
923 disabled: true
Maxim Kuvyrkov7585eb92023-02-24 18:32:15 +0000924 node: tcwg-build_bmk && tcwg-armv8_64
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100925 concurrent: false
Laurent Alfonsi6375a162023-02-23 11:57:15 +0100926 display-name: 'TCWG Build {ci_project}--{ci_config}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100927 workspace: workspace/tcwg_bmk_$EXECUTOR_NUMBER
928 scm:
929 - build-scms:
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100930 llvm_url: '{llvm_url}'
931 llvm_branch: '{llvm_branch}'
932 triggers:
933 - pollscm:
934 cron: '{cron_schedule}'
935 wrappers:
936 - build-wrappers:
Laurent Alfonsi9f55e932023-02-20 12:09:13 +0100937 timeout: 600
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100938 builders:
939 - run-build:
Maxim Kuvyrkov67698ea2024-01-05 15:26:07 +0000940 ci_project: '{ci_project}'
941 ci_config: '{ci_config}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100942 build_script: 'tcwg_bmk-build.sh'
Laurent Alfonsieaf47502023-03-09 11:09:05 +0100943 docker_arch: '{docker_arch}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100944 publishers:
Maxim Kuvyrkovf2ea7b72023-08-16 07:59:14 +0000945 - build-publishers:
946 email_on_failure: false
947 email_on_success: true
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100948
949- job-template:
Laurent Alfonsi9b9125f2023-02-24 17:25:48 +0100950 name: tcwg_bmk-code_speed-cpu2017speed--llvm-{target}-{toolchain_ver}-{cflags}-bisect
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100951 project-type: freestyle
952 defaults: global
953 properties:
Laurent Alfonsi2ac30aa2023-08-23 16:13:37 +0200954 - bisect-properties:
955 ci_project: '{ci_project}'
956 ci_config: '{ci_config}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100957 parameters:
958 - bisect-parameters:
959 distro: '{distro}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100960 disabled: false
Maxim Kuvyrkov5f011c82023-02-25 12:38:25 +0000961 node: tcwg-build_bmk && tcwg-armv8_64
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100962 concurrent: false
Laurent Alfonsi6375a162023-02-23 11:57:15 +0100963 display-name: 'TCWG Bisect {ci_project}--{ci_config}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100964 workspace: workspace/tcwg_bmk_$EXECUTOR_NUMBER
965 scm:
966 - jenkins-scripts
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100967 wrappers:
968 - bisect-wrappers:
969 timeout: 2880
970 builders:
971 - run-bisect:
Maxim Kuvyrkov67698ea2024-01-05 15:26:07 +0000972 ci_project: '{ci_project}'
973 ci_config: '{ci_config}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100974 build_script: 'tcwg_bmk-build.sh'
Laurent Alfonsieaf47502023-03-09 11:09:05 +0100975 docker_arch: '{docker_arch}'
Laurent Alfonsi701c52f2023-02-16 11:38:46 +0100976 publishers:
977 - bisect-publishers
Laurent Alfonsi9da56d82025-03-27 07:16:00 +0100978
Laurent Alfonsi50d9de92025-05-27 13:04:04 +0200979# checksum: 4d991856718b7b7a1b393b7697625af8