diff mbox series

Add multi-slave builders

Message ID 20180510043446.10811-1-igormtorrente@gmail.com
State New
Headers show
Series Add multi-slave builders | expand

Commit Message

Igor Torrente May 10, 2018, 4:34 a.m. UTC
From: Igor Torrente <igortorrente@outlook.com>

Implementation of muiti-slave builders.
This patch will make easy creation of multi-slave builders for buildbot.

---
 master.cfg | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/master.cfg b/master.cfg
index 9ecb3f4..164d309 100644
--- a/master.cfg
+++ b/master.cfg
@@ -18,18 +18,21 @@  import slavepasswd
 # a shorter alias to save typing.
 c = BuildmasterConfig = {}
 
+# Map builders to a set of slaves(workers).
 builder_map = {
-  'glibc-x86_64-linux': 'glibc-ubuntu-trusty-slave2',
-  'glibc-i686-linux': 'glibc-ubuntu-trusty-slave2',
-  'glibc-power8-linux': 'fedora25-ppc64-power8-1',
-  'glibc-ppc-linux': 'debian8-ppc-power8-1',
-  'glibc-ppc64le-linux': 'fedora25-ppc64le-power8-1',
-  'glibc-s390x-linux': 'marist-fedora-s390x',
-  'glibc-aarch64-linux': 'reservedbit-xgene-ubuntu-aarch64',
+  'glibc-x86_64-linux':['glibc-ubuntu-trusty-slave2'],
+  'glibc-i686-linux': ['glibc-ubuntu-trusty-slave2'],
+  'glibc-power8-linux': ['fedora25-ppc64-power8-1'],
+  'glibc-ppc-linux': ['debian8-ppc-power8-1'],
+  'glibc-ppc64le-linux': ['fedora25-ppc64le-power8-1'],
+  'glibc-s390x-linux': ['marist-fedora-s390x'],
+  'glibc-aarch64-linux': ['reservedbit-xgene-ubuntu-aarch64'],
 }
 
+# Sets with all builders and all slaves.
 builders = sorted(set(builder_map.iterkeys()))
-slaves = sorted(set(builder_map.itervalues()))
+slaves = sorted(set(slave for slave_list in (builder_map.itervalues())
+                              for slave in slave_list))
 
 
 ####### BUILDSLAVES
@@ -68,10 +71,13 @@  c['schedulers'].append(ForceScheduler(
 from AnnotatedFactory import getGlibcAnnotatedFactory
 from buildbot.config import BuilderConfig
 
-c['builders'] = [BuilderConfig(name = builder,
-                               slavename = slave,
-                               factory = getGlibcAnnotatedFactory())
-                 for builder, slave in builder_map.iteritems()]
+# Creation of all builders.
+c['builders'] = []
+for builder in builder_map:
+    c['builders'].append(BuilderConfig(
+                                name = builder,
+                                slavenames= builder_map[builder],
+                                factory = getGlibcAnnotatedFactory()))
 
 ####### STATUS TARGETS