aboutsummaryrefslogtreecommitdiff
path: root/tcwg_bmk.yaml
blob: 5ea2acc52c431d7c18f206b1fb6b1795eb6a4800 (plain)
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
- project:
    name: tcwg_bmk
    toolchain_name:
      - gnu:
          binutils_url: https://sourceware.org/git/binutils-gdb.git
          gcc_url: https://gcc.gnu.org/git/gcc.git
          glibc_url: https://sourceware.org/git/glibc.git
          linux_url: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
          linux_branch: linux-4.19.y
          init_configuration: 'false'
    toolchain_ver:
      - master:
          binutils_branch: master
          gcc_branch: master
          glibc_branch: master
      - release:
          binutils_branch: binutils-2_31-branch
          gcc_branch: gcc-8-branch
          glibc_branch: release/2.28/master
    target:
      - aarch64
      - arm
    component:
      - binutils
      - gcc
      - glibc
    bmk:
      - spec2k6
    cflags:
      - Os
      - Os_LTO
    jobs:
      - 'tcwg_bmk-trigger-{component}-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}'
      - 'tcwg_bmk-build-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}'
      - 'tcwg_bmk-bisect-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}'
      - 'tcwg_bmk-experimental-trigger-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}'

- view:
    name: tcwg_bmk
    view-type: list
    regex: 'tcwg_bmk-b.*'

- scm:
    name: binutils-scm
    scm:
        - git:
            url: '{binutils_url}'
            branches:
              - 'refs/heads/{binutils_branch}'
            basedir: binutils
            skip-tag: true
            sparse-checkout:
              paths:
                - README
            reference-repo: /home/tcwg-buildslave/snapshots-ref/binutils-gdb.git
            wipe-workspace: false
            clean:
              before: true
            prune: true
- scm:
    name: gcc-scm
    scm:
        - git:
            url: '{gcc_url}'
            branches:
              - 'refs/heads/{gcc_branch}'
            basedir: gcc
            skip-tag: true
            sparse-checkout:
              paths:
                - README
            reference-repo: /home/tcwg-buildslave/snapshots-ref/gcc.git
            wipe-workspace: false
            clean:
              before: true
            prune: true
- scm:
    name: glibc-scm
    scm:
        - git:
            url: '{glibc_url}'
            branches:
              - 'refs/heads/{glibc_branch}'
            basedir: glibc
            skip-tag: true
            sparse-checkout:
              paths:
                - README
            reference-repo: /home/tcwg-buildslave/snapshots-ref/glibc.git
            wipe-workspace: false
            clean:
              before: true
            prune: true
- scm:
    name: bmk-scripts
    scm:
      - git:
          url: https://git-us.linaro.org/toolchain/bmk-scripts.git
          refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*
          branches:
            - $bmk_branch
          basedir: bmk-scripts
          skip-tag: true
          reference-repo: /home/tcwg-buildslave/snapshots-ref/bmk-scripts.git
          wipe-workspace: false
          clean:
            before: true
          prune: true

- property:
    name: default_properties
    properties:
      - authorization:
          tcwg-benchmark:
            - job-read
            - job-extended-read
            - job-build
            - job-cancel
      - build-discarder:
          days-to-keep: 30
          num-to-keep: 30

- job-template:
    name: tcwg_bmk-trigger-{component}-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}
    project-type: freestyle
    defaults: global
    properties:
      - default_properties
      - build-blocker:
          blocking-jobs:
            - "tcwg_bmk-build-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}"
            - "tcwg_bmk-bisect-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}"
          queue-scanning: 'ALL'
    disabled: false
    node: tcwg-coordinator
    concurrent: false
    display-name: 'TCWG Trigger {toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags} @ {component}'
    workspace: workspace/tcwg_bmk-{toolchain_name}/$JOB_NAME
    scm:
      - '{component}-scm':
          binutils_url: '{binutils_url}'
          binutils_branch: '{binutils_branch}'
          gcc_url: '{gcc_url}'
          gcc_branch: '{gcc_branch}'
          glibc_url: '{glibc_url}'
          glibc_branch: '{glibc_branch}'
    triggers:
      - pollscm:
          cron: 'H H H/2 * *'
    wrappers:
        - timeout:
            timeout: 600
        - timestamps
    builders:
      - trigger-builds:
          - project: tcwg_bmk-build-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}
            predefined-parameters: |
              current_project={component}
              current_branch=$GIT_COMMIT

