diff mbox series

[yocto-autobuilder2] config.py: remove debian11 for master

Message ID 20250919-master-exclude-debian11-v1-1-bc0e7c7998ea@bootlin.com
State New
Headers show
Series [yocto-autobuilder2] config.py: remove debian11 for master | expand

Commit Message

Antonin Godard Sept. 19, 2025, 9:22 a.m. UTC
We want to keep the debian11 worker, but we want it only for the stable
releases. The current code in config.py does not allow master to run on
its own filtered list of workers, it just takes all workers in
all_workers.

Rename workers_prev_releases to worker_filters, and include master in
the list. By default, the list of workers for master is the same as
all_workers, but we remove the workers listed in master_exclude_list.

We have to do some mangling to remove the -vk. If something wrong
happens an exception is raised.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
For context see:
https://lore.kernel.org/r/DCW1DRNGJELA.1WL7VLD0XA7T2@bootlin.com
---
 builders.py       |  4 ++--
 config.py         | 20 ++++++++++++++++++--
 docker/Dockerfile |  2 +-
 3 files changed, 21 insertions(+), 5 deletions(-)


---
base-commit: 5dab41d319bc8a5fece467485d11fbf05cee5688
change-id: 20250919-master-exclude-debian11-110818d0934b

Best regards,
--  
Antonin Godard <antonin.godard@bootlin.com>
diff mbox series

Patch

diff --git a/builders.py b/builders.py
index d26b7e9..03af055 100644
--- a/builders.py
+++ b/builders.py
@@ -163,11 +163,11 @@  def nextWorker(bldr, workers, buildrequest):
         # Has to be a better way to do this
         branch = buildrequest.sources[''].branch
     if branch and "bringup" not in bldr.name:
-        for branchname in config.workers_prev_releases:
+        for branchname in config.worker_filters:
             if branchname in branch:
                 possible_workers = []
                 for w in workers:
-                    if w.worker.workername.startswith(config.workers_prev_releases[branchname]):
+                    if w.worker.workername.startswith(config.worker_filters[branchname]):
                         possible_workers.append(w)
                 log.msg("nextWorker: Limiting %s to workers %s for %s" % (str(bldr), str(possible_workers), branchname))
                 break
diff --git a/config.py b/config.py
index 559ca99..ae8e4af 100644
--- a/config.py
+++ b/config.py
@@ -2,6 +2,8 @@ 
 # SPDX-License-Identifier: GPL-2.0-only
 #
 
+import re
+
 # ## Build configuration, tied to config.json in yocto-autobuilder-helpers
 # Repositories used by each builder
 buildertorepos = {
@@ -197,8 +199,22 @@  workers_toaster = ["ubuntu2204-vk-1", "ubuntu2204-vk-2", "ubuntu2204-vk-3", "ubu
 
 all_workers = workers + workers_bringup + workers_buildperf + workers_arm
 
-# Worker filtering for older releases
-workers_prev_releases = {
+_remove_vk_re = re.compile(r"^(.+)-vk(-.+)?$")
+def mangle_worker(w: str):
+    m = re.match(_remove_vk_re, w)
+    if m:
+        return m.group(1)
+
+    raise Exception(f"Not able to mangle the following worker: {w}")
+
+# Workers we want to exclude for testing on master* branches
+master_exclude_list = ("debian11",)
+
+master_workers = list({mangle_worker(w) for w in all_workers if mangle_worker(w) not in master_exclude_list})
+
+# Worker filtering for branches
+worker_filters = {
+    "master" : master_workers,
     "walnascar" : ("alma8", "alma9", "debian11", "debian12", "fedora39", "fedora40", "fedora41", "opensuse155", "opensuse156", "rocky8", "rocky9", "stream9", "ubuntu2004","ubuntu2204", "ubuntu2304", "ubuntu2404", "ubuntu2410", "perf-"),
     "styhead" : ("alma8", "alma9", "debian11", "debian12", "fedora38", "fedora39", "fedora40", "opensuse154", "opensuse155", "opensuse156", "rocky8", "rocky9", "stream8", "ubuntu1804", "ubuntu2004","ubuntu2204", "ubuntu2304", "ubuntu2404", "perf-"),
     "scarthgap" : ("alma8", "alma9", "debian11", "debian12", "fedora38", "fedora39", "fedora40", "opensuse154", "rocky9", "stream8", "ubuntu1804", "ubuntu2004","ubuntu2204", "ubuntu2304", "ubuntu2404", "perf-"),
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 6948a11..5d8997f 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -110,7 +110,7 @@  RUN sed -i \
         -e "s@^\(sharedrepodir *= *\).*@\1\"/sharedrepo\"@" \
         -e "s@^\(publish_dest *= *\).*@\1\"/publish\"@" \
         # Use any worker for any release \
-        -e '$ a workers_prev_releases = {}' \
+        -e '$ a worker_filters = {}' \
         /home/pokybuild/yocto-controller/yoctoabb/config.py && \
     sed -i \
         # Change location of sharedrepodir and publish_dest directories \