blob: fe7ee4503fac01d087820745ac1d8e9a6296aeb6 [file] [log] [blame]
Renato Golinadf6f032017-04-10 14:34:47 +01001- 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 Copeland9dc2eb82022-10-11 12:40:33 +010010 everyone-flat:
Renato Golinadf6f032017-04-10 14:34:47 +010011 - job-build
12 - job-cancel
13 - build-discarder:
14 days-to-keep: 30
Diana Picus2bb3e5c2020-11-02 16:40:02 +010015 num-to-keep: 10
Renato Golinadf6f032017-04-10 14:34:47 +010016 parameters:
17 - string:
18 name: release
19 default: ''
20 description: 'Release number. Ex. 4.0.1'
21 - string:
22 name: candidate
Diana Picuse9edc592021-07-30 12:46:05 +020023 default: 'git-ref=main'
Renato Golinadf6f032017-04-10 14:34:47 +010024 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 Kuvyrkov0759bf42021-01-20 13:38:55 +000031 default: 'lts_1'
Maxim Kuvyrkov4db270a2022-09-05 17:10:55 +000032 description: 'Type of image to use in the container: lts_1, lts, ...'
Maxim Kuvyrkov1d4a7432017-04-13 16:01:42 +000033 - string:
Renato Golin7eb7f482017-05-12 11:47:31 +010034 name: compiler
35 default: 'clang'
36 description: 'Override the default system compiler. Only used if "toolchain" is empty.'
37 - string:
Maxim Kuvyrkov1d4a7432017-04-13 16:01:42 +000038 name: target_list
Diana Picuse9edc592021-07-30 12:46:05 +020039 default: 'tcwg-x86_64-cam tcwg-tk1_32-build tcwg-jade-03'
Renato Golin8555afd2017-05-22 14:26:03 +010040 description: 'List of targets should be a subset of slave axis'
Renato Golin27d86f62017-05-22 17:22:51 +010041 - string:
42 name: scripts_branch
Diana Picus86a7d0a2019-02-25 10:31:32 +010043 default: 'refs/remotes/origin/tested'
Renato Golin27d86f62017-05-22 17:22:51 +010044 description: 'Branch to pull jenkins-script from'
Renato Golin2a70c282017-05-02 17:31:57 +010045 - bool:
Diana Picus57cfd5a2019-07-23 12:58:48 +020046 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 Golin2a70c282017-05-02 17:31:57 +010050 name: testsuite
51 default: true
52 description: 'Whether or not to trigger a test-suite with this build.'
Renato Golinadf6f032017-04-10 14:34:47 +010053 disabled: false
Maxim Kuvyrkove4855222017-05-02 09:18:02 +000054 node: tcwg-coordinator
Renato Golinadf6f032017-04-10 14:34:47 +010055 child-workspace: $label
56 concurrent: true
57 display-name: 'TCWG LLVM Release'
58 scm:
59 - git:
Laurent Alfonsi3c7c10a2025-04-17 17:04:51 +020060 url: https://gitlab.com/Linaro/tcwg/jenkins-scripts.git
Renato Golin27d86f62017-05-22 17:22:51 +010061 refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*
Renato Golinadf6f032017-04-10 14:34:47 +010062 name: origin
63 branches:
Renato Golin27d86f62017-05-22 17:22:51 +010064 - ${scripts_branch}
Renato Golinadf6f032017-04-10 14:34:47 +010065 skip-tag: true
66 shallow-clone: true
67 wipe-workspace: true
68 axes:
69 - axis:
70 type: slave
71 name: label
72 values:
Renato Golind99597d2017-05-08 18:53:38 +010073 - tcwg-x86_64-cam
Renato Golinadf6f032017-04-10 14:34:47 +010074 - tcwg-tk1_32-build
Diana Picusfd20bee2020-12-03 13:09:49 +010075 - tcwg-llvm_tk1-01
76 - tcwg-llvm_tk1-02
Diana Picuse9edc592021-07-30 12:46:05 +020077 - tcwg-jade-02
78 - tcwg-jade-03
79 - tcwg-jade-04
Maxim Kuvyrkov1d4a7432017-04-13 16:01:42 +000080 - 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 Golinadf6f032017-04-10 14:34:47 +010089 wrappers:
90 - timeout:
Leandro Luporie868c8f2023-06-01 09:14:23 -030091 timeout: 3840
Renato Golinadf6f032017-04-10 14:34:47 +010092 - timestamps
Christophe Lyonb20720d2017-04-20 13:42:54 +000093 - ssh-agent-credentials:
94 # tcwg-buildslave user id
95 users:
96 - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
Renato Golinadf6f032017-04-10 14:34:47 +010097 - build-name:
98 name: '#${BUILD_NUMBER}'
99 builders:
100 - shell: |
101 #!/bin/bash
102
Renato Golinb87e29e2017-04-27 14:10:35 +0100103 set -ex
Renato Golinadf6f032017-04-10 14:34:47 +0100104
Charles Baylisabd40872017-06-14 09:35:17 +0100105 . jenkins-helpers.sh
106
Renato Golinc3e79132017-04-11 16:29:07 +0100107 # 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 Golin8a9a67d2017-05-02 16:50:25 +0100110 buildjobs=1
Renato Golinc3e79132017-04-11 16:29:07 +0100111
Renato Golinadf6f032017-04-10 14:34:47 +0100112 # Select builder arch/type/container
113 case ${label} in
Renato Golind99597d2017-05-08 18:53:38 +0100114 tcwg-x86_64-build|tcwg-x86_64-cam)
Renato Golinadf6f032017-04-10 14:34:47 +0100115 builder_arch=amd64
Renato Golin8a9a67d2017-05-02 16:50:25 +0100116 buildjobs=8 # 1 slot is 32/4
Renato Golinadf6f032017-04-10 14:34:47 +0100117 ;;
Diana Picusfd20bee2020-12-03 13:09:49 +0100118 tcwg-tk1_32-build|tcwg-llvm_tk1-*)
Renato Golinadf6f032017-04-10 14:34:47 +0100119 builder_arch=armhf
Diana Picus88b29db2019-02-05 12:05:54 +0100120 buildjobs=3 # TK1s only have 4 cores and little RAM
Renato Golinadf6f032017-04-10 14:34:47 +0100121 ;;
Diana Picuse9edc592021-07-30 12:46:05 +0200122 tcwg-jade*)
Renato Golinadf6f032017-04-10 14:34:47 +0100123 builder_arch=arm64
Diana Picuse9edc592021-07-30 12:46:05 +0200124 buildjobs=64 # Jades have lots of cores
Diana Picusdc00d122020-11-04 13:25:28 +0100125 ;;
Renato Golinadf6f032017-04-10 14:34:47 +0100126 *) echo "ERROR: Unsupported label: $label"; exit 1 ;;
127 esac
Renato Golinadf6f032017-04-10 14:34:47 +0100128
Renato Golin7eb7f482017-05-12 11:47:31 +0100129 # 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 Golin803adcb2017-05-05 16:24:55 +0100135 # Trigger toolchain name
Renato Golin5d289d62017-05-12 09:20:41 +0100136 toolchain_file="${WORKSPACE}/llvm.params.toolchain"
Renato Golin803adcb2017-05-05 16:24:55 +0100137 toolchain_file_option=""
138 if ${twostage} || ${testsuite}; then
139 toolchain_file_option="--toolchain-file=$toolchain_file"
140 fi
141
Renato Golinadf6f032017-04-10 14:34:47 +0100142 # Start build container
Charles Baylisabd40872017-06-14 09:35:17 +0100143 builder=$(print_host_for_node $NODE_NAME)
Renato Golinadf6f032017-04-10 14:34:47 +0100144 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 Golinf82dd1b2017-04-27 10:39:15 +0100153 if [ "${BUILD_CONTAINER_CLEANUP}" != "" ]; then
Renato Golinadf6f032017-04-10 14:34:47 +0100154 CONTAINERS_CLEANUP="${BUILD_CONTAINER_CLEANUP}"
Maxim Kuvyrkovf7741112017-04-20 09:38:29 +0000155 trap "${CONTAINERS_CLEANUP}" EXIT
Renato Golinadf6f032017-04-10 14:34:47 +0100156 fi
157
Renato Golin8a9a67d2017-05-02 16:50:25 +0100158 # Setup job parameters and run (for now, just pretend to run)
Renato Golinf82dd1b2017-04-27 10:39:15 +0100159 ret=0
Charles Baylis8c14fd52017-05-03 17:42:33 +0100160 ${BUILD_CONTAINER} "cd ${WORKSPACE} && bash -x ${WORKSPACE}/tcwg-llvm-release.sh \
Renato Golinadf6f032017-04-10 14:34:47 +0100161 --workspace=${WORKSPACE} \
162 --release=${release} \
Renato Golinebdfc132017-04-13 16:28:44 +0100163 --candidate=${candidate} \
Renato Golinadf6f032017-04-10 14:34:47 +0100164 --buildjobs=${buildjobs} \
Renato Golin5f05bb72017-05-11 11:45:36 +0100165 --toolchain=${toolchain} \
Diana Picus57cfd5a2019-07-23 12:58:48 +0200166 --use-ninja=${useninja} \
Renato Golin7eb7f482017-05-12 11:47:31 +0100167 $toolchain_file_option $compiler_option" || ret=$?
Renato Golinf82dd1b2017-04-27 10:39:15 +0100168
Charles Baylis82200882017-05-03 12:03:31 +0100169 if [ $ret -ne 0 ]; then
170 touch llvm.failed
171 fi
172
Renato Golinf82dd1b2017-04-27 10:39:15 +0100173 # Chained jobs
Renato Golinf82dd1b2017-04-27 10:39:15 +0100174 if ${testsuite}; then
Renato Golin803adcb2017-05-05 16:24:55 +0100175 echo "target_list=${label}" > llvm.params.testsuite
176 cat $toolchain_file >> llvm.params.testsuite
Renato Golinf82dd1b2017-04-27 10:39:15 +0100177 fi
178
Charles Baylis82200882017-05-03 12:03:31 +0100179 # failure is handled by conditional step on llvm.failed
180 # so that the testsuite job is always triggered
181 exit 0
Renato Golinf82dd1b2017-04-27 10:39:15 +0100182
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 Golin4408ff82017-05-02 18:14:07 +0100191 block: true
Charles Baylis82200882017-05-03 12:03:31 +0100192 - conditional-step:
193 condition-kind: file-exists
194 condition-filename: llvm.failed
195 steps:
196 - shell: "exit 1"
Diana Picus337c7ea2020-10-30 13:11:02 +0100197 publishers:
198 - archive:
Christophe Lyon2efd42f2020-11-02 20:22:53 +0000199 artifacts: 'artifacts/**'
200 latest-only: false