[buildbot] phase1: max_builds and shared_wd are always set to 1

LEDE Commits lede-commits at lists.infradead.org
Mon May 15 08:39:04 PDT 2023


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

commit ac0d8154fb86a5a519c50a6d15dd259d5fee2ef7
Author: Thibaut VARÈNE <hacks at slashdirt.org>
AuthorDate: Thu Oct 20 15:43:15 2022 +0200

    phase1: max_builds and shared_wd are always set to 1
    
    Signed-off-by: Thibaut VARÈNE <hacks at slashdirt.org>
---
 phase1/config.ini.example |  2 --
 phase1/master.cfg         | 20 +++-----------------
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/phase1/config.ini.example b/phase1/config.ini.example
index 1f500df..4cd05d9 100644
--- a/phase1/config.ini.example
+++ b/phase1/config.ini.example
@@ -53,11 +53,9 @@ comment = Unattended build signature
 phase = 1
 name = example-worker-1
 password = example
-builds = 3
 
 [worker 2]
 phase = 1
 name = example-worker-2
 password = example2
-builds = 1
 cleanup = 1
diff --git a/phase1/master.cfg b/phase1/master.cfg
index f60b778..8129d71 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -90,15 +90,9 @@ for section in ini.sections():
 	if section.startswith("worker "):
 		if ini.has_option(section, "name") and ini.has_option(section, "password") and \
 		   (not ini.has_option(section, "phase") or ini.getint(section, "phase") == 1):
-			sl_props = { 'dl_lock':None, 'ul_lock':None, 'do_cleanup':False, 'max_builds':1, 'shared_wd':False }
+			sl_props = { 'dl_lock':None, 'ul_lock':None, 'do_cleanup':False, 'shared_wd':True }
 			name = ini.get(section, "name")
 			password = ini.get(section, "password")
-			max_builds = 1
-			if ini.has_option(section, "builds"):
-				max_builds = ini.getint(section, "builds")
-				sl_props['max_builds'] = max_builds
-				if max_builds == 1:
-					sl_props['shared_wd'] = True
 			if ini.has_option(section, "cleanup"):
 				sl_props['do_cleanup'] = ini.getboolean(section, "cleanup")
 			if ini.has_option(section, "dl_lock"):
@@ -114,9 +108,7 @@ for section in ini.sections():
 			if ini.has_option(section, "shared_wd"):
 				shared_wd = ini.getboolean(section, "shared_wd")
 				sl_props['shared_wd'] = shared_wd
-				if shared_wd and (max_builds != 1):
-					raise ValueError('max_builds must be 1 with shared workdir!')
-			c['workers'].append(Worker(name, password, max_builds = max_builds, properties = sl_props))
+			c['workers'].append(Worker(name, password, max_builds = 1, properties = sl_props))
 
 # PB port can be either a numeric port or a connection string
 pb_port = inip1.get("port") or 9989
@@ -423,12 +415,6 @@ def GetVersionPrefix(props):
 	else:
 		return ""
 
- at properties.renderer
-def GetNumJobs(props):
-	nproc = int(props.getProperty("nproc", "1"))
-	njobs = int(nproc / props.getProperty("max_builds", 1)) or 1
-	return str(njobs)
-
 def GetNextBuild(builder, requests):
 	for r in requests:
 		if r.properties and r.properties.hasProperty("tag"):
@@ -550,7 +536,7 @@ for target in targets:
 		name = "njobs",
 		property = "njobs",
 		description = "Set max concurrency",
-		value = Interpolate("%(kw:jobs)s", jobs=GetNumJobs)))
+		value = Interpolate("%(prop:nproc:-1)s")))
 
 	# find gcc and g++ compilers
 	factory.addStep(FileDownload(




More information about the lede-commits mailing list