- job-template:
    name: tcwg_bmk-experimental-trigger-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}
    project-type: freestyle
    defaults: global
    properties:
      - default_properties
      - build-blocker:
          blocking-jobs:
            - "tcwg_bmk-build-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}"
            - "tcwg_bmk-bisect-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}"
          queue-scanning: 'ALL'
    disabled: false
    node: tcwg-coordinator
    concurrent: false
    display-name: 'TCWG Experimental Trigger {toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}'
    workspace: workspace/tcwg_bmk-{toolchain_name}/$JOB_NAME
    scm:
      - binutils-scm:
          binutils_url: '{binutils_url}'
          binutils_branch: '{binutils_branch}'
      - gcc-scm:
          gcc_url: '{gcc_url}'
          gcc_branch: '{gcc_branch}'
      - glibc-scm:
          glibc_url: '{glibc_url}'
          glibc_branch: '{glibc_branch}'
    triggers:
      - pollscm:
          cron: 'H * * * *'
    wrappers:
        - timeout:
            timeout: 600
        - timestamps
    builders:
      - shell: |
          #!/bin/bash
          set -ex
          env
          components=(binutils gcc glibc)
          rm -f trigger-*
          for i in "" "_1" "_2"; do
            if eval "[ x\$GIT_COMMIT$i != x\$GIT_PREVIOUS_COMMIT$i ]"; then
              cat > "trigger-${{components[0]}}" << EOF
          current_project=${{components[0]}}
          current_branch=$(eval "\$GIT_COMMIT$i")
          EOF
            fi
            components=("${{components[@]:1}}")
          done
          for trigger in trigger-*; do
            cat $trigger
          done

- parameter:
    name: gnu-parameters
    parameters:
      - choice:
          name: current_project
          choices:
            - binutils
            - gcc
            - glibc
          description: 'Project to {action}'

- scm:
    name: jenkins-scripts
    scm:
      - git:
          url: https://git-us.linaro.org/toolchain/jenkins-scripts.git
          refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*
          branches:
            - $scripts_branch
          basedir: jenkins-scripts
          skip-tag: true
          reference-repo: /home/tcwg-buildslave/snapshots-ref/jenkins-scripts.git
          wipe-workspace: false
          clean:
            before: true
          prune: true

