Commit | Line | Data |
---|---|---|
946bf6a7 JR |
1 | #!groovy |
2 | ||
3 | {% set test_job_name = 'integration_lttng-tools-32-64_test' %} | |
4 | ||
5 | pipeline { | |
6 | agent none | |
7 | ||
8 | /* Global options for the pipeline */ | |
9 | options { | |
10 | preserveStashes() | |
11 | buildDiscarder(logRotator(numToKeepStr: '5')) | |
12 | disableConcurrentBuilds() | |
13 | timestamps() | |
14 | skipDefaultCheckout() | |
15 | } | |
16 | ||
17 | triggers { | |
18 | pollSCM('@hourly') | |
19 | } | |
20 | ||
21 | parameters { | |
22 | string(name: 'LTTNG_TOOLS_GIT_REPO', defaultValue: 'https://github.com/lttng/lttng-tools', description: 'The http git repo to be cloned for the lttng-tools project') | |
23 | string(name: 'LTTNG_TOOLS_GIT_BRANCH', defaultValue: '{{ version }}', description: 'The {{ version }} equivalent branch to be checkout-ed') | |
24 | } | |
25 | ||
26 | stages { | |
27 | /* | |
28 | * i386 artefact cannot be reused for 2 reason. | |
29 | * The first one is that the amd64 and i386 node do not run the same distro and libc version. | |
30 | * The second, is that we need to ensure that the lttng-ust used | |
31 | * is the same for the amd64 and i386 and that for now we do not | |
32 | * have this guarantee since we used 2 different jobs | |
33 | */ | |
34 | stage('Checkout all sources') { | |
363515a5 | 35 | agent { label 'deb12-amd64' } |
946bf6a7 JR |
36 | steps { |
37 | dir("src/userspace-rcu") { | |
38 | checkout([$class: 'GitSCM', branches: [[name: '{{ urcu_version }}']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/urcu/userspace-rcu']]]) | |
39 | } | |
40 | dir("src/lttng-modules") { | |
41 | checkout([$class: 'GitSCM', branches: [[name: '{{ version }}']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/lttng/lttng-modules']]]) | |
42 | } | |
43 | dir("src/lttng-ust") { | |
44 | checkout([$class: 'GitSCM', branches: [[name: '{{ version }}']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/lttng/lttng-ust']]]) | |
45 | } | |
46 | dir("src/lttng-tools") { | |
47 | checkout([$class: 'GitSCM', branches: [[name: "${params.LTTNG_TOOLS_GIT_BRANCH}"]], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: "${params.LTTNG_TOOLS_GIT_REPO}"]]]) | |
48 | } | |
49 | stash name: 'dep-sources', includes: 'src/userspace-rcu/**,src/lttng-ust/**' | |
50 | stash name: 'modules-sources', includes: 'src/lttng-modules/**' | |
51 | stash name: 'tools-sources', includes: 'src/lttng-tools/**,' | |
52 | } | |
53 | } | |
54 | ||
55 | stage('Build') { | |
363515a5 | 56 | /* Build the i386 and amd64 artifacts in parallel */ |
946bf6a7 JR |
57 | parallel { |
58 | stage('Build amd64 deps') { | |
363515a5 | 59 | agent { label 'deb12-amd64' } |
946bf6a7 JR |
60 | stages { |
61 | stage('Clean workspace') { | |
62 | steps { | |
63 | cleanWs() | |
64 | } | |
65 | } | |
66 | ||
67 | stage('Build') { | |
68 | environment { | |
69 | BASEDIR_64 = "$WORKSPACE/deps-64" | |
70 | BASEDIR_BUILD_64 = "$BASEDIR_64/build" | |
71 | INCLUDE_DIR_64 = "$BASEDIR_BUILD_64/include" | |
72 | CPPFLAGS = "-I$INCLUDE_DIR_64" | |
73 | LDFLAGS = "-L$BASEDIR_BUILD_64/lib" | |
74 | PKG_CONFIG_PATH = "$BASEDIR_BUILD_64/lib/pkgconfig" | |
75 | LD_LIBRARY_PATH ="$BASEDIR_BUILD_64/lib:$LD_LIBRARY_PATH" | |
76 | PATH ="$PATH:$BASEDIR_64/bin" | |
77 | PREFIX = "/build" | |
78 | JAVA_HOME="/usr/lib/jvm/default-java" | |
79 | CLASSPATH="/usr/share/java/log4j-api.jar:/usr/share/java/log4j-core.jar:/usr/share/java/log4j-1.2.jar" | |
80 | PYTHON3="python3" | |
81 | PYTHON_CONFIG="python3-config" | |
82 | CXXFLAGS="-g -O0" | |
83 | CFLAGS="-g -O0" | |
84 | } | |
85 | steps { | |
86 | unstash name: 'dep-sources' | |
87 | ||
88 | /* Prevent non existent include dir warnings */ | |
89 | sh 'mkdir -p $INCLUDE_DIR_64' | |
90 | ||
91 | dir("src/userspace-rcu") { | |
92 | sh ''' | |
93 | ./bootstrap | |
94 | ./configure --prefix="$PREFIX" | |
95 | make -j"$(nproc)" V=1 | |
96 | make install DESTDIR="$WORKSPACE" | |
97 | ''' | |
98 | ||
99 | sh ''' | |
100 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
101 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
102 | ''' | |
103 | } | |
104 | ||
363515a5 | 105 | /* Move the artifacts of the recently built project to the deps directory and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ |
946bf6a7 JR |
106 | sh ''' |
107 | cp -rv build/ $BASEDIR_64 | |
363515a5 | 108 | rm -rvf build/ |
946bf6a7 JR |
109 | ''' |
110 | ||
111 | dir("src/lttng-ust") { | |
112 | sh ''' | |
113 | ./bootstrap | |
114 | ./configure --prefix="$PREFIX" --enable-java-agent-all --enable-jni-interface --enable-python-agent | |
115 | make -j"$(nproc)" V=1 | |
116 | make install DESTDIR="$WORKSPACE" | |
117 | ''' | |
118 | ||
119 | sh ''' | |
120 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
121 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
122 | ''' | |
123 | } | |
124 | ||
363515a5 | 125 | /* Move the artifacts of the recently built project to the deps directory and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ |
946bf6a7 JR |
126 | sh ''' |
127 | cp -rv build/ $BASEDIR_64 | |
363515a5 | 128 | rm -rvf build/ |
946bf6a7 JR |
129 | ''' |
130 | ||
131 | stash name: "amd64-deps-lttng-tools", includes: 'deps-64/**' | |
132 | } | |
133 | } | |
134 | } | |
135 | } | |
136 | stage('Build i386, including lttng-tools') { | |
363515a5 | 137 | agent { label 'deb12-i386' } |
946bf6a7 JR |
138 | stages { |
139 | stage('Clean workspace') { | |
140 | steps { | |
141 | cleanWs() | |
142 | } | |
143 | } | |
144 | ||
145 | stage('Build') { | |
146 | environment { | |
147 | BASEDIR_32 = "$WORKSPACE/deps-32" | |
148 | BASEDIR_BUILD_32 = "$BASEDIR_32/build" | |
149 | INCLUDE_DIR_32 = "$BASEDIR_BUILD_32/include" | |
150 | CPPFLAGS = "-I$INCLUDE_DIR_32" | |
151 | LDFLAGS = "-L$BASEDIR_BUILD_32/lib" | |
152 | PKG_CONFIG_PATH = "$BASEDIR_BUILD_32/lib/pkgconfig" | |
153 | LD_LIBRARY_PATH ="$BASEDIR_BUILD_32/lib" | |
154 | PATH ="$PATH:$BASEDIR_32/bin" | |
155 | PREFIX = "/build" | |
156 | CXXFLAGS="-g -O0" | |
157 | CFLAGS="-g -O0" | |
158 | } | |
159 | steps { | |
160 | unstash name: 'dep-sources' | |
161 | unstash name: 'tools-sources' | |
162 | ||
163 | /* Prevent non existent include dir warnings */ | |
164 | sh 'mkdir -p $INCLUDE_DIR_32' | |
165 | ||
166 | dir("src/userspace-rcu") { | |
167 | sh ''' | |
168 | ./bootstrap | |
169 | ./configure --prefix="$PREFIX" | |
170 | make -j"$(nproc)" V=1 | |
171 | make install DESTDIR="$WORKSPACE" | |
172 | ''' | |
173 | ||
174 | sh ''' | |
175 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
176 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
177 | ''' | |
178 | } | |
179 | ||
363515a5 | 180 | /* Move the artifacts of the recently built project to the deps directory and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ |
946bf6a7 JR |
181 | sh ''' |
182 | cp -rv build/ $BASEDIR_32 | |
363515a5 | 183 | rm -rvf build/ |
946bf6a7 JR |
184 | ''' |
185 | ||
186 | ||
187 | dir("src/lttng-ust") { | |
188 | sh ''' | |
189 | ./bootstrap | |
190 | ./configure --prefix="$PREFIX" | |
191 | make V=1 | |
192 | make install DESTDIR="$WORKSPACE" | |
193 | ''' | |
194 | ||
195 | sh ''' | |
196 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
197 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
198 | ''' | |
199 | } | |
200 | ||
363515a5 | 201 | /* Move the artifacts of the recently built project to the deps directory and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ |
946bf6a7 JR |
202 | sh ''' |
203 | cp -rv build/ $BASEDIR_32 | |
363515a5 | 204 | rm -rvf build/ |
946bf6a7 JR |
205 | ''' |
206 | ||
207 | dir("src/lttng-tools") { | |
208 | sh ''' | |
209 | ./bootstrap | |
210 | ./configure --prefix="$PREFIX" | |
211 | make V=1 | |
212 | make install DESTDIR="$WORKSPACE" | |
213 | ''' | |
214 | sh ''' | |
215 | find "$WORKSPACE/build/bin" -type f -perm -0500 -exec chrpath --delete {} \\; | |
216 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
217 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
218 | ''' | |
219 | } | |
220 | ||
363515a5 | 221 | /* Move the artifacts of the recently built project to the deps directory and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ |
946bf6a7 JR |
222 | sh ''' |
223 | cp -rv build/ $BASEDIR_32 | |
363515a5 | 224 | rm -rvf build/ |
946bf6a7 JR |
225 | ''' |
226 | ||
227 | stash name: "i386-deps-lttng-tools", includes: 'deps-32/**' | |
228 | ||
229 | {% if version != 'stable-2.12' %} | |
230 | /* Save the i386 ld_preloaded libraries for sessiond pausing */ | |
231 | stash name: "i386-deps-sessiond-notification-pause-lib", includes: 'src/lttng-tools/tests/regression/tools/notification/.libs/libpause_sessiond.so' | |
232 | {% endif %} | |
233 | } | |
234 | } | |
235 | } | |
236 | } | |
237 | } | |
238 | } | |
239 | stage('Object store') { | |
363515a5 | 240 | agent { label 'deb12-amd64' } |
946bf6a7 JR |
241 | environment { |
242 | S3_PREFIX = "s3://jenkins/32-64-bit-integration" | |
243 | } | |
244 | steps { | |
245 | cleanWs() | |
246 | dir('tar/sources') { | |
247 | unstash name: "modules-sources" | |
248 | unstash name: "tools-sources" | |
249 | } | |
250 | dir('tar/deps') { | |
251 | unstash name: "i386-deps-lttng-tools" | |
252 | unstash name: "amd64-deps-lttng-tools" | |
253 | } | |
254 | dir('tar/testing-overlay/sessiond') { | |
255 | {% if version == 'stable-2.12' %} | |
256 | sh ''' | |
257 | echo "No testing overlay" > testing_overlay.txt | |
258 | ''' | |
259 | {% else %} | |
260 | unstash name: "i386-deps-sessiond-notification-pause-lib" | |
261 | {% endif %} | |
262 | } | |
263 | ||
264 | dir('tar') { | |
265 | sh ''' | |
266 | echo $(pwd) | |
267 | ls -lah ./ | |
268 | tar -cf "$WORKSPACE/$BUILD_TAG.tar.bz2" -I pbzip2 . | |
269 | ''' | |
270 | } | |
271 | ||
272 | sh ''' | |
273 | echo "# Setup endpoint | |
274 | host_base = obj.internal.efficios.com | |
275 | host_bucket = obj.internal.efficios.com | |
276 | bucket_location = us-east-1 | |
277 | use_https = True | |
278 | ||
279 | # Setup access keys | |
280 | access_key = jenkins | |
281 | secret_key = echo123456 | |
282 | ||
283 | # Enable S3 v4 signature APIs | |
284 | signature_v2 = False" > "$WORKSPACE/.s3cfg" | |
285 | s3cmd -c "$WORKSPACE/.s3cfg" put "$WORKSPACE/$BUILD_TAG.tar.bz2" "$S3_PREFIX/" | |
286 | ''' | |
287 | } | |
288 | ||
289 | } | |
290 | stage('Testing') { | |
291 | parallel { | |
292 | stage('canary') { | |
293 | agent none | |
294 | steps { | |
295 | build job: '{{ test_job_name }}', parameters: [string(name: 'ARTIFACT_ID', value: "${BUILD_TAG}.tar.bz2"), string(name: 'TEST_TYPE', value: 'canary'), string(name: 'BT_VERSION', value: "{{ babelversion }}")] | |
296 | } | |
297 | } | |
298 | stage('CLI 32-bit') { | |
299 | agent none | |
300 | steps { | |
301 | build job: '{{ test_job_name }}', parameters: [string(name: 'ARTIFACT_ID', value: "${BUILD_TAG}.tar.bz2"), string(name: 'TEST_TYPE', value: '32bit-cli'), string(name: 'BT_VERSION', value: "{{ babelversion }}")] | |
302 | } | |
303 | } | |
304 | stage('sessiond 32-bit') { | |
305 | agent none | |
306 | steps { | |
307 | build job: '{{ test_job_name }}', parameters: [string(name: 'ARTIFACT_ID', value: "${BUILD_TAG}.tar.bz2"), string(name: 'TEST_TYPE', value: '32bit-sessiond'), string(name: 'BT_VERSION', value: "{{ babelversion }}")] | |
308 | } | |
309 | } | |
310 | stage('relayd 32-bit') { | |
311 | agent none | |
312 | steps { | |
313 | build job: '{{ test_job_name }}', parameters: [string(name: 'ARTIFACT_ID', value: "${BUILD_TAG}.tar.bz2"), string(name: 'TEST_TYPE', value: '32bit-relayd'), string(name: 'BT_VERSION', value: "{{ babelversion }}")] | |
314 | } | |
315 | } | |
316 | } | |
317 | } | |
318 | } | |
319 | } |