Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 1 | - job: |
| 2 | name: tcwg-llvm-release |
| 3 | project-type: matrix |
| 4 | defaults: global |
| 5 | properties: |
| 6 | - authorization: |
| 7 | anonymous: |
| 8 | - job-read |
| 9 | - job-extended-read |
Benjamin Copeland | 9dc2eb8 | 2022-10-11 12:40:33 +0100 | [diff] [blame] | 10 | everyone-flat: |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 11 | - job-build |
| 12 | - job-cancel |
| 13 | - build-discarder: |
| 14 | days-to-keep: 30 |
Diana Picus | 2bb3e5c | 2020-11-02 16:40:02 +0100 | [diff] [blame] | 15 | num-to-keep: 10 |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 16 | parameters: |
| 17 | - string: |
| 18 | name: release |
| 19 | default: '' |
| 20 | description: 'Release number. Ex. 4.0.1' |
| 21 | - string: |
| 22 | name: candidate |
Diana Picus | e9edc59 | 2021-07-30 12:46:05 +0200 | [diff] [blame] | 23 | default: 'git-ref=main' |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 24 | description: 'RC number. Ex. 1, 2, final' |
| 25 | - string: |
| 26 | name: toolchain |
| 27 | default: '' |
| 28 | description: 'URL of the toolchain to use. This needs to be a tarball with a /bin directory inside with either GCC or LLVM from make install' |
| 29 | - string: |
| 30 | name: build_container_tag |
Maxim Kuvyrkov | 0759bf4 | 2021-01-20 13:38:55 +0000 | [diff] [blame] | 31 | default: 'lts_1' |
Maxim Kuvyrkov | 4db270a | 2022-09-05 17:10:55 +0000 | [diff] [blame] | 32 | description: 'Type of image to use in the container: lts_1, lts, ...' |
Maxim Kuvyrkov | 1d4a743 | 2017-04-13 16:01:42 +0000 | [diff] [blame] | 33 | - string: |
Renato Golin | 7eb7f48 | 2017-05-12 11:47:31 +0100 | [diff] [blame] | 34 | name: compiler |
| 35 | default: 'clang' |
| 36 | description: 'Override the default system compiler. Only used if "toolchain" is empty.' |
| 37 | - string: |
Maxim Kuvyrkov | 1d4a743 | 2017-04-13 16:01:42 +0000 | [diff] [blame] | 38 | name: target_list |
Diana Picus | e9edc59 | 2021-07-30 12:46:05 +0200 | [diff] [blame] | 39 | default: 'tcwg-x86_64-cam tcwg-tk1_32-build tcwg-jade-03' |
Renato Golin | 8555afd | 2017-05-22 14:26:03 +0100 | [diff] [blame] | 40 | description: 'List of targets should be a subset of slave axis' |
Renato Golin | 27d86f6 | 2017-05-22 17:22:51 +0100 | [diff] [blame] | 41 | - string: |
| 42 | name: scripts_branch |
Diana Picus | 86a7d0a | 2019-02-25 10:31:32 +0100 | [diff] [blame] | 43 | default: 'refs/remotes/origin/tested' |
Renato Golin | 27d86f6 | 2017-05-22 17:22:51 +0100 | [diff] [blame] | 44 | description: 'Branch to pull jenkins-script from' |
Renato Golin | 2a70c28 | 2017-05-02 17:31:57 +0100 | [diff] [blame] | 45 | - bool: |
Diana Picus | 57cfd5a | 2019-07-23 12:58:48 +0200 | [diff] [blame] | 46 | name: useninja |
| 47 | default: true |
| 48 | description: 'Whether or not to use ninja for the release (works for releases > 9.0.0)' |
| 49 | - bool: |
Renato Golin | 2a70c28 | 2017-05-02 17:31:57 +0100 | [diff] [blame] | 50 | name: testsuite |
| 51 | default: true |
| 52 | description: 'Whether or not to trigger a test-suite with this build.' |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 53 | disabled: false |
Maxim Kuvyrkov | e485522 | 2017-05-02 09:18:02 +0000 | [diff] [blame] | 54 | node: tcwg-coordinator |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 55 | child-workspace: $label |
| 56 | concurrent: true |
| 57 | display-name: 'TCWG LLVM Release' |
| 58 | scm: |
| 59 | - git: |
Laurent Alfonsi | 3c7c10a | 2025-04-17 17:04:51 +0200 | [diff] [blame] | 60 | url: https://gitlab.com/Linaro/tcwg/jenkins-scripts.git |
Renato Golin | 27d86f6 | 2017-05-22 17:22:51 +0100 | [diff] [blame] | 61 | refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/* |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 62 | name: origin |
| 63 | branches: |
Renato Golin | 27d86f6 | 2017-05-22 17:22:51 +0100 | [diff] [blame] | 64 | - ${scripts_branch} |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 65 | skip-tag: true |
| 66 | shallow-clone: true |
| 67 | wipe-workspace: true |
| 68 | axes: |
| 69 | - axis: |
| 70 | type: slave |
| 71 | name: label |
| 72 | values: |
Renato Golin | d99597d | 2017-05-08 18:53:38 +0100 | [diff] [blame] | 73 | - tcwg-x86_64-cam |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 74 | - tcwg-tk1_32-build |
Diana Picus | fd20bee | 2020-12-03 13:09:49 +0100 | [diff] [blame] | 75 | - tcwg-llvm_tk1-01 |
| 76 | - tcwg-llvm_tk1-02 |
Diana Picus | e9edc59 | 2021-07-30 12:46:05 +0200 | [diff] [blame] | 77 | - tcwg-jade-02 |
| 78 | - tcwg-jade-03 |
| 79 | - tcwg-jade-04 |
Maxim Kuvyrkov | 1d4a743 | 2017-04-13 16:01:42 +0000 | [diff] [blame] | 80 | - axis: |
| 81 | type: dynamic |
| 82 | name: target |
| 83 | values: |
| 84 | - target_list |
| 85 | execution-strategy: |
| 86 | combination-filter: | |
| 87 | label==target |
| 88 | sequential: false |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 89 | wrappers: |
| 90 | - timeout: |
Leandro Lupori | e868c8f | 2023-06-01 09:14:23 -0300 | [diff] [blame] | 91 | timeout: 3840 |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 92 | - timestamps |
Christophe Lyon | b20720d | 2017-04-20 13:42:54 +0000 | [diff] [blame] | 93 | - ssh-agent-credentials: |
| 94 | # tcwg-buildslave user id |
| 95 | users: |
| 96 | - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a' |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 97 | - build-name: |
| 98 | name: '#${BUILD_NUMBER}' |
| 99 | builders: |
| 100 | - shell: | |
| 101 | #!/bin/bash |
| 102 | |
Renato Golin | b87e29e | 2017-04-27 14:10:35 +0100 | [diff] [blame] | 103 | set -ex |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 104 | |
Charles Baylis | abd4087 | 2017-06-14 09:35:17 +0100 | [diff] [blame] | 105 | . jenkins-helpers.sh |
| 106 | |
Renato Golin | c3e7913 | 2017-04-11 16:29:07 +0100 | [diff] [blame] | 107 | # Until we figure out a way to use heavy-job with different weights |
| 108 | # based on the builder, we hardcode to one. |
| 109 | weight=1 |
Renato Golin | 8a9a67d | 2017-05-02 16:50:25 +0100 | [diff] [blame] | 110 | buildjobs=1 |
Renato Golin | c3e7913 | 2017-04-11 16:29:07 +0100 | [diff] [blame] | 111 | |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 112 | # Select builder arch/type/container |
| 113 | case ${label} in |
Renato Golin | d99597d | 2017-05-08 18:53:38 +0100 | [diff] [blame] | 114 | tcwg-x86_64-build|tcwg-x86_64-cam) |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 115 | builder_arch=amd64 |
Renato Golin | 8a9a67d | 2017-05-02 16:50:25 +0100 | [diff] [blame] | 116 | buildjobs=8 # 1 slot is 32/4 |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 117 | ;; |
Diana Picus | fd20bee | 2020-12-03 13:09:49 +0100 | [diff] [blame] | 118 | tcwg-tk1_32-build|tcwg-llvm_tk1-*) |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 119 | builder_arch=armhf |
Diana Picus | 88b29db | 2019-02-05 12:05:54 +0100 | [diff] [blame] | 120 | buildjobs=3 # TK1s only have 4 cores and little RAM |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 121 | ;; |
Diana Picus | e9edc59 | 2021-07-30 12:46:05 +0200 | [diff] [blame] | 122 | tcwg-jade*) |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 123 | builder_arch=arm64 |
Diana Picus | e9edc59 | 2021-07-30 12:46:05 +0200 | [diff] [blame] | 124 | buildjobs=64 # Jades have lots of cores |
Diana Picus | dc00d12 | 2020-11-04 13:25:28 +0100 | [diff] [blame] | 125 | ;; |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 126 | *) echo "ERROR: Unsupported label: $label"; exit 1 ;; |
| 127 | esac |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 128 | |
Renato Golin | 7eb7f48 | 2017-05-12 11:47:31 +0100 | [diff] [blame] | 129 | # Sets the system compiler |
| 130 | compiler_option='' |
| 131 | if [ "${toolchain:+set}" != "set" ] && [ "${compiler:+set}" = "set" ]; then |
| 132 | compiler_option="--compiler=${compiler}" |
| 133 | fi |
| 134 | |
Renato Golin | 803adcb | 2017-05-05 16:24:55 +0100 | [diff] [blame] | 135 | # Trigger toolchain name |
Renato Golin | 5d289d6 | 2017-05-12 09:20:41 +0100 | [diff] [blame] | 136 | toolchain_file="${WORKSPACE}/llvm.params.toolchain" |
Renato Golin | 803adcb | 2017-05-05 16:24:55 +0100 | [diff] [blame] | 137 | toolchain_file_option="" |
| 138 | if ${twostage} || ${testsuite}; then |
| 139 | toolchain_file_option="--toolchain-file=$toolchain_file" |
| 140 | fi |
| 141 | |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 142 | # Start build container |
Charles Baylis | abd4087 | 2017-06-14 09:35:17 +0100 | [diff] [blame] | 143 | builder=$(print_host_for_node $NODE_NAME) |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 144 | bash ${WORKSPACE}/start-container-docker.sh --arch ${builder_arch} --distro ${build_container_tag} --session-host ${builder} --weight ${weight} > build-container.sh |
| 145 | |
| 146 | # Define CONTAINER, CONTAINER_CLEANUP, session_host and session_port |
| 147 | . ./build-container.sh |
| 148 | BUILD_CONTAINER="${CONTAINER}" |
| 149 | BUILD_CONTAINER_CLEANUP="${CONTAINER_CLEANUP}" |
| 150 | |
| 151 | # Make sure to cleanup build container if something goes |
| 152 | # wrong when preparing the test environment |
Renato Golin | f82dd1b | 2017-04-27 10:39:15 +0100 | [diff] [blame] | 153 | if [ "${BUILD_CONTAINER_CLEANUP}" != "" ]; then |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 154 | CONTAINERS_CLEANUP="${BUILD_CONTAINER_CLEANUP}" |
Maxim Kuvyrkov | f774111 | 2017-04-20 09:38:29 +0000 | [diff] [blame] | 155 | trap "${CONTAINERS_CLEANUP}" EXIT |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 156 | fi |
| 157 | |
Renato Golin | 8a9a67d | 2017-05-02 16:50:25 +0100 | [diff] [blame] | 158 | # Setup job parameters and run (for now, just pretend to run) |
Renato Golin | f82dd1b | 2017-04-27 10:39:15 +0100 | [diff] [blame] | 159 | ret=0 |
Charles Baylis | 8c14fd5 | 2017-05-03 17:42:33 +0100 | [diff] [blame] | 160 | ${BUILD_CONTAINER} "cd ${WORKSPACE} && bash -x ${WORKSPACE}/tcwg-llvm-release.sh \ |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 161 | --workspace=${WORKSPACE} \ |
| 162 | --release=${release} \ |
Renato Golin | ebdfc13 | 2017-04-13 16:28:44 +0100 | [diff] [blame] | 163 | --candidate=${candidate} \ |
Renato Golin | adf6f03 | 2017-04-10 14:34:47 +0100 | [diff] [blame] | 164 | --buildjobs=${buildjobs} \ |
Renato Golin | 5f05bb7 | 2017-05-11 11:45:36 +0100 | [diff] [blame] | 165 | --toolchain=${toolchain} \ |
Diana Picus | 57cfd5a | 2019-07-23 12:58:48 +0200 | [diff] [blame] | 166 | --use-ninja=${useninja} \ |
Renato Golin | 7eb7f48 | 2017-05-12 11:47:31 +0100 | [diff] [blame] | 167 | $toolchain_file_option $compiler_option" || ret=$? |
Renato Golin | f82dd1b | 2017-04-27 10:39:15 +0100 | [diff] [blame] | 168 | |
Charles Baylis | 8220088 | 2017-05-03 12:03:31 +0100 | [diff] [blame] | 169 | if [ $ret -ne 0 ]; then |
| 170 | touch llvm.failed |
| 171 | fi |
| 172 | |
Renato Golin | f82dd1b | 2017-04-27 10:39:15 +0100 | [diff] [blame] | 173 | # Chained jobs |
Renato Golin | f82dd1b | 2017-04-27 10:39:15 +0100 | [diff] [blame] | 174 | if ${testsuite}; then |
Renato Golin | 803adcb | 2017-05-05 16:24:55 +0100 | [diff] [blame] | 175 | echo "target_list=${label}" > llvm.params.testsuite |
| 176 | cat $toolchain_file >> llvm.params.testsuite |
Renato Golin | f82dd1b | 2017-04-27 10:39:15 +0100 | [diff] [blame] | 177 | fi |
| 178 | |
Charles Baylis | 8220088 | 2017-05-03 12:03:31 +0100 | [diff] [blame] | 179 | # failure is handled by conditional step on llvm.failed |
| 180 | # so that the testsuite job is always triggered |
| 181 | exit 0 |
Renato Golin | f82dd1b | 2017-04-27 10:39:15 +0100 | [diff] [blame] | 182 | |
| 183 | - conditional-step: |
| 184 | condition-kind: file-exists |
| 185 | condition-filename: llvm.params.testsuite |
| 186 | steps: |
| 187 | - trigger-builds: |
| 188 | - project: 'tcwg-llvm-testsuite' |
| 189 | property-file: llvm.params.testsuite |
| 190 | current-parameters: true |
Renato Golin | 4408ff8 | 2017-05-02 18:14:07 +0100 | [diff] [blame] | 191 | block: true |
Charles Baylis | 8220088 | 2017-05-03 12:03:31 +0100 | [diff] [blame] | 192 | - conditional-step: |
| 193 | condition-kind: file-exists |
| 194 | condition-filename: llvm.failed |
| 195 | steps: |
| 196 | - shell: "exit 1" |
Diana Picus | 337c7ea | 2020-10-30 13:11:02 +0100 | [diff] [blame] | 197 | publishers: |
| 198 | - archive: |
Christophe Lyon | 2efd42f | 2020-11-02 20:22:53 +0000 | [diff] [blame] | 199 | artifacts: 'artifacts/**' |
| 200 | latest-only: false |