- job-template:
    name: tcwg_bmk-build-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}
    project-type: freestyle
    defaults: global
    properties:
      - default_properties
      - build-blocker:
          blocking-jobs:
            - "tcwg_bmk-bisect-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}"
          queue-scanning: 'ALL'
    parameters:
      - '{toolchain_name}-parameters':
          action: build
      - string:
          name: current_branch
          default: default
          description: "Git rev of $current_project to build"
      - bool:
          name: reset_baseline
          default: false
          description: "Whether to reset baseline to results of this build"
      - string:
          name: distro
          default: bionic
          description: 'Distro image to use'
      - string:
          name: scripts_branch
          default: tcwg_bmk
          description: 'Scripts revision to use'
      - string:
          name: bmk_branch
          default: tcwg_bmk
          description: 'Benchmark scripts revision to use'
    disabled: false
    node: tcwg-x86_64-dev-01
    concurrent: false
    display-name: 'TCWG Build {toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}'
    workspace: workspace/tcwg_bmk-build-{toolchain_name}_$EXECUTOR_NUMBER
    scm:
      - jenkins-scripts
      - bmk-scripts
    wrappers:
      - timeout:
          timeout: 600
      - timestamps
      - ssh-agent-credentials:
          # tcwg-buildslave user id
          users:
            - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
    builders:
        - shell: |
            #!/bin/bash
            set -ex
            # Delete artifacts now to avoid re-using stale artifacts if
            # below docker-run.sh fails to start up a container.
            rm -rf artifacts/
            mkdir -p artifacts/jenkins
            build_name="#$BUILD_NUMBER-$current_project"
            echo "$build_name" > artifacts/jenkins/build-name
        - build-name-setter:
            name: 'artifacts/jenkins/build-name'
            file: true
        - shell: |
            #!/bin/bash
            set -ex
            ./jenkins-scripts/docker-run.sh \
            --distro $distro \
            --ssh_info true \
            -- \
            ./jenkins-scripts/tcwg_bmk-build.sh \
            %% artifacts/jenkins/manifest.sh \
            --BUILD_URL "$BUILD_URL" \
            --BUILD_NUMBER "$BUILD_NUMBER" \
            --scripts_branch "$scripts_branch" \
            --bmk_branch "$bmk_branch" \
            ==rr[ci_config] {toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags} \
            ==rr[init_configuration] {init_configuration} \
            ==rr[binutils_url] {binutils_url} ==rr[binutils_branch] {binutils_branch} \
            ==rr[gcc_url] {gcc_url} ==rr[gcc_branch] {gcc_branch} \
            ==rr[glibc_url] {glibc_url} ==rr[glibc_branch] {glibc_branch} \
            ==rr[linux_url] {linux_url} ==rr[linux_branch] {linux_branch} \
            ==rr[mode] "jenkins-full" \
            ==rr[current_project] "$current_project" \
            ==rr[current_branch] "$current_branch" \
            ==rr[reset_baseline] "$reset_baseline" &
            res=0 && wait $! || res=$?

            if [ $res != 0 ]; then
              touch artifacts/failures
            fi

            name="#$BUILD_NUMBER-$current_project"
            if [ -e artifacts/results ]; then
              name="$name-R$(tail -n1 artifacts/results)"
            fi
            if [ -e artifacts/distance-to-baseline ]; then
              name="$name-B$(cat artifacts/distance-to-baseline)"
            fi
            if $reset_baseline; then
              name="$name-baseline"
              # Don't trigger bisect if this [possibly failed] build is
              # the new baseline.
              rm -f artifacts/trigger-bisect-on-failure
            fi
            if [ ! -f artifacts/failures ]; then
              rm -f artifacts/trigger-bisect-on-failure
            fi
            if [ -f artifacts/trigger-bisect-on-failure ]; then
              name="$name-bisect"
              echo "distro=$distro" >> artifacts/trigger-bisect-on-failure
              echo "scripts_branch=$scripts_branch" >> artifacts/trigger-bisect-on-failure
              echo "bmk_branch=$bmk_branch" >> artifacts/trigger-bisect-on-failure
            fi

            echo "$name" > artifacts/jenkins/build-name
        - build-name-setter:
            name: 'artifacts/jenkins/build-name'
            file: true
        - conditional-step:
            condition-kind: file-exists
            condition-filename: artifacts/trigger-bisect-on-failure
            steps:
              - trigger-builds:
                  - project: tcwg_bmk-bisect-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}
                    property-file: artifacts/trigger-bisect-on-failure
        - shell: |
            #!/bin/bash
            if [ -f artifacts/failures ]; then
              exit 1
            fi
    publishers:
        - archive:
            artifacts: 'artifacts/**'
            latest-only: false

