aboutsummaryrefslogtreecommitdiff
path: root/openembedded-lkft-linux-developer.yaml
blob: 17123505e3e148c9a9dae19a3068ad86b7f2bc52 (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
- 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 (HiKey)</b> and <b>x86_64 (Xeon
           E3-1220)</b></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!</p>
        <p>Note that these config fragments are added to your defconfig:
          <ul>
            <li><a href="https://github.com/96boards/meta-96boards/blob/master/recipes-kernel/linux/linux-hikey-aosp/distro-overrides.config">distro</a></li>
            <li><a href="https://github.com/96boards/meta-96boards/blob/master/recipes-kernel/linux/linux-hikey-aosp/systemd.config">systemd</a></li>
            <li><a href="https://github.com/96boards/meta-96boards/blob/master/recipes-kernel/linux/linux-hikey-aosp/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_BRANCH
            default: 'master'
            description: |
                <b>[MANDATORY]</b> Kernel branch
        - choice:
            name: TARGET_MACHINE
            choices:
                - 'hikey'
                - 'x15'
                - 'x86'
            description: |
                <b>[MANDATORY]</b> Target machine. Can be hikey (arm64), x15 (arm), or x86 (x86_64).
        - string:
            name: KERNEL_CONFIG
            default: ''
            description: |
                <b>[OPTIONAL]</b> Kernel config<br>
                If ommited the default kernel config will use<br>
                  - defconfig on arm64<br>
                  - multi_v7_defconfig on arm<br>
                  - x86_64_defconfig on x86<br>
                An URL pointing to the config can be used as well.<br/>
                Note: an additional config fragment is added to ensure systemd is functional
        - string:
            name: KERNEL_COMMIT
            default: ''
            description: |
                <b>[OPTIONAL]</b> Kernel commit<br>
                If ommited TIP will be used<br>
                e.g.: 0adb32858b0bddf4ada5f364a84ed60b196dbcda
        - string:
            name: TEST_SUITES
            default: 'none'
            description: |
                <b>[OPTIONAL]</b> Test suites to run<br/>
                Can be blank (for all), 'none' for no tests, or a combination of the following separated by space:
                  - kselftests
                  - libhugetlbfs
                  - ltp
                E.g.: 'kselftests ltp'
    disabled: false
    node: docker-lkft
    display-name: 'LKFT - Linux Developer Builder (OpenEmbedded/rocko)'
    wrappers:
        - timeout:
            timeout: 180
        - timestamps
        - credentials-binding:
            - text:
                credential-id: QA_REPORTS_TOKEN
                variable: QA_REPORTS_TOKEN
    builders:
        - 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
              hikey)
                MACHINE=hikey
                DEVICE_TYPE=hi6220-hikey
                # or Juno? (it is supported from in 4.4 kernel while HiKey isn't)
                #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)
                MACHINE=intel-core2-32
                DEVICE_TYPE=x86
                [ -z "${KERNEL_CONFIG}" ] && KERNEL_CONFIG=x86_64_defconfig
                ;;
            esac

            cat << EOF > ${WORKSPACE}/custom-kernel-info.inc.tmp
            KERNEL_COMMIT = "${KERNEL_SRCREV}"
            KERNEL_REPO = "${KERNEL_REPO/http*:/git:}"
            KERNEL_BRANCH = "${KERNEL_BRANCH}"
            KERNEL_CONFIG_aarch64 = "${KERNEL_CONFIG}"
            KERNEL_CONFIG_arm = "${KERNEL_CONFIG}"
            KERNEL_CONFIG_x86-64 = "${KERNEL_CONFIG}"
            EOF

            echo "IMAGES=rpb-console-image-lkft" > parameters
            echo "MANIFEST_URL=https://github.com/96boards/oe-rpb-manifest.git" >> parameters
            echo "MANIFEST_BRANCH=rocko" >> parameters
            echo "DISTRO=rpb" >> parameters
            echo "MACHINE=${MACHINE}" >> parameters
            echo "DEVICE_TYPE=${DEVICE_TYPE}" >> parameters
            echo "LAVA_SERVER=https://lkft.validation.linaro.org/RPC2/" >> parameters
            echo "PUB_DEST=openembedded/lkft/rocko/generic/rpb/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
            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-generic.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-staging.sh
        - shell:
            !include-raw: openembedded-lkft/qemu-testjobs.sh
        - inject:
            properties-file: qemu_device_type_parameters
        - shell:
            !include-raw: openembedded-lkft/submit_for_testing-staging.sh
    publishers:
        - groovy-postbuild:
            script:
                !include-raw:
                  - rpb-openembedded/postbuild.groovy
                  - openembedded-lkft/postbuild.groovy
        - email-ext:
            recipients: 'daniel.diaz@linaro.org'
            matrix-trigger: only-configurations
            subject: '[CI] Developer/${KERNEL_BRANCH}: ${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 branch: ${KERNEL_BRANCH}
                Git commit: ${KERNEL_COMMIT}

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