X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=phase2%2Fmaster.cfg;h=c399c66eb0fc9467e250e85d6b2652d99388abab;hb=HEAD;hp=a499f72379c89ec6c3bc51da3849f8cbc8b48365;hpb=5c994fce26062710099704ee5c8cd3fe69da261e;p=buildbot.git diff --git a/phase2/master.cfg b/phase2/master.cfg index a499f72..c399c66 100644 --- a/phase2/master.cfg +++ b/phase2/master.cfg @@ -62,8 +62,6 @@ c = BuildmasterConfig = {} worker_port = 9990 persistent = False -git_ssh = False -git_ssh_key = None if ini.has_option("phase2", "port"): worker_port = ini.get("phase2", "port") @@ -71,16 +69,7 @@ if ini.has_option("phase2", "port"): if ini.has_option("phase2", "persistent"): persistent = ini.getboolean("phase2", "persistent") -if ini.has_option("general", "git_ssh"): - git_ssh = ini.getboolean("general", "git_ssh") - -if ini.has_option("general", "git_ssh_key"): - git_ssh_key = ini.get("general", "git_ssh_key") -else: - git_ssh = False - c['workers'] = [] -max_builds = dict() for section in ini.sections(): if section.startswith("worker "): @@ -88,21 +77,12 @@ for section in ini.sections(): ini.has_option(section, "phase") and ini.getint(section, "phase") == 2: name = ini.get(section, "name") password = ini.get(section, "password") - sl_props = { 'shared_wd': False } - max_builds[name] = 1 - - if ini.has_option(section, "builds"): - max_builds[name] = ini.getint(section, "builds") - - if max_builds[name] == 1: - sl_props['shared_wd'] = True + sl_props = { 'shared_wd': True } if ini.has_option(section, "shared_wd"): sl_props['shared_wd'] = ini.getboolean(section, "shared_wd") - if sl_props['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[name], properties = sl_props)) + c['workers'].append(Worker(name, password, max_builds = 1, properties = sl_props)) # 'workerPortnum' defines the TCP port to listen on for connections from workers. # This must match the value configured into the buildworkers (with their @@ -135,7 +115,7 @@ if ini.has_option("rsync", "source_url"): rsync_sdk_url = None rsync_sdk_key = None -rsync_sdk_pat = "openwrt-sdk-*.tar.xz" +rsync_sdk_pat = "openwrt-sdk-*.tar.*" if ini.has_option("rsync", "sdk_url"): rsync_sdk_url = ini.get("rsync", "sdk_url") @@ -149,7 +129,7 @@ if ini.has_option("rsync", "sdk_pattern"): rsync_defopts = ["-4", "-v", "--timeout=120"] repo_url = ini.get("repo", "url") -repo_branch = "master" +repo_branch = "main" if ini.has_option("repo", "branch"): repo_branch = ini.get("repo", "branch") @@ -197,7 +177,7 @@ def parse_feed_entry(line): if parts[0].startswith("src-git"): feeds.append(parts) url = parts[2].strip().split(';') - branch = url[1] if len(url) > 1 else 'master' + branch = url[1] if len(url) > 1 else 'main' feedbranches[url[0]] = branch c['change_source'].append(GitPoller(url[0], branch=branch, workdir='%s/%s.git' %(os.getcwd(), parts[1]), pollinterval=300)) @@ -287,13 +267,6 @@ def GetDirectorySuffix(props): return "-%02d.%02d" %(int(m.group(1)), int(m.group(2))) return "" -@properties.renderer -def GetNumJobs(props): - if props.hasProperty("workername") and props.hasProperty("nproc"): - return str(int(props["nproc"]) / max_builds[props["workername"]]) - else: - return "1" - @properties.renderer def GetCwd(props): if props.hasProperty("builddir"): @@ -307,7 +280,7 @@ def IsArchitectureSelected(target): def CheckArchitectureProperty(step): try: options = step.getProperty("options") - if type(options) is dict: + if isinstance(options, dict): selected_arch = options.get("architecture", "all") if selected_arch != "all" and selected_arch != target: return False @@ -555,36 +528,13 @@ for arch in arches: command = ["./ccache.sh"], haltOnFailure = True)) - if git_ssh: - factory.addStep(StringDownload( - name = "dlgitclonekey", - s = git_ssh_key, - workerdest = "../git-clone.key", - mode = 0o600)) - - factory.addStep(ShellCommand( - name = "patchfeedsconf", - description = "Patching feeds.conf", - workdir = "build/sdk", - command = "sed -e 's#https://#ssh://git@#g' feeds.conf.default > feeds.conf", - haltOnFailure = True)) - factory.addStep(ShellCommand( name = "updatefeeds", description = "Updating feeds", workdir = "build/sdk", command = ["./scripts/feeds", "update", "-f"], - env = {'GIT_SSH_COMMAND': Interpolate("ssh -o IdentitiesOnly=yes -o IdentityFile=%(kw:cwd)s/git-clone.key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no", cwd=GetCwd)} if git_ssh else {}, haltOnFailure = True)) - if git_ssh: - factory.addStep(ShellCommand( - name = "rmfeedsconf", - description = "Removing feeds.conf", - workdir = "build/sdk", - command=["rm", "feeds.conf"], - haltOnFailure = True)) - factory.addStep(ShellCommand( name = "installfeeds", description = "Installing feeds", @@ -607,7 +557,7 @@ for arch in arches: description = "Building packages", workdir = "build/sdk", timeout = 3600, - command = ["make", Interpolate("-j%(kw:jobs)s", jobs=GetNumJobs), "IGNORE_ERRORS=n m y", "BUILD_LOG=1", "CONFIG_AUTOREMOVE=y", "CONFIG_SIGNED_PACKAGES="], + command = ["make", Interpolate("-j%(prop:nproc:-1)s"), "IGNORE_ERRORS=n m y", "BUILD_LOG=1", "CONFIG_AUTOREMOVE=y", "CONFIG_SIGNED_PACKAGES="], env = {'CCACHE_BASEDIR': Interpolate("%(kw:cwd)s", cwd=GetCwd)}, haltOnFailure = True)) @@ -622,7 +572,10 @@ for arch in arches: description = "Calculating checksums", descriptionDone="Checksums calculated", workdir = "build/sdk", - command = "cd bin/packages/%s; " %(arch[0]) + "find . -type f -not -name 'sha256sums' -printf \"%P\n\" | sort | xargs -r ../../../staging_dir/host/bin/mkhash -n sha256 | sed -ne 's!^\(.*\) \(.*\)$!\1 *\2!p' > sha256sums)", + command = "cd bin/packages/%s; " %(arch[0]) + + "find . -type f -not -name 'sha256sums' -printf \"%P\n\" | " + + "sort | xargs -r ../../../staging_dir/host/bin/mkhash -n sha256 | " + + r"sed -ne 's!^\(.*\) \(.*\)$!\1 *\2!p' > sha256sums", haltOnFailure = True )) @@ -691,7 +644,7 @@ for arch in arches: factory.addStep(FileDownload( name = "dlsha2rsyncpl", - mastersrc = "sha2rsync.pl", + mastersrc = scripts_dir + "/sha2rsync.pl", workerdest = "../sha2rsync.pl", mode = 0o755, )) @@ -700,7 +653,7 @@ for arch in arches: name = "buildlist", description = "Building list of files to upload", workdir = "build/sdk", - command = ["../../../sha2rsync.pl", "../../arch-sha256sums", "bin/packages/%s/sha256sums" %(arch[0]), "rsynclist"], + command = ["../../sha2rsync.pl", "../arch-sha256sums", "bin/packages/%s/sha256sums" %(arch[0]), "rsynclist"], haltOnFailure = True, )) @@ -718,7 +671,7 @@ for arch in arches: name = "packageupload", description = "Uploading package files", workdir = "build/sdk", - command = ["../../../rsync.sh"] + rsync_defopts + ["--files-from=rsynclist", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-a", "bin/packages/%s/" %(arch[0]), Interpolate("%(kw:rsyncbinurl)s/packages%(kw:suffix)s/%(kw:archname)s/", rsyncbinurl=rsync_bin_url, suffix=GetDirectorySuffix, archname=arch[0])], + command = ["../../rsync.sh"] + rsync_defopts + ["--files-from=rsynclist", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-a", "bin/packages/%s/" %(arch[0]), Interpolate("%(kw:rsyncbinurl)s/packages%(kw:suffix)s/%(kw:archname)s/", rsyncbinurl=rsync_bin_url, suffix=GetDirectorySuffix, archname=arch[0])], env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False @@ -728,7 +681,7 @@ for arch in arches: name = "packageprune", description = "Pruning package files", workdir = "build/sdk", - command = ["../../../rsync.sh"] + rsync_defopts + ["--delete", "--existing", "--ignore-existing", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-a", "bin/packages/%s/" %(arch[0]), Interpolate("%(kw:rsyncbinurl)s/packages%(kw:suffix)s/%(kw:archname)s/", rsyncbinurl=rsync_bin_url, suffix=GetDirectorySuffix, archname=arch[0])], + command = ["../../rsync.sh"] + rsync_defopts + ["--delete", "--existing", "--ignore-existing", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-a", "bin/packages/%s/" %(arch[0]), Interpolate("%(kw:rsyncbinurl)s/packages%(kw:suffix)s/%(kw:archname)s/", rsyncbinurl=rsync_bin_url, suffix=GetDirectorySuffix, archname=arch[0])], env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False @@ -768,7 +721,7 @@ for arch in arches: name = "logupload", description = "Uploading failure logs", workdir = "build/sdk", - command = ["../../../rsync.sh"] + rsync_defopts + ["--delete", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-az", "faillogs/", Interpolate("%(kw:rsyncbinurl)s/faillogs%(kw:suffix)s/%(kw:archname)s/", rsyncbinurl=rsync_bin_url, suffix=GetDirectorySuffix, archname=arch[0])], + command = ["../../rsync.sh"] + rsync_defopts + ["--delete", "--delay-updates", "--partial-dir=.~tmp~%s" %(arch[0]), "-az", "faillogs/", Interpolate("%(kw:rsyncbinurl)s/faillogs%(kw:suffix)s/%(kw:archname)s/", rsyncbinurl=rsync_bin_url, suffix=GetDirectorySuffix, archname=arch[0])], env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = False, flunkOnFailure = False, @@ -789,7 +742,7 @@ for arch in arches: name = "sourceupload", description = "Uploading source archives", workdir = "build/sdk", - command = ["../../../rsync.sh"] + rsync_defopts + ["--files-from=sourcelist", "--size-only", "--delay-updates", + command = ["../../rsync.sh"] + rsync_defopts + ["--files-from=sourcelist", "--size-only", "--delay-updates", Interpolate("--partial-dir=.~tmp~%(kw:archname)s~%(prop:workername)s", archname=arch[0]), "-a", "dl/", "%s/" %(rsync_src_url)], env={'RSYNC_PASSWORD': rsync_src_key}, haltOnFailure = False,