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"):
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
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"):
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(