- job-template:
    name: tcwg_bmk-bisect-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}
    project-type: freestyle
    defaults: global
    properties:
      - default_properties
      - build-blocker:
          # Run at most 1 bisect job for all configurations.
          # Bisect jobs can easily run for 5+ hours, and a few of them
          # can hog the entire TCWG build farm for a long time.  Since
          # same regression tends to appear in multiple configurations,
          # run bisections for all configurations in-order.
          blocking-jobs:
            - "tcwg_bmk-bisect-*"
          queue-scanning: 'BUILDABLE'
    parameters:
      - '{toolchain_name}-parameters':
          action: bisect
      - string:
          name: baseline_rev
          default: default
          description: "Baseline revision"
      - string:
          name: bad_rev
          default: default
          description: "Bad revision"
      - string:
          name: mail_recipients
          default: default
          description: "Comma-separated list of email recipients; use 'default' unless testing"
      - string:
          name: distro
          default: bionic
          description: 'Distro image to use'
      - string:
          name: scripts_branch
          default: tcwg_bmk
          description: 'Scripts revision to use'
      - string:
          name: bmk_branch
          default: tcwg_bmk
          description: 'Benchmark scripts revision to use'
    disabled: false
    node: tcwg-x86_64-dev-01
    concurrent: false
    display-name: 'TCWG Bisect {toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}'
    workspace: workspace/tcwg_bmk-bisect-{toolchain_name}_$EXECUTOR_NUMBER
    scm:
      - jenkins-scripts
      - bmk-scripts
    wrappers:
      - timeout:
          timeout: 1440
      - timestamps
      - ssh-agent-credentials:
          # tcwg-buildslave user id
          users:
            - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
    builders:
        - shell: |
            #!/bin/bash
            set -ex
            # Delete artifacts now to avoid re-using stale artifacts if
            # below docker-run.sh fails to start up a container.
            rm -rf artifacts/
            mkdir -p artifacts/jenkins
            build_name="#$BUILD_NUMBER-$current_project"
            echo "$build_name" > artifacts/jenkins/build-name
            # artifacts/jenkins/mail-*.txt will be overwritten in successful builds.
            echo "christophe.lyon@linaro.org" > artifacts/jenkins/mail-recipients.txt
            echo "Build $BUILD_URL failed" > artifacts/jenkins/mail-body.txt
        - build-name-setter:
            name: 'artifacts/jenkins/build-name'
            file: true
        - shell: |
            #!/bin/bash
            set -ex
            ./jenkins-scripts/docker-run.sh \
            --distro $distro \
            --ssh_info true \
            -- \
            ./jenkins-scripts/tcwg_kernel-bisect.sh \
            %% artifacts/manifests/bisect.sh \
            --BUILD_URL "$BUILD_URL" \
            --baseline_rev "$baseline_rev" \
            --bad_rev "$bad_rev" \
            --build_script "./jenkins-scripts/tcwg_bmk-build.sh" \
            --ci_project tcwg_bmk \
            -- \
            --scripts_branch "$scripts_branch" \
            --bmk_branch "$bmk_branch" \
            ==rr[ci_config] {toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}
            ==rr[binutils_url] {binutils_url} ==rr[binutils_branch] {binutils_branch} \
            ==rr[gcc_url] {gcc_url} ==rr[gcc_branch] {gcc_branch} \
            ==rr[glibc_url] {glibc_url} ==rr[glibc_branch] {glibc_branch} \
            ==rr[linux_url] {linux_url} ==rr[linux_branch] {linux_branch} \
            ==rr[current_project] "$current_project"

            for i in artifacts/trigger-1-reset-baseline artifacts/trigger-2-build-master; do
              if [ -f $i ]; then
                echo "distro=$distro" >> $i
                echo "scripts_branch=$scripts_branch" >> $i
                echo "bmk_branch=$bmk_branch" >> $i
              fi
            done

            if [ x"$mail_recipients" != x"default" ]; then
              echo "$mail_recipients" > artifacts/jenkins/mail-recipients.txt
            fi
        - build-name-setter:
            name: 'artifacts/jenkins/build-name'
            file: true
        - conditional-step:
            condition-kind: file-exists
            condition-filename: artifacts/trigger-1-reset-baseline
            steps:
              - trigger-builds:
                  - project: tcwg_bmk-build-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}
                    property-file: artifacts/trigger-1-reset-baseline
        - conditional-step:
            condition-kind: file-exists
            condition-filename: artifacts/trigger-2-build-master
            steps:
              - trigger-builds:
                  - project: tcwg_bmk-build-{toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags}
                    property-file: artifacts/trigger-2-build-master
    publishers:
        - archive:
            artifacts: 'artifacts/**'
            latest-only: false
        - email-ext:
            recipients: ${{FILE,path="artifacts/jenkins/mail-recipients.txt"}}
            content-type: text
            body: |
              ${{FILE,path="artifacts/jenkins/mail-body.txt"}}
            failure: true
            success: true
            send-to:
              - recipients