phase1,phase2: shuffle order of builds
authorPetr Štetiar <ynezz@true.cz>
Mon, 15 Mar 2021 21:46:09 +0000 (22:46 +0100)
committerPetr Štetiar <ynezz@true.cz>
Mon, 15 Mar 2021 21:47:41 +0000 (22:47 +0100)
It seems that once there are new commits, buildbot restarts building all
targets in alphabetical order. The current logic pretty much disables
the building of the alphabetically last targets, so until there is
proper solution just workaround it by randomly shuffling the builders
list.

References: https://github.com/buildbot/buildbot/issues/5193
Signed-off-by: Petr Štetiar <ynezz@true.cz>
phase1/master.cfg
phase2/master.cfg

index e57b666bb449370f68782c6308df5d096b72a182..2ccac8e9705972592b345865a7fa3e99545c1ade 100644 (file)
@@ -4,6 +4,7 @@
 import os
 import re
 import base64
+import random
 import subprocess
 import configparser
 
@@ -457,6 +458,12 @@ def GetNextBuild(builder, requests):
                        return r
        return requests[0]
 
+def prioritizeBuilders(buildmaster, builders):
+       random.shuffle(builders)
+       return builders
+
+c['prioritizeBuilders'] = prioritizeBuilders
+
 def MakeEnv(overrides=None, tryccache=False):
        env = {
                'CCC': Interpolate("%(kw:cc)s", cc=GetCC),
index 1e1bafa2635449efceb77a23624a5d5219d707ab..ac44fcd6b929244ba043d5677ab5639a2525fe49 100644 (file)
@@ -4,6 +4,7 @@
 import os
 import re
 import base64
+import random
 import subprocess
 import configparser
 
@@ -318,7 +319,11 @@ def UsignSec2Pub(seckey, comment="untrusted comment: secret key"):
 def IsSharedWorkdir(step):
        return bool(step.getProperty("shared_wd"))
 
+def prioritizeBuilders(buildmaster, builders):
+       random.shuffle(builders)
+       return builders
 
+c['prioritizeBuilders'] = prioritizeBuilders
 c['builders'] = []
 
 dlLock = locks.WorkerLock("worker_dl")