[buildbot] phase1,phase2: shuffle order of builds

LEDE Commits lede-commits at lists.infradead.org
Mon Mar 15 21:55:57 GMT 2021


ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/43086da8105097409b8bd42ea9e6c7107755c7a8

commit 43086da8105097409b8bd42ea9e6c7107755c7a8
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Mon Mar 15 22:46:09 2021 +0100

    phase1,phase2: shuffle order of builds
    
    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 at true.cz>
---
 phase1/master.cfg | 7 +++++++
 phase2/master.cfg | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/phase1/master.cfg b/phase1/master.cfg
index e57b666..2ccac8e 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -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),
diff --git a/phase2/master.cfg b/phase2/master.cfg
index 1e1bafa..ac44fcd 100644
--- a/phase2/master.cfg
+++ b/phase2/master.cfg
@@ -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")



More information about the lede-commits mailing list