From: Thibaut VARÈNE Date: Thu, 20 Oct 2022 13:43:15 +0000 (+0200) Subject: phase1: max_builds and shared_wd are always set to 1 X-Git-Tag: v2~51 X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;ds=sidebyside;h=ac0d815;hp=4402510d845ccf2018bf58a7fe1c8315fef9439c;p=buildbot.git phase1: max_builds and shared_wd are always set to 1 Signed-off-by: Thibaut VARÈNE --- 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(