jjb: Derive lttng-modules architecture from platform label
authorKienan Stewart <kstewart@efficios.com>
Mon, 7 Aug 2023 20:21:22 +0000 (16:21 -0400)
committerKienan Stewart <kstewart@efficios.com>
Mon, 7 Aug 2023 20:55:57 +0000 (16:55 -0400)
This change updates the URL for fetching built kernels to key them by
build platform. This is done so that it's possible to differentiate a
kernel built on on deb12-amd64 (which will use gcc-12 by default) and
those built on bionic-amd64 which use gcc-7 by default.

An effect of this change is that all the kernels will need to be
rebuilt once the jobs are updated. It may be worth flushing the object
store of the linux kernels as this change is made so files in the old
paths are not kept endlessly without reason.

Change-Id: I96e0e6140827c660012e1264d96a324d8cca8801

jobs/lttng-modules.yaml
scripts/lttng-modules/param-build.sh

index f741ddf8d899434938c0a781b3c2d07a74877b3a..4b5482b159c368179ada0575a9abab163e752b68 100644 (file)
     axes:
       - axis:
           type: slave
-          name: arch
-          values: '{obj:arch}'
+          name: platforms
+          values: '{obj:platforms}'
 
     properties:
       - build-discarder:
     axes:
       - axis:
           type: slave
-          name: arch
-          values: '{obj:arch}'
+          name: platforms
+          values: '{obj:platforms}'
 
     properties:
       - build-discarder:
       - workspace-cleanup
 
 
+- job-template:
+    name: dev_mjeanson_lttng-modules_PARAM_crossbuild
+    defaults: lttng-modules
+    description: |
+      This is a parametrized job used by 'master' jobs to build any combinations
+      of lttng-modules and linux kernel versions.
+
+      <p>Job is managed by Jenkins Job Builder.</p>
+
+    project-type: matrix
+    node: 'master' # Applies only to matrix flyweight task
+    axes:
+      - axis:
+          type: user-defined
+          name: cross_arch
+          values: '{obj:cross_arch}'
+      - axis:
+          type: slave
+          name: platforms
+          values: '{obj:platforms}'
+
+    properties:
+      - build-discarder:
+          days-to-keep: 2
+
+    parameters:
+      - string:
+          name: 'mversion'
+          default: 'master'
+          description: 'The lttng-modules branch to build.'
+      - string:
+          name: 'mgitrepo'
+          default: 'git://git-mirror.internal.efficios.com/lttng/lttng-modules.git'
+          description: 'The lttng-modules git repository url.'
+      - string:
+          name: 'ktag'
+          default: ''
+          description: 'The linux kernel git tag to build against.'
+      - string:
+          name: 'kgitrepo'
+          default: 'git://git-mirror.internal.efficios.com/git/linux-all.git'
+          description: 'The linux kernel git repository url.'
+
+    concurrent: true
+
+    scm: []
+
+    triggers: []
+
+    builders:
+      - shell:
+          !include-raw-escape: scripts/lttng-modules/param-build.sh
+
+    publishers:
+      - workspace-cleanup
+
 - job-template:
     name: lttng-modules_PARAM_crossbuild
     defaults: lttng-modules
 
 # Parametrized kernel and modules build jobs
       - 'lttng-modules_PARAM_build':
-          arch: !!python/tuple [amd64]
+          platforms: !!python/tuple [amd64]
       - 'lttng-modules_PARAM_crossbuild':
           cross_arch: !!python/tuple [armhf, arm64, powerpc, ppc64el]
 
     email_to: ''
     jobs:
       - 'dev_mjeanson_lttng-modules_PARAM_build':
-          arch: !!python/tuple [amd64]
+          platforms: !!python/tuple [deb12-amd64]
+      - 'dev_mjeanson_lttng-modules_PARAM_crossbuild':
+          platforms: !!python/tuple [deb12-amd64]
+          cross_arch: !!python/tuple [armhf, arm64, powerpc, ppc64el]
       - 'dev_mjeanson_lttng-modules_{mversion}_{buildtype}-vanilla':
           mversion:
             - master
index 68320e2685c4b95c76bcfcbab1708c3bd2067fe2..ab604a99832df813381bf052424e0356b4c6e724 100644 (file)
 set -exu
 
 # Parameters
-arch=${arch:-amd64}
+platforms=${platforms:-}
+# Derive arch from label if it isn't set
+if [ -z "${arch:-}" ] ; then
+    # Labels may be platform specific, eg. jammy-amd64, deb12-armhf
+    regex='[[:alnum:]]+-([[:alnum:]]+)'
+    if [[ "${platforms}" =~ ${regex} ]] ; then
+        arch="${BASH_REMATCH[1]}"
+    else
+        arch="${platforms:-}"
+    fi
+fi
 cross_arch=${cross_arch:-}
 ktag=${ktag:-}
 kgitrepo=${kgitrepo:-}
 mversion=${mversion:-}
 mgitrepo=${mgitrepo:-}
 
-
 ## FUNCTIONS ##
 
 # Kernel version compare functions
@@ -648,9 +657,9 @@ url_hash="$(echo -n "$kgitrepo" | md5sum | awk '{ print $1 }')"
 obj_name="linux.tar.bz2"
 
 if [ "x${cross_arch}" = "x" ]; then
-       obj_url_prefix="$OBJ_STORE_URL/linux-build/$url_hash/$ktag/$arch/native"
+       obj_url_prefix="$OBJ_STORE_URL/linux-build/$url_hash/$ktag/platform-${platform}/$arch/native"
 else
-       obj_url_prefix="$OBJ_STORE_URL/linux-build/$url_hash/$ktag/${cross_arch}"
+       obj_url_prefix="$OBJ_STORE_URL/linux-build/$url_hash/$ktag/platform-${platform}/${cross_arch}"
 fi
 
 obj_url="$obj_url_prefix/$obj_name"
This page took 0.025784 seconds and 4 git commands to generate.