steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Lint with ruff
run: ruff phase*/master.cfg
+ - name: Lint with flake8
+ run: flake8 phase*/master.cfg
+
- name: Stylecheck with black
run: black phase1/master.cfg
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Environment variables
run: |
echo "GIT_SHA_SHORT=${GITHUB_SHA::${{ env.GITHUB_SHA_LEN }}}" >> $GITHUB_ENV
- name: Build container and export it to local Docker
- uses: docker/build-push-action@v4
+ uses: docker/build-push-action@v5
with:
load: true
tags: local/${{ matrix.container_flavor }}
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Environment variables
run: |
- name: Docker meta
id: meta
- uses: docker/metadata-action@v4
+ uses: docker/metadata-action@v5
with:
images: name=ghcr.io/${{ github.repository }}/build${{ matrix.container_flavor }}-v${{ env.BUILDBOT_VERSION }}
- name: Login to GitHub Container Registry
- uses: docker/login-action@v2
+ uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container again and push it
- uses: docker/build-push-action@v4
+ uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
# a shorter alias to save typing.
c = BuildmasterConfig = {}
-####### PROJECT IDENTITY
+# PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot
# installation's html.WebStatus home page (linked to the
c["buildbotURL"] = inip1.get("buildbot_url")
-####### BUILDWORKERS
+# BUILDWORKERS
# The 'workers' list defines the set of recognized buildworkers. Each element is
# a Worker object, specifying a unique worker name and password. The same
pos = 99
for name, prio in bldrNamePrio.items():
if bldr.name.startswith(name):
- pos = prio + 50 - min(hiprio, 50) # higher priority (larger positive number) raises position
+ # higher priority (larger positive number) raises position
+ pos = prio + 50 - min(hiprio, 50)
break
# pos order: janitor/local (0), tag builds if any [1..50], !tag builds [51...]
c["prioritizeBuilders"] = prioritizeBuilders
-####### CHANGESOURCES
+# CHANGESOURCES
# find targets
targets = dict()
)
)
-####### SCHEDULERS
+# SCHEDULERS
# Configure the Schedulers, which decide how to react to incoming changes.
schedulers.Triggerable(name="trigger", builderNames=builderNames, priority=20)
)
-####### BUILDERS
+# BUILDERS
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# what steps, and which workers can execute them. Note that any particular build will
def IsNoMasterBuild(step):
- return step.getProperty("branch") != "master"
+ return step.getProperty("branch") != "main"
def IsUsignEnabled(step):
if re.match(r"^[^-]+-[0-9]+\.[0-9]+$", branch):
return branch.split("-")[1]
else:
- return "master"
+ return "main"
@properties.renderer
r"^v[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$", props["tag"]
):
return "%s/" % props["tag"][1:]
- elif basever != "master":
+ elif basever != "main":
return "%s-SNAPSHOT/" % basever
else:
return ""
name="gitverify",
description="Ensuring that Git HEAD is pointing to a branch or tag",
descriptionDone="Git HEAD is sane",
- command='git rev-parse --abbrev-ref HEAD | grep -vxqF HEAD || git show-ref --tags --dereference 2>/dev/null | sed -ne "/^$(git rev-parse HEAD) / { s|^.*/||; s|\\^.*||; p }" | grep -qE "^v[0-9][0-9]\\."',
+ command=(
+ "git rev-parse --abbrev-ref HEAD | grep -vxqF HEAD || "
+ "git show-ref --tags --dereference 2>/dev/null | sed -ne "
+ '"/^$(git rev-parse HEAD) / { s|^.*/||; s|\\^.*||; p }" | grep -qE "^v[0-9][0-9]\\."'
+ ),
haltOnFailure=True,
)
)
name="newconfig",
descriptionDone=".config seeded",
command=Interpolate(
- "printf 'CONFIG_TARGET_%(kw:target)s=y\\nCONFIG_TARGET_%(kw:target)s_%(kw:subtarget)s=y\\nCONFIG_SIGNED_PACKAGES=%(kw:usign:#?|y|n)s\\n' >> .config",
+ "printf 'CONFIG_TARGET_%(kw:target)s=y\\n"
+ "CONFIG_TARGET_%(kw:target)s_%(kw:subtarget)s=y\\n"
+ "CONFIG_SIGNED_PACKAGES=%(kw:usign:#?|y|n)s\\n' >> .config",
target=target,
subtarget=subtarget,
usign=GetUsignKey,
name="kernelversion",
property="kernelversion",
description="Finding the effective Kernel version",
- command="make --no-print-directory -C target/linux/ val.LINUX_VERSION val.LINUX_RELEASE val.LINUX_VERMAGIC | xargs printf '%s-%s-%s\\n'",
+ command=(
+ "make --no-print-directory -C target/linux/ "
+ "val.LINUX_VERSION val.LINUX_RELEASE val.LINUX_VERMAGIC | "
+ "xargs printf '%s-%s-%s\\n'"
+ ),
env={"TOPDIR": Interpolate("%(prop:builddir)s/build")},
)
)
description="Packing files to sign",
descriptionDone="Files to sign packed",
command=Interpolate(
- "find bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/ bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/kmods/ -mindepth 1 -maxdepth 2 -type f -name sha256sums -print0 -or -name Packages -print0 | xargs -0 tar -czf sign.tar.gz",
+ "find bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/ "
+ "bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/kmods/ "
+ "-mindepth 1 -maxdepth 2 -type f -name sha256sums -print0 -or "
+ "-name Packages -print0 | xargs -0 tar -czf sign.tar.gz",
target=target,
subtarget=subtarget,
),
name="sourcelist",
description="Finding source archives to upload",
descriptionDone="Source archives to upload found",
- command="find dl/ -maxdepth 1 -type f -not -size 0 -not -name '.*' -not -name '*.hash' -not -name '*.dl' -newer .config -printf '%f\\n' > sourcelist",
+ command=(
+ "find dl/ -maxdepth 1 -type f -not -size 0 "
+ "-not -name '.*' -not -name '*.hash' -not -name "
+ "'*.dl' -newer .config -printf '%f\\n' > sourcelist"
+ ),
haltOnFailure=True,
)
)
)
-####### STATUS TARGETS
+# STATUS TARGETS
# 'status' is a list of Status Targets. The results of each build will be
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
r"https://git.openwrt.org/?p=openwrt/\1.git;a=commit;h=%s",
)
-####### DB URL
+# DB URL
c["db"] = {
# This specifies what database buildbot uses to store its state. You can leave
persistent = ini.getboolean("phase2", "persistent")
c['workers'] = []
-max_builds = dict()
for section in ini.sections():
if section.startswith("worker "):
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
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")
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")
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))
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"):
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
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))
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
))
factory.addStep(FileDownload(
name = "dlsha2rsyncpl",
- mastersrc = "sha2rsync.pl",
+ mastersrc = scripts_dir + "/sha2rsync.pl",
workerdest = "../sha2rsync.pl",
mode = 0o755,
))
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,
))
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
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
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,
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,