From ac0d8154fb86a5a519c50a6d15dd259d5fee2ef7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thibaut=20VAR=C3=88NE?= Date: Thu, 20 Oct 2022 15:43:15 +0200 Subject: [PATCH] phase1: max_builds and shared_wd are always set to 1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibaut VARÈNE --- 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 "" -@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( -- 2.30.2