aboutsummaryrefslogtreecommitdiff
path: root/openembedded-lkft-linux-developer.yaml
blob: 4e4691e398d1c7a0836ccf04fc65fe4816c25e47 (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
- job:
    name: openembedded-lkft-linux-developer
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
            daniel.diaz@linaro.org:
                - job-build
                - job-read
                - job-extended-read
                - job-configure
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 30
            artifact-num-to-keep: 1
    description: |
        <h1>LKFT Developer Build</h1>
        <p>This Jenkins job can build your <b>kernel</b> along with the rest of the
          <b>OpenEmbedded</b> filesystem. It will be <b>published</b> automatically
          and can be <b>tested</b> the same way <b>LKFT</b> runs on the regular
          builds.</p>
        <p>You can compare your test results with existing runs on actual hardware:
           <b>arm (X15)</b>, <b>arm64 (Juno)</b> and <b>x86 (Xeon
           E3-1220)</b>. A description of the hardware can be found
           <a href="https://lkft.linaro.org/boards/">here</a>.</p>
        <p>This is more or less how it goes:
          <ul>
            <li>Jenkins will have the kernel and filesystem built here.</li>
            <li>The filesystem, kernel, and all other artifacts will be published
              in the snapshots server.</li>
            <li>If so desired, Jenkins will pass this information along to the
              qa-reports server, which will in turn send it to LAVA.</li>
            <li>Once test jobs complete in LAVA, test results will get
              consolidated in the qa-reports server.</li>
          </ul>
        </p>
        <p>Links will appear on your build job to point to:
          <ul>
            <li>the published artifacts</li>
            <li>each and every one of the tests submitted</li>
          </ul>
        </p>
        <p>You can start by clicking on <b>Build with Parameters</b>, right here on the left
          pane. Just provide a kernel (Git repo and revision) and we'll take care
          of the rest!<br/>
          (Please note that you need to log-in to Jenkins first if you haven't.)</p>
        <p>Note that these config fragments are added to your defconfig:
          <ul>
            <li><a href="https://github.com/Linaro/meta-lkft/blob/sumo/recipes-kernel/linux/files/distro-overrides.config">distro</a></li>
            <li><a href="https://github.com/Linaro/meta-lkft/blob/sumo/recipes-kernel/linux/files/systemd.config">systemd</a></li>
            <li><a href="https://github.com/Linaro/meta-lkft/blob/sumo/recipes-kernel/linux/files/lkft.config">lkft</a></li>
            <li><a href="https://github.com/torvalds/linux/blob/master/Makefile#L1182">kselftest-merge</a></li>
          </ul>
        </p>
    parameters:
        - string:
            name: KERNEL_REPO
            default: 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git'
            description: |
                <b>[MANDATORY]</b> Kernel repository URL
        - string:
            name: KERNEL_REV
            default: 'master'
            description: |
                <b>[MANDATORY]</b> Kernel branch, tag, or commit ID to checkout.<br/>
                Available trees are:<br/>
                  <ul>
                    <li>origin (the tree you provide)</li>
                    <li>torvalds (Linus' mainline tree)</li>
                    <li>linux-stable (GKH's stable tree)</li>
                    <li>linux-stable-rc (GKH's stable RC tree)</li>
                  </ul>
                You can specifiy any valid Git reference from those trees, such as <tt>origin/myworkbranch</tt>,
                <tt>linux-stable-rc/linux-4.18.y</tt>, <tt>b4dc0ffee</tt>, <tt>v4.9.131</tt>, etc.
        - choice:
            name: TARGET_MACHINE
            choices:
                - 'juno'
                - 'x15'
                - 'x86_64'
                - 'i386'
            description: |
                <b>[MANDATORY]</b> Target machine. Can be juno (arm64), x15 (arm), x86_64, or i386 (32-bits).
        - string:
            name: KERNEL_CONFIG
            default: ''
            description: |
                <b>[OPTIONAL]</b> Kernel config file<br/>
                File to use from arch/${ARCH}/configs/ as base kernel configuration. If ommited the default
                kernel config will be used:<br/>
                  - defconfig on Juno<br/>
                  - multi_v7_defconfig on X15<br/>
                  - x86_64_defconfig on x86_64<br/>
                  - i386_defconfig on i386<br/>
                Note: Additional config fragments are added to all defconfigs to ensure build is functional. See
                <a href="https://ci.linaro.org/job/openembedded-lkft-linux-developer/">the status page</a> for
                more information.
        - extended-choice:
            name: TEST_SUITES
            description: |
                [OPTIONAL] Test suites to run<br/>
                Any combination of the following can be chosen:<br/>
                  - kselftests<br/>
                  - libhugetlbfs<br/>
                  - ltp<br/>
                  - perf<br/>
                Build artifacts will be published regardless of selection here.
            type: checkbox
            value: 'kselftests,libhugetlbfs,ltp,perf'
            multi-select-delimiter: ' '
        - extended-choice:
            name: USE_KSELFTEST_RELEASE
            description: |
                [OPTIONAL] Use latest released version of Kselftests. Useful for Linux Stable branches.
                  - mainline<br/>
            type: checkbox
            value: 'mainline'
            multi-select-delimiter: ' '
        - string:
            name: NOTIFICATION_EMAIL
            default: ''
            description: |
                <b>[OPTIONAL]</b> Notification email<br/>
                If provided, a notification on the build/test results will be
                sent to this email.
    disabled: false
    node: docker-buster-lkft
    display-name: 'LKFT - Linux Developer Builder (OpenEmbedded/sumo)'
    wrappers:
        - timeout:
            timeout: 180
        - timestamps
        - credentials-binding:
            - text:
                credential-id: QA_REPORTS_TOKEN
                variable: QA_REPORTS_TOKEN
    builders:
        - shell: |
            CI_MAIL_RECIPIENTS="daniel.diaz@linaro.org"
            for email in ${NOTIFICATION_EMAIL}; do
                CI_MAIL_RECIPIENTS="${CI_MAIL_RECIPIENTS},${email}"
            done
            echo "CI_MAIL_RECIPIENTS=${CI_MAIL_RECIPIENTS}" > mail_parameters
        - inject:
            properties-file: mail_parameters
        - shell:
            !include-raw: openembedded-lkft/kernel-versions.sh
        - inject:
            properties-file: linux_versions
        - shell: |
            #!/bin/bash -e

            # Target machine is just an user friendly name.
            # Mapping for TARGET_MACHINE -> MACHINE/DEVICE_TYPE
            # Set a default config if it isn't given
            case "${TARGET_MACHINE}" in
              juno)
                MACHINE=juno
                DEVICE_TYPE=juno-r2
                [ -z "${KERNEL_CONFIG}" ] && KERNEL_CONFIG=defconfig
                ;;
              x15)
                MACHINE=am57xx-evm
                DEVICE_TYPE=x15
                [ -z "${KERNEL_CONFIG}" ] && KERNEL_CONFIG=multi_v7_defconfig
                ;;
              x86_64)
                MACHINE=intel-corei7-64
                DEVICE_TYPE=x86
                [ -z "${KERNEL_CONFIG}" ] && KERNEL_CONFIG=x86_64_defconfig
                ;;
              i386)
                MACHINE=intel-core2-32
                DEVICE_TYPE=i386
                [ -z "${KERNEL_CONFIG}" ] && KERNEL_CONFIG=i386_defconfig
                ;;
            esac

            # Convert Git repo to Bitbake's Git URI format
            kernel_repo=$(echo ${KERNEL_REPO} | sed -e 's#\(ssh://\|https\?://\)#git://#')
            # Determine Git connection protocol to use
            kernel_protocol=$(echo ${KERNEL_REPO} | grep -o '.*://' | sed -e 's#://##')

            cat << EOF > ${WORKSPACE}/custom-kernel-info.inc.tmp
            KERNEL_COMMIT = "${KERNEL_SRCREV}"
            KERNEL_REPO = "${kernel_repo}"
            KERNEL_PROTOCOL = "${kernel_protocol}"
            KERNEL_CONFIG_aarch64 = "${KERNEL_CONFIG}"
            KERNEL_CONFIG_arm = "${KERNEL_CONFIG}"
            KERNEL_CONFIG_x86-64 = "${KERNEL_CONFIG}"
            KERNEL_CONFIG_x86 = "${KERNEL_CONFIG}"
            EOF

            KSELFTEST_PATH="/opt/kselftests/default-in-kernel/"
            [ -n "${USE_KSELFTEST_RELEASE}" ] && KSELFTEST_PATH="/opt/kselftests/mainline/"
            [ -z "${TEST_SUITES}" ] && TEST_SUITES="none"

            echo "IMAGES=rpb-console-image-lkft" > parameters
            echo "MANIFEST_URL=https://github.com/96boards/oe-rpb-manifest.git" >> parameters
            echo "MANIFEST_BRANCH=lkft/sumo" >> parameters
            echo "DISTRO=lkft" >> parameters
            echo "MACHINE=${MACHINE}" >> parameters
            echo "DEVICE_TYPE=${DEVICE_TYPE}" >> parameters
            echo "LAVA_SERVER=https://lkft.validation.linaro.org/RPC2/" >> parameters
            echo "LAVA_JOB_PRIORITY=79" >> parameters
            echo "PUB_DEST=openembedded/lkft/sumo/generic/lkft/linux-developer/${BUILD_NUMBER}" >> parameters
            echo "QA_SERVER=https://qa-reports.linaro.org" >> parameters
            echo "QA_SERVER_PROJECT=linux-developer-oe" >> parameters
            echo "KERNEL_SRCREV=${KERNEL_SRCREV}" >> parameters
            echo "KERNEL_RECIPE=linux-generic" >> parameters
            echo "KSELFTEST_PATH=${KSELFTEST_PATH}" >> parameters
            echo "TEST_SUITES=${TEST_SUITES}" >> parameters
            echo "KERNEL_DESCRIBE_SUFFIX=-b${BUILD_NUMBER}" >> parameters
            cat parameters

            echo "#${BUILD_NUMBER}-${KERNEL_SRCREV:0:8}" > ${WORKSPACE}/version.txt
        - build-name-setter:
            name: 'version.txt'
            file: true
        - inject:
            properties-file: parameters
        - shell:
            !include-raw: openembedded-lkft/builders.sh
        - inject:
            properties-file: post_build_lava_parameters
        - linaro-publish-token
        - shell:
            !include-raw: openembedded-lkft/publishers.sh
        - shell:
            !include-raw: openembedded-lkft/submit_for_testing.sh
    publishers:
        - groovy-postbuild:
            script:
                !include-raw:
                  - rpb-openembedded/postbuild.groovy
                  - openembedded-lkft/qareports.groovy
                  - openembedded-lkft/postbuild.groovy
        - email-ext:
            recipients: '${CI_MAIL_RECIPIENTS}'
            matrix-trigger: only-configurations
            subject: '[CI] Developer/${KERNEL_DESCRIBE}: ${BUILD_STATUS}'
            body: |
                Build URL: ${PROJECT_URL}${BUILD_NUMBER}/
                Log: ${PROJECT_URL}${BUILD_NUMBER}/console
                Parsed warnings/errors: ${PROJECT_URL}${BUILD_NUMBER}/parsed_console
                Git URL: ${KERNEL_REPO}
                Git describe: ${KERNEL_DESCRIBE}
                Git commit: ${KERNEL_COMMIT}

                Errors:
                ${BUILD_LOG_REGEX, regex="^ERROR:.* ", linesBefore=0, linesAfter=0, showTruncatedLines=false}