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') { | |
35 | agent { label 'bionic-amd64' } | |
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') { | |
56 | parallel { | |
57 | stage('Build amd64 deps') { | |
58 | agent { label 'bionic-amd64' } | |
59 | stages { | |
60 | stage('Clean workspace') { | |
61 | steps { | |
62 | cleanWs() | |
63 | } | |
64 | } | |
65 | ||
66 | stage('Build') { | |
67 | environment { | |
68 | BASEDIR_64 = "$WORKSPACE/deps-64" | |
69 | BASEDIR_BUILD_64 = "$BASEDIR_64/build" | |
70 | INCLUDE_DIR_64 = "$BASEDIR_BUILD_64/include" | |
71 | CPPFLAGS = "-I$INCLUDE_DIR_64" | |
72 | LDFLAGS = "-L$BASEDIR_BUILD_64/lib" | |
73 | PKG_CONFIG_PATH = "$BASEDIR_BUILD_64/lib/pkgconfig" | |
74 | LD_LIBRARY_PATH ="$BASEDIR_BUILD_64/lib:$LD_LIBRARY_PATH" | |
75 | PATH ="$PATH:$BASEDIR_64/bin" | |
76 | PREFIX = "/build" | |
77 | JAVA_HOME="/usr/lib/jvm/default-java" | |
78 | CLASSPATH="/usr/share/java/log4j-api.jar:/usr/share/java/log4j-core.jar:/usr/share/java/log4j-1.2.jar" | |
79 | PYTHON3="python3" | |
80 | PYTHON_CONFIG="python3-config" | |
81 | CXXFLAGS="-g -O0" | |
82 | CFLAGS="-g -O0" | |
83 | } | |
84 | steps { | |
85 | unstash name: 'dep-sources' | |
86 | ||
87 | /* Prevent non existent include dir warnings */ | |
88 | sh 'mkdir -p $INCLUDE_DIR_64' | |
89 | ||
90 | dir("src/userspace-rcu") { | |
91 | sh ''' | |
92 | ./bootstrap | |
93 | ./configure --prefix="$PREFIX" | |
94 | make -j"$(nproc)" V=1 | |
95 | make install DESTDIR="$WORKSPACE" | |
96 | ''' | |
97 | ||
98 | sh ''' | |
99 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
100 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
101 | ''' | |
102 | } | |
103 | ||
104 | /* Move the artifact of the recently build project to the deps file and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ | |
105 | sh ''' | |
106 | cp -rv build/ $BASEDIR_64 | |
107 | rm -rv build/ | |
108 | ''' | |
109 | ||
110 | dir("src/lttng-ust") { | |
111 | sh ''' | |
112 | ./bootstrap | |
113 | ./configure --prefix="$PREFIX" --enable-java-agent-all --enable-jni-interface --enable-python-agent | |
114 | make -j"$(nproc)" V=1 | |
115 | make install DESTDIR="$WORKSPACE" | |
116 | ''' | |
117 | ||
118 | sh ''' | |
119 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
120 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
121 | ''' | |
122 | } | |
123 | ||
124 | /* Move the artifact of the recently build project to the deps file and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ | |
125 | sh ''' | |
126 | cp -rv build/ $BASEDIR_64 | |
127 | rm -rv build/ | |
128 | ''' | |
129 | ||
130 | stash name: "amd64-deps-lttng-tools", includes: 'deps-64/**' | |
131 | } | |
132 | } | |
133 | } | |
134 | } | |
135 | stage('Build i386, including lttng-tools') { | |
136 | agent { label 'bionic-i386' } | |
137 | stages { | |
138 | stage('Clean workspace') { | |
139 | steps { | |
140 | cleanWs() | |
141 | } | |
142 | } | |
143 | ||
144 | stage('Build') { | |
145 | environment { | |
146 | BASEDIR_32 = "$WORKSPACE/deps-32" | |
147 | BASEDIR_BUILD_32 = "$BASEDIR_32/build" | |
148 | INCLUDE_DIR_32 = "$BASEDIR_BUILD_32/include" | |
149 | CPPFLAGS = "-I$INCLUDE_DIR_32" | |
150 | LDFLAGS = "-L$BASEDIR_BUILD_32/lib" | |
151 | PKG_CONFIG_PATH = "$BASEDIR_BUILD_32/lib/pkgconfig" | |
152 | LD_LIBRARY_PATH ="$BASEDIR_BUILD_32/lib" | |
153 | PATH ="$PATH:$BASEDIR_32/bin" | |
154 | PREFIX = "/build" | |
155 | CXXFLAGS="-g -O0" | |
156 | CFLAGS="-g -O0" | |
157 | } | |
158 | steps { | |
159 | unstash name: 'dep-sources' | |
160 | unstash name: 'tools-sources' | |
161 | ||
162 | /* Prevent non existent include dir warnings */ | |
163 | sh 'mkdir -p $INCLUDE_DIR_32' | |
164 | ||
165 | dir("src/userspace-rcu") { | |
166 | sh ''' | |
167 | ./bootstrap | |
168 | ./configure --prefix="$PREFIX" | |
169 | make -j"$(nproc)" V=1 | |
170 | make install DESTDIR="$WORKSPACE" | |
171 | ''' | |
172 | ||
173 | sh ''' | |
174 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
175 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
176 | ''' | |
177 | } | |
178 | ||
179 | /* Move the artifact of the recently build project to the deps file and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ | |
180 | sh ''' | |
181 | cp -rv build/ $BASEDIR_32 | |
182 | rm -rv build/ | |
183 | ''' | |
184 | ||
185 | ||
186 | dir("src/lttng-ust") { | |
187 | sh ''' | |
188 | ./bootstrap | |
189 | ./configure --prefix="$PREFIX" | |
190 | make V=1 | |
191 | make install DESTDIR="$WORKSPACE" | |
192 | ''' | |
193 | ||
194 | sh ''' | |
195 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
196 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
197 | ''' | |
198 | } | |
199 | ||
200 | /* Move the artifact of the recently build project to the deps file and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ | |
201 | sh ''' | |
202 | cp -rv build/ $BASEDIR_32 | |
203 | rm -rv build/ | |
204 | ''' | |
205 | ||
206 | dir("src/lttng-tools") { | |
207 | sh ''' | |
208 | ./bootstrap | |
209 | ./configure --prefix="$PREFIX" | |
210 | make V=1 | |
211 | make install DESTDIR="$WORKSPACE" | |
212 | ''' | |
213 | sh ''' | |
214 | find "$WORKSPACE/build/bin" -type f -perm -0500 -exec chrpath --delete {} \\; | |
215 | find "$WORKSPACE/build/lib" -name "*.so" -exec chrpath --delete {} \\; | |
216 | find "$WORKSPACE/build/lib" -name "*.la" -exec rm -vf {} \\; | |
217 | ''' | |
218 | } | |
219 | ||
220 | /* Move the artifact of the recently build project to the deps file and remove the "build" directory to prevent `make install` shenanigans for lttng-ust 2.12 */ | |
221 | sh ''' | |
222 | cp -rv build/ $BASEDIR_32 | |
223 | rm -rv build/ | |
224 | ''' | |
225 | ||
226 | stash name: "i386-deps-lttng-tools", includes: 'deps-32/**' | |
227 | ||
228 | {% if version != 'stable-2.12' %} | |
229 | /* Save the i386 ld_preloaded libraries for sessiond pausing */ | |
230 | stash name: "i386-deps-sessiond-notification-pause-lib", includes: 'src/lttng-tools/tests/regression/tools/notification/.libs/libpause_sessiond.so' | |
231 | {% endif %} | |
232 | } | |
233 | } | |
234 | } | |
235 | } | |
236 | } | |
237 | } | |
238 | stage('Object store') { | |
239 | agent { label 'bionic-amd64' } | |
240 | environment { | |
241 | S3_PREFIX = "s3://jenkins/32-64-bit-integration" | |
242 | } | |
243 | steps { | |
244 | cleanWs() | |
245 | dir('tar/sources') { | |
246 | unstash name: "modules-sources" | |
247 | unstash name: "tools-sources" | |
248 | } | |
249 | dir('tar/deps') { | |
250 | unstash name: "i386-deps-lttng-tools" | |
251 | unstash name: "amd64-deps-lttng-tools" | |
252 | } | |
253 | dir('tar/testing-overlay/sessiond') { | |
254 | {% if version == 'stable-2.12' %} | |
255 | sh ''' | |
256 | echo "No testing overlay" > testing_overlay.txt | |
257 | ''' | |
258 | {% else %} | |
259 | unstash name: "i386-deps-sessiond-notification-pause-lib" | |
260 | {% endif %} | |
261 | } | |
262 | ||
263 | dir('tar') { | |
264 | sh ''' | |
265 | echo $(pwd) | |
266 | ls -lah ./ | |
267 | tar -cf "$WORKSPACE/$BUILD_TAG.tar.bz2" -I pbzip2 . | |
268 | ''' | |
269 | } | |
270 | ||
271 | sh ''' | |
272 | echo "# Setup endpoint | |
273 | host_base = obj.internal.efficios.com | |
274 | host_bucket = obj.internal.efficios.com | |
275 | bucket_location = us-east-1 | |
276 | use_https = True | |
277 | ||
278 | # Setup access keys | |
279 | access_key = jenkins | |
280 | secret_key = echo123456 | |
281 | ||
282 | # Enable S3 v4 signature APIs | |
283 | signature_v2 = False" > "$WORKSPACE/.s3cfg" | |
284 | s3cmd -c "$WORKSPACE/.s3cfg" put "$WORKSPACE/$BUILD_TAG.tar.bz2" "$S3_PREFIX/" | |
285 | ''' | |
286 | } | |
287 | ||
288 | } | |
289 | stage('Testing') { | |
290 | parallel { | |
291 | stage('canary') { | |
292 | agent none | |
293 | steps { | |
294 | 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 }}")] | |
295 | } | |
296 | } | |
297 | stage('CLI 32-bit') { | |
298 | agent none | |
299 | steps { | |
300 | 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 }}")] | |
301 | } | |
302 | } | |
303 | stage('sessiond 32-bit') { | |
304 | agent none | |
305 | steps { | |
306 | 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 }}")] | |
307 | } | |
308 | } | |
309 | stage('relayd 32-bit') { | |
310 | agent none | |
311 | steps { | |
312 | 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 }}")] | |
313 | } | |
314 | } | |
315 | } | |
316 | } | |
317 | } | |
318 | } |