phase1: max_builds and shared_wd are always set to 1
authorThibaut VARÈNE <hacks@slashdirt.org>
Thu, 20 Oct 2022 13:43:15 +0000 (15:43 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 15 May 2023 15:36:01 +0000 (17:36 +0200)
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
phase1/config.ini.example
phase1/master.cfg

index 1f500df1d31d1ee522360a211f77d619b4415dab..4cd05d9c0471f2445a1ddb0843d5494e445f2287 100644 (file)
@@ -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
index f60b7788d5064d78d77c31219a690e7c6f48a66c..8129d717f0316311764420c4a6d42ac2494ec658 100644 (file)
@@ -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(