aboutsummaryrefslogtreecommitdiff
path: root/tcwg-benchmark.yaml.in
blob: db22cad3e4ea31b7022fac225d304e23e64d11c5 (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
#include tcwg/default.yaml.inc

- job:
#if HW_any
    name: tcwg-benchmark
    project-type: freestyle
#else
    name: tcwg-benchmark-#{HW}
    project-type: matrix
#endif
    defaults: global
    properties:
      - default-properties
    parameters:
#if HW_any
        - choice:
            name: bmk_hw
            choices:
              - sq
              - tk1
              - tx1
            description: 'Hardware to use for benchmarking'
#endif
        - string:
            name: toolchain_url
            default: ''
            description: 'Toolchain URL. Either http[s]://xxx.tar.xz, rsync://machine:/path/bin/target-triplet-, or ssh://machine/path/compiler'
        - choice:
            name: toolchain_type
            choices:
              - auto
              - gnu
              - llvm
        - string:
            name: sysroot
            default: 'tarball'
            description: 'Rsync-friendly path to the sysroot to run against; use libs from toolchain_url tarball/rsync if "tarball"; use system libs if empty'
        - string:
           name: bench_list
#if HW_stm32
           default: 'coremark'
#else
           default: 'bzip2'
#endif
           description: 'List of benchmarks to run (from spec2k6). Use "all" to run all of them.'
        - string:
            name: cflags
            default: ''
            description: 'CFLAGS to use'
        - string:
            name: ldflags
            default: 'default'
            description: 'LDFLAGS to use'
        - choice:
            name: extension
            choices:
              - default
              - O2
              - O3
              - O2g
              - O3g
              - Ofast
              - Os
            description: 'Compilation profile'
        - choice:
            name: testmode
            choices:
              - verify
              - build
              - benchmark
            description: 'Whether to just build or run full benchmarks'
        - string:
            name: iterations
            default: '1'
            description: 'Number of benchmark iterations'
        - string:
            name: results_id
#if HW_any
            default: '@hw_tag@/tcwg-benchmark/@build_num@'
#elif HW_tk1
            default: 'tk1_32/tcwg-benchmark/@build_num@'
#elif HW_tx1
            default: 'tx1_64/tcwg-benchmark/@build_num@'
#elif HW_stm32
            default: 'stm32_STM32L476RGTx/tcwg-benchmark/@build_num@'
#endif
            description: 'ID for benchmarking results; results will appear in bkp-01.tcwglab:/home/tcwg-benchmark/results-$results_id/'
        - bool:
            name: forceinstall
#if HW_stm32
            default: 'true'
#else
            default: 'false'
#endif
            description: 'Force clean re-install of benchmark sources'
        - choice:
            name: run_profile
            choices:
#if HW_any
              - parallel
              - serial
#else
              - parallel9x1
              - parallel9x4
              - parallel3x3
              - parallel3x1
              - serial1
#endif
            description: 'Benchmark profile to use: parallel3x3 runs on 3 boards and 3 CPUs in parallel; parallel3x1 runs on 3 boards on 1 CPU in parallel; serial1 runs on a single board on 1 CPU.'
        - string:
            name: image_arch
#if HW_any
            default: 'arm64'
#elif HW_tk1
            default: 'armhf'
#elif HW_tx1
            default: 'arm64'
#endif
            description: 'Docker image architecture -- arm64 or armhf'
        - bool:
            name: reboot
            default: 'false'
            description: 'Reboot the board before building and running the benchmarks.'
        - string:
            name: displaytag
            default: '#$BUILD_NUMBER'
            description: 'Tag to display in the Jenkins console, so that the build name is more meaningful'
        - bool:
            name: ignore_errors
            default: 'false'
            description: 'Ignore build errors as much as possible'
        - string:
            name: clean_older_than
            default: '60'
            description: 'Delete previous results older than X days (on board)'
        - string:
            name: builder
            default: 'tcwg-x86_64-build'
            description: 'Builder -- jenkins label or node'
        - string:
            name: scripts_branch
            default: master
            description: 'Jenkins-scripts branch to use'
        - string:
            name: bmk_branch
            default: master
            description: 'Bmk-scripts branch to use'
#if HW_any
        - node:
            name: bmk_node
            default-slaves:
              - tcwg-bmk-bkp-01
            allowed-slaves:
              - tcwg-bmk-bkp-01
              - tcwg-bmk-sq
              - tcwg-bmk-tk1
              - tcwg-bmk-tx1
            description: 'Bmk node; used internally, do not touch'
#endif
    disabled: false
#if !HW_any
    node: tcwg-bmk-bkp-01
    child-workspace: $label
#endif
    concurrent: true
#if !HW_any
    display-name: 'TCWG BBB Benchmark #{HW}'
#else
    display-name: 'TCWG BBB Benchmark'
    workspace: workspace/tcwg-benchmark-${NODE_NAME}_$EXECUTOR_NUMBER
#endif
    scm:
      - jenkins-scripts
      - bmk-scripts
#if !HW_any
    axes:
        - axis:
            type: slave
            name: label
            values:
# if HW_tk1 || HW_tx1
              - tcwg-bmk-#{HW}-01
              - tcwg-bmk-#{HW}-02
              - tcwg-bmk-#{HW}-03
              - tcwg-bmk-#{HW}-04
              - tcwg-bmk-#{HW}-05
              - tcwg-bmk-#{HW}-06
              - tcwg-bmk-#{HW}-07
              - tcwg-bmk-#{HW}-08
              - tcwg-bmk-#{HW}-09
# elif HW_stm32
              - tcwg-bmk-#{HW}-01
# endif
    execution-strategy:
        sequential: false
#endif
    wrappers:
        - timeout:
            timeout: 900
        - timestamps
        - ssh-agent-credentials:
            users:
                - 'tcwg-benchmark'
        - build-name:
#if !HW_any
            name: '#$BUILD_NUMBER-$displaytag'
#else
            name: '$displaytag'
#endif
    builders:
#if HW_any
      - conditional-step:
          condition-kind: execution-node
          nodes:
            - tcwg-bmk-bkp-01
          steps:
            - shell:
                command: |
                  #!/bin/bash

                  set -euf -o pipefail
                  set -x

                  rm -rf artifacts
                  mkdir artifacts

                  count=1
                  while read -a bmks; do
                    echo "bench_list=${bmks[@]}" > artifacts/bmk-$count-parameters
                    echo "displaytag=#$BUILD_NUMBER-$bmk_hw-$count" >> artifacts/bmk-$count-parameters
                    echo "bmk_node=tcwg-bmk-$bmk_hw" >> artifacts/bmk-$count-parameters
                    count=$(($count+1))
                  done < <(./bmk-scripts/break-up-bmks.sh \
                             --bench_list "$bench_list" \
                             --bmk_hw "$bmk_hw" \
                             --run_profile "$run_profile")
            - trigger-builds:
                - project: tcwg-benchmark
                  block: true
                  parameter-factories:
                    - factory: filebuild
                      file-pattern: artifacts/bmk-*-parameters
                      current-parameters: true
      - conditional-step:
          condition-kind: not
          condition-operand:
            condition-kind: execution-node
            nodes:
              - tcwg-bmk-bkp-01
          steps:
            - shell:
                command: |
                  #!/bin/bash

                  set -euf -o pipefail
                  set -x

                  rm -rf artifacts
                  mkdir artifacts

                  while true; do
                    for lock in $(set +f; ls -tr $HOME/boards/$NODE_NAME-*); do
                      (
                        flock -en -E 123 9
                        NODE_NAME=$(cat <&9)
                        export NODE_NAME
                        exec ./jenkins-scripts/tcwg-benchmark.sh
                      ) 9<$lock &
                      res=0 && wait $! || res=$?
                      if [ $res != 123 ]; then
                        exit $res
                      fi
                    done
                    sleep 30
                  done
                unstable-return: 125
#else
        - shell:
            command: |
              #!/bin/bash

              set -ex
              ssh-add -l

              # Run the benchmark
# if HW_tk1 || HW_tx1
              exec ./jenkins-scripts/tcwg-benchmark.sh
# elif HW_stm32
              exec ./jenkins-scripts/tcwg-benchmark-bare.sh
# endif
            unstable-return: 125
#endif
    publishers:
      - archive:
          artifacts: 'artifacts/**'
          latest-only: false