buildbot.git
24 hours agodocker,worker: install pyelftools master
Paul Spooren [Fri, 25 Oct 2024 09:11:48 +0000 (11:11 +0200)]
docker,worker: install pyelftools

Without it, errors may appear:

WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a dependency on 'libpcre', which does not exist
make[2]: Entering directory '/builder/shared-workdir/build/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/builder/shared-workdir/build/scripts/config'
Checking 'python3-pyelftools'... failed.
Checking 'python3-dev'... ok.
Checking 'python3-setuptools'... ok.
Checking 'swig'... ok.
u-boot: Please install the Python3 elftools module

Fixes: 3ac7d39bd4c3 ("buildworker,buildmaster: bump Debian to version 12")
Signed-off-by: Paul Spooren <mail@aparcar.org>
24 hours agoRevert "buildworker,buildmaster: bump Debian to version 12"
Petr Štetiar [Mon, 4 Nov 2024 06:08:14 +0000 (06:08 +0000)]
Revert "buildworker,buildmaster: bump Debian to version 12"

This reverts commit 3ac7d39bd4c364d76e78b3ba50c23a68e0b05c0f as it was
decided to stay on Debian 11 for 24.10 release as well.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
24 hours agobuildworker: start: fix broken non TLS setups
Petr Štetiar [Thu, 24 Oct 2024 19:55:04 +0000 (19:55 +0000)]
buildworker: start: fix broken non TLS setups

Changes in commit 3812ff7bb296 ("buildworker: start: fix worker startup
failure after update") broke non TLS setups. So lets fix it by setting
SSL: only if BUILDWORKER_TLS is set.

Fixes: 3812ff7bb296 ("buildworker: start: fix worker startup failure after update")
Reported-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 weeks agophase1,phase2: GitPoller: fix deprecated API warning for pollinterval v20
Petr Štetiar [Sat, 12 Oct 2024 08:03:30 +0000 (08:03 +0000)]
phase1,phase2: GitPoller: fix deprecated API warning for pollinterval

Fixes following warning:

 gitpoller.py:103: buildbot.warnings.DeprecatedApiWarning: [3.11.3 and later] pollinterval has been deprecated: please use pollInterval

Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 weeks agophase2: signpack: fix sha256sums signatures of apk packages.adb index
Petr Štetiar [Sat, 12 Oct 2024 07:46:46 +0000 (07:46 +0000)]
phase2: signpack: fix sha256sums signatures of apk packages.adb index

Currently the sha256sum verification of apk's packages.adb index
fails as the file is modified with `apk adbsign`, but we currently don't
send the sha256sums file to the master, thus it can't be fixed during
signing.

So lets pack sha256sums files and ship them to master for proper
signing.

Fixes: a94d4e15fdc1 ("add APK signing logic")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 weeks agophase2: signpack: code format
Petr Štetiar [Sat, 12 Oct 2024 07:43:04 +0000 (07:43 +0000)]
phase2: signpack: code format

So its more readable and diffs of changes are more clear, thus easier to
review.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoscripts: signall: fix finish function not called when apk adbsign failed v19
Petr Štetiar [Sun, 29 Sep 2024 18:21:02 +0000 (18:21 +0000)]
scripts: signall: fix finish function not called when apk adbsign failed

The `finish 3` was not being called when the `apk adbsign` command
failed within the `find` command using `-exec`. This happened because
`find` does not exit with a non-zero status when the command executed by
`-exec` fails, so the `|| finish 3` condition was not triggered.

So lets replace the `find ... -exec ...` construct with a loop and call
`finish 3` immediately if it fails.

Fixes: a94d4e15fdc1 ("add APK signing logic")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoscripts: signall: fix wrong sha256sum on apk packages.adb index
Petr Štetiar [Sat, 28 Sep 2024 12:22:35 +0000 (12:22 +0000)]
scripts: signall: fix wrong sha256sum on apk packages.adb index

Currently the sha256sum verification of apk's packages.adb index
fails as the file is modified with `apk adbsign`.

So lets update sha256sum of all packages.adb indexes after they were
signed with `apk adbsign`.

While at it fix formatting.

Fixes: a94d4e15fdc1 ("add APK signing logic")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoscripts: sha2rsync: add apk package index signature files
Petr Štetiar [Sun, 29 Sep 2024 06:15:39 +0000 (06:15 +0000)]
scripts: sha2rsync: add apk package index signature files

Currently additional_files list is missing signature files for apk's
package index, so lets add those to get them rsync-ed as well.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoscripts: sha2rsync: fix missing feeds in additional_files list
Petr Štetiar [Sun, 29 Sep 2024 06:13:23 +0000 (06:13 +0000)]
scripts: sha2rsync: fix missing feeds in additional_files list

Currently only packages feeds are being handled in phase2, so lets add the
other missing feeds.

Fixes: c3ddb0db167d ("phase2: use sha2rsync.pl for 'targetupload'")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agobuildworker: start: fix leaking BUILDWORKER_TLS env variable
Petr Štetiar [Sat, 28 Sep 2024 17:12:55 +0000 (17:12 +0000)]
buildworker: start: fix leaking BUILDWORKER_TLS env variable

I've noticed leakage of BUILDWORKER_TLS environment variable in build
logs, so lets fix it in a generic way via new
`cleanup_buildworker_env_variables()` by using Bash's parameter
expansion and unset all environment variables starting with BUILDWORKER_
prefix.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoscripts: signall: fix wrong GPG signature on apk packages.adb index
Petr Štetiar [Sat, 28 Sep 2024 12:22:35 +0000 (12:22 +0000)]
scripts: signall: fix wrong GPG signature on apk packages.adb index

Currently the GPG signature verification of apk's packages.adb index
fails as the file is modified with `apk adbsign` after its GPG signed.

So lets fix it by moving the `apk adbsign` before the GPG signing step.

Fixes: a94d4e15fdc1 ("add APK signing logic")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoci: use Python 3.11 from Debian 12 for testing
Petr Štetiar [Sat, 28 Sep 2024 07:14:12 +0000 (07:14 +0000)]
ci: use Python 3.11 from Debian 12 for testing

In commit 3ac7d39bd4c3 ("buildworker,buildmaster: bump Debian to version
12") we switched the base system to Debian 12 which uses Python 3.11.2,
thus lets test on CI with same version.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoBump buildbot to v3.11.8 release
Petr Štetiar [Sat, 28 Sep 2024 07:10:26 +0000 (07:10 +0000)]
Bump buildbot to v3.11.8 release

Bug fixes
---------

- Made Tags column in Builders page take less space when there are no tags.
- Fixed cropped change author avatar image in web UI.
- Correctly pluralize build count in build summaries in the web UI.
- The change details page no longer requires an additional mouse click to show the change details.
- Fixed showing misleading "Loading" spinner when a change has no builds.
- Fixed too small spacing in change header text in web UI.
- Fixed showing erroneous zero changes count in the web UI when loading changes.
- Cleaned up build and worker tabs in builders view in web UI.
- Improved visual separation between pending build count and build status in trigger build steps in web UI.

Changes
-------

- Buildbot has migrated to ``quay.io`` container registry for storing released container images.
  In order to migrate to the new registry container image name in ``FROM`` instruction in Dockerfiles
  needs to be adjusted to ``quay.io/buildbot/buildbot-master`` or ``quay.io/buildbot/buildbot-worker``.
- The list of supported browsers has been updated to Chrome >=80, Firefox >= 80, Edge >=80,
  Safari >= 14, Opera >=67.

Features
--------

- Add a "Workers" tab to the Builder view listing workers that are assigned to this builder (:issue:`7162`)
- The text displayed in build links is now configurable and can use any build property.
  It was showing build number or branch and build number before.
- Changes and builds tables in various places in the web UI now have a button to load more items.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoci: switch to main branch
Petr Štetiar [Sat, 28 Sep 2024 07:08:09 +0000 (07:08 +0000)]
ci: switch to main branch

References: https://openwrt.org/voting/2023-02-27
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agodocker: buildworker: add missing file package
Petr Štetiar [Fri, 27 Sep 2024 07:33:09 +0000 (07:33 +0000)]
docker: buildworker: add missing file package

In Debian 11 (Bullseye), the `file` package was installed indirectly
because the `man-db` package recommended it. The `man-db` package is
often installed as a dependency of other packages, such as
`build-essential` and tools like `gcc` and `make`.  By default,
`apt-get` installs recommended packages, so `file` was installed
automatically.

Starting from Debian 12 (Bookworm), the `man-db` package no longer
recommends the `file` package. This change was made to reduce the size
of minimal container images and installations where `file` is not
essential.

So lets install this package explicitly.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agobuildworker: start: fix worker startup failure after update v18
Petr Štetiar [Thu, 26 Sep 2024 21:04:00 +0000 (21:04 +0000)]
buildworker: start: fix worker startup failure after update

Workers are currently refusing to work:

 Unhandled Error
 Traceback (most recent call last):
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 673, in run
     runApp(config)
   File "/opt/venv/lib/python3.11/site-packages/twisted/scripts/twistd.py", line 29, in runApp
     runner.run()
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 370, in run
     self.application = self.createOrGetApplication()
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 437, in createOrGetApplication
     application = getApplication(self.config, passphrase)
 --- <exception caught here> ---
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 446, in getApplication
     application = service.loadApplication(filename, style, passphrase)
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/service.py", line 404, in loadApplication
     application = sob.loadValueFromFile(filename, "application")
   File "/opt/venv/lib/python3.11/site-packages/twisted/persisted/sob.py", line 174, in loadValueFromFile
     codeObj = compile(data, filename, "exec")
 builtins.SyntaxError: keyword argument repeated: connection_string (buildbot.tac, line 49)

as the buildbot.tac template changed in commit 4ba1dcb66155 ("worker:
Add option --connection-string for create-worker") and in version v3.10.0.

So lets use this new `--connection-string` feature and get rid of the
sed-fu.

Fixes: efbddc90d8e6 ("Bump buildbot to v3.11.1 release")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoci: fix worker startup issue by adding missing env vars and cleanup unused vars
Petr Štetiar [Thu, 26 Sep 2024 21:14:37 +0000 (21:14 +0000)]
ci: fix worker startup issue by adding missing env vars and cleanup unused vars

Workers are currently refusing to work:

  Unhandled Error
  Traceback (most recent call last):
    File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 673, in run
      runApp(config)
    File "/opt/venv/lib/python3.11/site-packages/twisted/scripts/twistd.py", line 29, in runApp
      runner.run()
    File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 370, in run
      self.application = self.createOrGetApplication()
    File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 437, in createOrGetApplication
      application = getApplication(self.config, passphrase)
  --- <exception caught here> ---
    File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 446, in getApplication
      application = service.loadApplication(filename, style, passphrase)
    File "/opt/venv/lib/python3.11/site-packages/twisted/application/service.py", line 404, in loadApplication
      application = sob.loadValueFromFile(filename, "application")
    File "/opt/venv/lib/python3.11/site-packages/twisted/persisted/sob.py", line 174, in loadValueFromFile
      codeObj = compile(data, filename, "exec")
  builtins.SyntaxError: keyword argument repeated: connection_string (buildbot.tac, line 49)

and we're not aware about it, so lets fix it by adding the same
environment variables we're actually using in production.

While at it, cleanup the unused container_verify_string variables.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agobuildworker: Drop installation of Python 2 v17
Paul Spooren [Thu, 26 Sep 2024 09:34:33 +0000 (11:34 +0200)]
buildworker: Drop installation of Python 2

Old releases of OpenWrt would require it but that's something of the
past - time is running.

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 weeks agobuildworker,buildmaster: Use venv for Pip
Paul Spooren [Thu, 26 Sep 2024 09:21:00 +0000 (11:21 +0200)]
buildworker,buildmaster: Use venv for Pip

Debian 12 complains if using Pip without a virtualenv since it could
break the system.

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 weeks agobuildworker,buildmaster: bump Debian to version 12
Petr Štetiar [Thu, 26 Sep 2024 07:55:30 +0000 (07:55 +0000)]
buildworker,buildmaster: bump Debian to version 12

Debian 11 LTS support ends in June 2026, so it's probably around the
time when support for the OpenWrt 24.10 release might end. Therefore,
let's switch to Debian 12, which should have LTS support until June 2028
and is the latest and greatest.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agoBump buildbot to v3.11.7 release
Petr Štetiar [Thu, 26 Sep 2024 06:50:35 +0000 (06:50 +0000)]
Bump buildbot to v3.11.7 release

Changes since current v3.11.1 release:

 ### Bug Fixes
 - Fixed `GitPoller` when `repourl` has the port specified (:issue:`7822`).
 - Fixed `ChoiceStringParameter` fields with `multiple` would not store the selected values.
 - Fixed unnecessary trimming of spaces in logs shown in the web UI (:issue:`7774`).
 - Fixed favicon colors on build views in the web UI.
 - Fixed the icon on the about page in the web UI.
 - Fixed a regression where builds in waterfall view were no longer linking to the build page.
 - Transfer build steps (:bb:step:`FileUpload`, :bb:step:`DirectoryUpload`, :bb:step:`MultipleFileUpload`, :bb:step:`FileDownload`, and :bb:step:`StringDownload`) now correctly remove the destination on failure, preventing partial content (:issue:`2860`).
 - Fixed ReactUI when Buildbot is hosted behind a reverse proxy not at the URL's root (:issue:`7260`, :issue:`7746`).
 - Fixed results color shown on the builder's header in the waterfall view.
 - Fixed cases where the waterfall view could be squashed to a pixel high.
 - Fixed several occasional data update glitches in the web frontend.
 - Fixed the display of newly added builds in the Workers view in the web frontend.
 - Fixed a regression where `GitPoller` would no longer register new changes (regression introduced in 3.11.3 in #7554).
 - Fixed a bug that caused `GitPoller` running with git configured with the `fetch.prune=true` parameter to fail.
 - Fixed a bug that caused `GitPoller` to miss changes when Buildbot is reconfigured.
 - Reduced the length of directory names produced by `GitPoller` internally to avoid potential breakage on filesystems with low path and name length limits.
 - Removed credentials from `repourl` used in the tracker branch name.
 - Fixed an error in `HgPoller` when repository initialization fails (:issue:`7488`).
 - Updated the `Makefile` to handle Windows paths and Python.
 - Fixed the steps raw log download button.
 - Fixed a regression in the React UI that prevented hosting Buildbot at a custom URL prefix, allowing support for multiple Buildbot instances on a single server.

 ### Changes
 - Buildbot will now raise an error when configured with multiple services of the same type and name (:issue:`6987`).
 - Improved the flexibility of the `scaling_waterfall` setting to support floating-point values for a more condensed view.
 - Added a web configuration setting to select whether build completion or start times are displayed.
 - Added a revision info column in the web frontend.

 ### Features
 - Added `MessageFormatterFunctionRaw`, allowing complete customization of emitted messages. This feature has been available since 3.11.0 but was only recently announced.

 ### Deprecations and Removals
 - The `pollinterval` argument of various change sources has been deprecated with a warning in favor of `pollInterval`.

 ### Improved Documentation
 - Documented that `ChangeSource` does not support secrets (or any other renderables) and provided best practices for handling secret values in changes. Up until Buildbot 3.7, `ChangeSource` accidentally supported renderable arguments, which was undocumented behavior.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 weeks agobuildmaster: add static apk utility ynezz/add-static-apk
Petr Štetiar [Tue, 24 Sep 2024 20:00:59 +0000 (20:00 +0000)]
buildmaster: add static apk utility

We need a relatively recent `apk` that can sign package indexes. You can
find more details in the referenced issue below. However, it has not
been released yet and is not available as a prebuilt download.
Therefore, until it becomes available, let's build a static version and
use that in the meantime.

Fixes: a94d4e15fdc1 ("add APK signing logic")
References: https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/11008
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agodocker: bump rsync Debian version v16
Paul Spooren [Wed, 7 Aug 2024 14:49:50 +0000 (16:49 +0200)]
docker: bump rsync Debian version

Signed-off-by: Paul Spooren <mail@aparcar.org>
2 months agoadd APK signing logic
Paul Spooren [Tue, 6 Aug 2024 16:03:21 +0000 (18:03 +0200)]
add APK signing logic

With this commit it's possible to sign APK package indexes
(packages.adb) via the `signall.sh` script, which is run on the
buildmaster. As a consequence `apk` must be available on the
buildmaster. This is the final step to replace OPKG with APK.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2 months agophase1: make IsNoMasterBuild function more flexible
Paul Spooren [Thu, 13 Jun 2024 07:56:38 +0000 (09:56 +0200)]
phase1: make IsNoMasterBuild function more flexible

Work with both master/main

Signed-off-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoCI(deps): Bump docker/build-push-action from 5 to 6
dependabot[bot] [Mon, 17 Jun 2024 19:41:44 +0000 (19:41 +0000)]
CI(deps): Bump docker/build-push-action from 5 to 6

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agophase1: kmodprepare: add apk compat
Petr Štetiar [Thu, 13 Jun 2024 13:52:17 +0000 (13:52 +0000)]
phase1: kmodprepare: add apk compat

Ansuel reported, that with `USE_APK=y` there are no kmods available in
the build artifacts, so lets fix it by extending the rsync's include
pattern with the `apk` suffix to make it future proof.

Reported-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agophase1: AnyBranchScheduler: make treeStableTimer configurable
Petr Štetiar [Wed, 12 Jun 2024 18:43:29 +0000 (18:43 +0000)]
phase1: AnyBranchScheduler: make treeStableTimer configurable

The AnyBranchScheduler will currently wait for 15 minutes before
starting a build.  If new changes are made on the same branch during
this interval, the timer will be restarted.

For staging repository we want faster feedback loop, so we're going to
use much lower value, thus lets make this configurable and handled via
Ansible.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 months agophase1: make list of builders configurable
Petr Štetiar [Sat, 1 Jun 2024 11:57:11 +0000 (11:57 +0000)]
phase1: make list of builders configurable

Currently we always populate builders (build targets) from the Git tree,
but for staging environment this is usually overkill as we might need
just a bunch of targets, so lets make this configurable.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 months agophase1: factor out populateTargetsForBranch
Petr Štetiar [Sat, 1 Jun 2024 11:21:23 +0000 (11:21 +0000)]
phase1: factor out populateTargetsForBranch

Going to make builders (build targets) configurable, so lets factor
current populateTargets into separate function populateTargetsForBranch
which takes a branch as argument. No functional changes.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 months agoRevert "Bump buildbot to v3.11.3 release" v15
Petr Štetiar [Sat, 1 Jun 2024 05:54:06 +0000 (05:54 +0000)]
Revert "Bump buildbot to v3.11.3 release"

This reverts commit 44ed9a39fddc4e79ec1276c3e5923766cbe19878 as it
breaks GitPoller.

References: https://github.com/buildbot/buildbot/issues/7663
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 months agoBump buildbot to v3.11.3 release v14
Petr Štetiar [Wed, 22 May 2024 10:05:50 +0000 (10:05 +0000)]
Bump buildbot to v3.11.3 release

https://github.com/buildbot/buildbot/releases/tag/v3.11.3

Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agoBump buildbot to v3.11.1 release v13
Petr Štetiar [Fri, 22 Dec 2023 10:06:54 +0000 (10:06 +0000)]
Bump buildbot to v3.11.1 release

https://github.com/buildbot/buildbot/releases/tag/v3.11.1

Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agoRevert "buildmaster: fix Twisted dependency hell by using twisted==22.10.0"
Petr Štetiar [Fri, 22 Dec 2023 11:02:49 +0000 (11:02 +0000)]
Revert "buildmaster: fix Twisted dependency hell by using twisted==22.10.0"

This reverts commit bc17dd9af0d3a56e3e9cd724c41deacc5ae0de14 as it
should be fine in buildbot v3.10.0 release.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agophase1,phase2: s/master/main for phase{1,2}
Paul Spooren [Tue, 23 May 2023 21:02:48 +0000 (23:02 +0200)]
phase1,phase2: s/master/main for phase{1,2}

More and more projects are switching their repositories to use the
'main' branch instead of the 'master' branch. This also includes many
Linux upstream trees as well. Some trees are even removing their
'master' branches already.

I think this is becoming more and more mainstream and expected of
projects, so we should do the same.

References: https://openwrt.org/voting/2023-02-27
Signed-off-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [commit facelift]
6 months agophase2: fix relative paths for scripts and files
Petr Štetiar [Sun, 24 Dec 2023 19:14:14 +0000 (19:14 +0000)]
phase2: fix relative paths for scripts and files

Currently `buildlist` step fails with following:

  ../../../sha2rsync.pl ../../arch-sha256sums bin/packages/aarch64_generic/sha256sums rsynclist
   in dir /builder/aarch64_generic/build/sdk (timeout 1200 secs)
   watching logfiles {}
   argv: [b'../../../sha2rsync.pl', b'../../arch-sha256sums', b'bin/packages/aarch64_generic/sha256sums', b'rsynclist']
   environment:
    ...
    PWD=/builder/aarch64_generic/build/sdk
    ...
  Upon execvpe b'../../../sha2rsync.pl' [b'../../../sha2rsync.pl', b'../../arch-sha256sums', b'bin/packages/aarch64_generic/sha256sums', b'rsynclist'] in environment id 139847367136832
  :Traceback (most recent call last):
  ...
  FileNotFoundError: [Errno 2] No such file or directory: b'../../../sha2rsync.pl'

due to relative paths being off by one:

 worker work dir = /builder/aarch64_cortex-a72/build
 workerdest = "../sha2rsync.pl"
   is absolute path /builder/aarch64_cortex-a72/sha2rsync.pl

thus relative path from:

  FileNotFoundError: [Errno 2] No such file or directory: b'../../../sha2rsync.pl'

in following context:

  PWD=/builder/aarch64_generic/build/sdk
  b'../../../sha2rsync.pl'

is wrong absolute path `/builder/sha2rsync.pl` by one directory level,
thus adjust all those paths accordingly.

Fixes: c3ddb0db167d ("phase2: use sha2rsync.pl for 'targetupload'")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agorequirements-dev: use black 23.12.1 and ruff 0.1.9
Petr Štetiar [Sat, 23 Dec 2023 06:43:02 +0000 (06:43 +0000)]
requirements-dev: use black 23.12.1 and ruff 0.1.9

Fix ruff's recommendation:

 phase2/master.cfg:328:16: E721 Do not compare types, use `isinstance()`

 "Unlike a direct type comparison, isinstance will also check if an
  object is an instance of a class or a subclass thereof."

Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agophase2: fix invalid escape sequence flake8 warning in checksums step
Petr Štetiar [Sat, 23 Dec 2023 07:33:21 +0000 (07:33 +0000)]
phase2: fix invalid escape sequence flake8 warning in checksums step

Resolved a flake8 linting warning related to an invalid escape sequence
in the ShellCommand for calculating checksums:

 phase2/master.cfg:739:28: W605 invalid escape sequence '\('
 phase2/master.cfg:739:32: W605 invalid escape sequence '\)'
 phase2/master.cfg:739:35: W605 invalid escape sequence '\('
 phase2/master.cfg:739:39: W605 invalid escape sequence '\)'

The warning was caused by the use of unescaped parentheses in a regular
expression within a sed command.

Use a raw string (with an 'r' prefix) to treat backslashes as literal
characters, ensuring that the regular expression is correctly
interpreted and flake8 does not raise a warning.

This fix ensures that the code adheres to Python's string handling best
practices and maintains the integrity of the regular expression
functionality.

Fixes: f0faed2970dd ("phase2: compute checksums")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agophase2: checksums: split long command line
Petr Štetiar [Sun, 24 Dec 2023 09:30:58 +0000 (09:30 +0000)]
phase2: checksums: split long command line

To make it more readable, diffs smaller, easier to review etc.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agoAdd linting with flake8 tool
Petr Štetiar [Sat, 23 Dec 2023 06:13:02 +0000 (06:13 +0000)]
Add linting with flake8 tool

flake8 is a Python tool that glues together pycodestyle, pyflakes,
mccabe, and third-party plugins to check the style and quality of some
Python code.

Currently we've issue in phase2 in checksum step:

 /bin/sh: 2: Syntax error: ")" unexpected

And it seems, that flake8 is able to spot places which might lead to
such issues during runtime:

 phase2/master.cfg:733:151: W605 invalid escape sequence '\('
 phase2/master.cfg:733:155: W605 invalid escape sequence '\)'
 phase2/master.cfg:733:158: W605 invalid escape sequence '\('
 phase2/master.cfg:733:162: W605 invalid escape sequence '\)'

So lets enable flake8 checking on the CI so we can spot similar places
in the future and address them before deployment.

We dont want to make current ongoing work on phase2 code harder, thus we
don't touch that part yet, so we whitelist most of the checks for now.

References: f0faed2970dd ("phase2: compute checksums")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agophase2: fix stray closing parenthesis
Petr Štetiar [Sat, 23 Dec 2023 07:14:20 +0000 (07:14 +0000)]
phase2: fix stray closing parenthesis

Due to the stray closing parenthesis introduced in commit f0faed2970dd
("phase2: compute checksums") we have currently we've failing checksum
step in phase2:

 argv: b'cd bin/packages/mipsel_24kc_24kf; find . -type f -not -name \'sha256sums\' -printf "%P\n" | sort | xargs -r ../../../staging_dir/host/bin/mkhash -n sha256 | sed -ne \'s!^\\(.*\\) \\(.*\\)$!\x01 *\x02!p\' > sha256sums)'
 environment:
  ...snip...
  using PTY: False
 /bin/sh: 2: Syntax error: ")" unexpected
 program finished with exit code 2

Fixes: f0faed2970dd ("phase2: compute checksums")
Reported-by: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agophase2: dlsha2rsyncpl: fix sha2rsync.pl script location
Petr Štetiar [Sun, 24 Dec 2023 08:27:03 +0000 (08:27 +0000)]
phase2: dlsha2rsyncpl: fix sha2pl script location

Fixes following error:

 File 'sha2rsync.pl' not available at master

Fixes: c3ddb0db167d ("phase2: use sha2rsync.pl for 'targetupload'")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 months agophase2: update default sdk pattern to a more relaxed pattern
Christian Marangi [Fri, 12 Apr 2024 13:09:45 +0000 (15:09 +0200)]
phase2: update default sdk pattern to a more relaxed pattern

Update default sdk pattern to a more relaxed pattern to make it future
proof if in the future the compression extension will change again.

Needed currently with the migration from .xz to .zst.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
6 months agoCI(deps): Bump docker/login-action from 2 to 3
dependabot[bot] [Fri, 12 Apr 2024 13:18:15 +0000 (13:18 +0000)]
CI(deps): Bump docker/login-action from 2 to 3

Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agoCI(deps): Bump docker/build-push-action from 4 to 5
dependabot[bot] [Fri, 12 Apr 2024 13:18:13 +0000 (13:18 +0000)]
CI(deps): Bump docker/build-push-action from 4 to 5

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agoCI(deps): Bump docker/metadata-action from 4 to 5
dependabot[bot] [Fri, 12 Apr 2024 13:18:12 +0000 (13:18 +0000)]
CI(deps): Bump docker/metadata-action from 4 to 5

Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](https://github.com/docker/metadata-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agoCI(deps): Bump actions/setup-python from 4 to 5
dependabot[bot] [Fri, 12 Apr 2024 13:18:09 +0000 (13:18 +0000)]
CI(deps): Bump actions/setup-python from 4 to 5

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agoCI(deps): Bump actions/checkout from 3 to 4
dependabot[bot] [Fri, 12 Apr 2024 13:18:06 +0000 (13:18 +0000)]
CI(deps): Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agoCI: add dependabot scan
Christian Marangi [Fri, 12 Apr 2024 13:16:53 +0000 (15:16 +0200)]
CI: add dependabot scan

Add dependabot scan to warn and propose updates to our github actions.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
10 months agophase2: max_builds is always set to 1 v12
Thibaut VARÈNE [Fri, 22 Dec 2023 13:32:02 +0000 (14:32 +0100)]
phase2: max_builds is always set to 1

Align with phase1 (ac0d815)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
10 months agobuildmaster: fix Twisted dependency hell by using twisted==22.10.0 v11
Petr Štetiar [Fri, 22 Dec 2023 10:35:23 +0000 (10:35 +0000)]
buildmaster: fix Twisted dependency hell by using twisted==22.10.0

Force twisted==22.10.0 which fixes following buildbot master startup
issue:

Unhandled error in Deferred:

Traceback (most recent call last):
  File "/.../site-packages/buildbot/scripts/create_master.py", line 84, in createDB
    master = BuildMaster(config['basedir'])
  File "/.../site-packages/buildbot/master.py", line 102, in __init__
    self._services_d = self.create_child_services()
  File "/.../site-packages/twisted/internet/defer.py", line 2245, in unwindGenerator
    return _cancellableInlineCallbacks(gen)
  File "/.../site-packages/twisted/internet/defer.py", line 2157, in _cancellableInlineCallbacks
    _inlineCallbacks(None, gen, status, _copy_context())
--- <exception caught here> ---
  File "/.../site-packages/twisted/internet/defer.py", line 1997, in _inlineCallbacks
    result = context.run(gen.send, result)
  File "/.../site-packages/buildbot/master.py", line 188, in create_child_services
    self.www = wwwservice.WWWService()
  File "/.../site-packages/buildbot/www/service.py", line 196, in __init__
    self.apps = get_plugins('www', None, load_now=True)
  File "/.../site-packages/buildbot/plugins/db.py", line 356, in get_plugins
    return _DB.add_namespace(namespace, interface, check_extras, load_now)
  File "/.../site-packages/buildbot/plugins/db.py", line 306, in add_namespace
    tempo.load()
  File "/.../site-packages/buildbot/plugins/db.py", line 242, in load
    self._tree.load()
  File "/.../site-packages/buildbot/plugins/db.py", line 112, in load
    child.load()
  File "/.../site-packages/buildbot/plugins/db.py", line 45, in load
    self._value = self._loader(self._entry)
  File "/.../site-packages/buildbot/plugins/db.py", line 214, in _load_entry
    raise PluginDBError('Requirements are not satisfied '
buildbot.errors.PluginDBError: Requirements are not satisfied for buildbot.www:base:
The 'zope-interface>=5' distribution was not found and is required by Twisted

This commit should be reverted once we bump to buildbot >= 3.10 which
has this workaround integrated.

References: https://github.com/buildbot/buildbot/commit/94e2d59c23472f3fe640437630309bea518c5b9e
Signed-off-by: Petr Štetiar <ynezz@true.cz>
10 months agoci: improve QA with cram based tests
Petr Štetiar [Fri, 22 Dec 2023 09:46:01 +0000 (09:46 +0000)]
ci: improve QA with cram based tests

Currently we've broken master container but we're not aware about it as
current tests are very lame, so lets improve it a bit with some more
reliable, extensible solution.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
10 months agobuildmaster: entry.sh: fix errors by checking for dir existence
Petr Štetiar [Fri, 22 Dec 2023 09:28:40 +0000 (09:28 +0000)]
buildmaster: entry.sh: fix errors by checking for dir existence

Get rid of following annyoing errors during testing:

  chown: cannot access '/config': No such file or directory
  chown: cannot access '/certs': No such file or directory
  chmod: cannot access '/config': No such file or directory
  chmod: cannot access '/certs': No such file or directory

As those dirs doesn't exist in the container, they're being provided as
volumes during deployment.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
11 months agophase2: remove unused git_ssh plumbing v10
Thibaut VARÈNE [Wed, 15 Nov 2023 14:12:17 +0000 (15:12 +0100)]
phase2: remove unused git_ssh plumbing

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agoscripts: remove unused expire.sh
Thibaut VARÈNE [Wed, 15 Nov 2023 12:45:18 +0000 (13:45 +0100)]
scripts: remove unused expire.sh

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: remove unused tree_expire option and steps
Thibaut VARÈNE [Wed, 15 Nov 2023 12:44:42 +0000 (13:44 +0100)]
phase2: remove unused tree_expire option and steps

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: rsync: use --size-only instead of --checksum for sourceupload
Thibaut VARÈNE [Wed, 15 Nov 2023 11:21:41 +0000 (12:21 +0100)]
phase2: rsync: use --size-only instead of --checksum for sourceupload

Align with phase1 (62a01a1)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: use sha2rsync.pl for 'targetupload'
Thibaut VARÈNE [Wed, 15 Nov 2023 10:50:01 +0000 (11:50 +0100)]
phase2: use sha2rsync.pl for 'targetupload'

Align with phase1 (3246628)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: compute checksums
Thibaut VARÈNE [Tue, 14 Nov 2023 17:58:43 +0000 (18:58 +0100)]
phase2: compute checksums

This will be necessary to get rid of 'rsync --checksum' and use
sha2rsync.pl instead, as on phase1, thereby easing the load on the rsync
server.

This uses the same construct as "make checksum" in the main repo.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: reduce verbosity of rsync and use rsync.sh helper
Thibaut VARÈNE [Wed, 15 Nov 2023 10:50:01 +0000 (11:50 +0100)]
phase2: reduce verbosity of rsync and use sh helper

Align with phase1 (e55b76f)

This patch:
- removes '--progress' rsync parameter
- uses the wrapper script 'rsync.sh'

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: don't enable rsync compression where unnecessary
Thibaut VARÈNE [Wed, 15 Nov 2023 09:35:44 +0000 (10:35 +0100)]
phase2: don't enable rsync compression where unnecessary

Align with phase1 (cf7b9ba)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: regroup common rsync options and add timeout
Thibaut VARÈNE [Tue, 14 Nov 2023 11:23:11 +0000 (12:23 +0100)]
phase2: regroup common rsync options and add timeout

Align with phase1 (3deb6c0)

"-4 -v --timeout=120"

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: report ccache stats at end of build
Thibaut VARÈNE [Tue, 14 Nov 2023 10:20:34 +0000 (11:20 +0100)]
phase2: report ccache stats at end of build

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agoRevert "phase2: use full git history for reproducibility"
Thibaut VARÈNE [Mon, 13 Nov 2023 16:32:34 +0000 (17:32 +0100)]
Revert "phase2: use full git history for reproducibility"

Following openwrt/11bb5337b8d8b5018e48f0df415efb99e2f49d0d we no longer
need the full git history.

This reverts commit 5b96616d056e26adbd50cc73a5e51b8449110b7d.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: use Interpolate instead of WithProperties
Thibaut VARÈNE [Sat, 11 Nov 2023 16:26:41 +0000 (17:26 +0100)]
phase2: use Interpolate instead of WithProperties

Align with phase1 (d1a92ba)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: s/SetProperty/SetPropertyFromCommand/
Thibaut VARÈNE [Sat, 11 Nov 2023 15:28:07 +0000 (16:28 +0100)]
phase2: s/SetProperty/SetPropertyFromCommand/

Align with phase1 (3141c97)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: do not exceed nproc build concurrency
Thibaut VARÈNE [Sat, 11 Nov 2023 15:12:37 +0000 (16:12 +0100)]
phase2: do not exceed nproc build concurrency

Align with phase1 (2ad0478)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase2: remove unused 'other_builds' property
Thibaut VARÈNE [Sat, 11 Nov 2023 15:11:25 +0000 (16:11 +0100)]
phase2: remove unused 'other_builds' property

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase1: treat all branches equally for building
Thibaut VARÈNE [Tue, 14 Nov 2023 13:23:50 +0000 (14:23 +0100)]
phase1: treat all branches equally for building

Following discussion here:
https://lists.openwrt.org/pipermail/openwrt-devel/2023-November/041769.html

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agophase1: raise priority of tag builds
Thibaut VARÈNE [Mon, 13 Nov 2023 14:23:49 +0000 (15:23 +0100)]
phase1: raise priority of tag builds

Currently the buildmaster would only order tag builds within their own
branch, meaning that if e.g. a higher priority branch has normal
buildrequests (i.e. buildrequests comming from the AnyBranchScheduler),
and a lower priority branch has "tag" buildrequests (i.e. from the
Triggerable scheduler), the former builderequests would be served first,
deferring the build of e.g. release tags.

We want forced builds (release tag) to have maximum priority, regardless
of branch priority. This commit attempts to solve this problem by
leveraging the newly (as of buildbot 3.9.0) introduced "priority"
scheduler parameter, by raising the Triggerable scheduler buildrequests
priority, and then considering this higher priority in Builders' order.

The net result is that Builders are now prioritized if they have
pending higher priority buildrequest, still preserving the branch order.
In other words, tag requests are front run while preserving branch order,
meaning that if two branches have tag buildrequests, the higher priority
branch is still served first.

This requires buildbot 3.9.0

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
11 months agoci: split container push steps to separate job and add deploy tag
Christian Marangi [Tue, 14 Nov 2023 13:53:12 +0000 (14:53 +0100)]
ci: split container push steps to separate job and add deploy tag

Split container push related steps to separate jobs and add deploy tag.

This is to better organize the workflow and drop additional checks for
single steps moving them to the single job.
Also we use a feature of github to better track changes deployed to our
buildbot.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
11 months agoci: generalize container test step
Christian Marangi [Tue, 14 Nov 2023 13:49:37 +0000 (14:49 +0100)]
ci: generalize container test step

Generalize container test step by using include feature of matrix
strategy and defining additional values for container command test and
config verification.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
11 months agoci: move git short sha length to ENV
Christian Marangi [Tue, 14 Nov 2023 13:47:26 +0000 (14:47 +0100)]
ci: move git short sha length to ENV

Move git short sha length to ENV to make it easier to configure in the
future if needed.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
11 months agodocker,worker: install zstd
Paul Spooren [Tue, 14 Nov 2023 11:27:08 +0000 (12:27 +0100)]
docker,worker: install zstd

Faster compression with partly better rates. Should be used eventually
for ImageBuilders etc.

Signed-off-by: Paul Spooren <mail@aparcar.org>
15 months agodocker,worker: install pyelftools v9
Ben Whitten [Thu, 27 Jul 2023 20:25:56 +0000 (21:25 +0100)]
docker,worker: install pyelftools

UBoot version of at least 2023.07.02 that use binman also have a dependency of pyelftools on the build host.

Signed-off-by: Ben Whitten <BWhitten@users.noreply.github.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [whitespace fix]
15 months agophase1: workaround dlprune recursive directory removal v8
Petr Štetiar [Sat, 22 Jul 2023 08:53:45 +0000 (10:53 +0200)]
phase1: workaround dlprune recursive directory removal

Workarounds following issue:

 find: cannot delete ‘dl/ath10k-ct-firmware-2020-11-08’: Directory not empty

References: #13
Signed-off-by: Petr Štetiar <ynezz@true.cz>
15 months agophase1: prepareFactory: use variables instead of list index
Petr Štetiar [Sun, 18 Jun 2023 05:32:22 +0000 (07:32 +0200)]
phase1: prepareFactory: use variables instead of list index

Thus make the code more readable.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
15 months agophase1: populateTargets: log branch name as well
Petr Štetiar [Sun, 18 Jun 2023 05:28:01 +0000 (07:28 +0200)]
phase1: populateTargets: log branch name as well

So the progress is more verbose.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
15 months agophase1: do not leak targets between branches
Petr Štetiar [Sun, 18 Jun 2023 05:26:17 +0000 (07:26 +0200)]
phase1: do not leak targets between branches

Robert noticed, that after rename of `ipq807x` target in main branch to
`qualcommax/ipq807x` subtarget, that buildbot is trying to build this
new `qualcommax/ipq807x` subtarget on `openwrt-23.05` branch as well.

Thibaut later explained, that this is by design, his initial idea was to
find exhaustive list of all targets and let the `checkarch` step do the
final triaging.

I find this approach confusing, because if the subtarget is not present
in that branch, we shouldn't have builder for it configured as well.
Furthermore wasting roughly 5 minutes of precious buildworker time to
checkout all feeds and then just find out, that we're not going to use
those seems suboptimal as well.

So lets fix it by using builders for targets as present in respective
branches.

Fixes: #14
Reported-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
16 months agophase1: reformat with black
Petr Štetiar [Sun, 18 Jun 2023 05:19:32 +0000 (07:19 +0200)]
phase1: reformat with black

Making everything consistent, more readable, CI guarded.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agophase1: dlprune: fix cannot delete ‘dl/’: Not a directory v7
Petr Štetiar [Thu, 1 Jun 2023 05:56:49 +0000 (07:56 +0200)]
phase1: dlprune: fix cannot delete ‘dl/’: Not a directory

dlprune currently fails with following error:

 find: cannot delete ‘dl/’: Not a directory

Initial idea was to delete only stuff under download directory and not
the download directory itself, so lets adjust the find command
accordingly.

Fixes: 68b20ed67b5e ("phase1: prune unused files from dl/")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agophase1: satisfy getver.sh requirements v6
Thibaut VARÈNE [Tue, 23 May 2023 18:12:09 +0000 (20:12 +0200)]
phase1: satisfy getver.sh requirements

scripts/getver.sh requires upstream branch tracking to correctly compute
revision number. Buildbot Git() step does not set branch tracking as it
checks out individual commits and then reset the target branch to it, so
in order for getver.sh to work, this workaround forcefully sets the
upstream branch.

This fixes malformed version code in filenames as observed on
openwrt-23.05:

r23001+3-38c150612c
instead of:
r23004-7f0db09513

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
17 months agophase1: cleanup redundant steps v5
Thibaut VARÈNE [Mon, 22 May 2023 18:20:12 +0000 (20:20 +0200)]
phase1: cleanup redundant steps

These 3 rm steps are unnecessary since these folders are already cleaned
by the Git() step. Thus reduce clutter in already pretty busy Factory.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
17 months agophase1: workaround gitverify 1st build failures on fresh workers v4
Petr Štetiar [Tue, 16 May 2023 18:41:05 +0000 (20:41 +0200)]
phase1: workaround gitverify 1st build failures on fresh workers

Currently every 1st build on ephemeral build worker results in the
failure of the `gitverify` build step as the stock buildbot Git() build
step for some reasons just clones the Git repository into detached HEAD
state.

On the 2nd build using the same build worker Git() checkouts the branch
and thus makes `gitverify` step happy and the builds then continues
normally.

This needs to be fixed properly, either by adjusting the `gitverify`
check or adding suitable `mode` into Git() build step, but this needs
more time and testing.

So for now, lets simply workaround that issue by running Git() step two
times.

References: #5
Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agodocker,worker: install g++-multilib
Alois Klink [Wed, 23 Nov 2022 17:23:48 +0000 (17:23 +0000)]
docker,worker: install g++-multilib

From [openwrt/docker@5484951][1] (GitHub PR [#89][2]):

Node fails to cross-compile from a 64-bit build machine to 32-bit host
with the following error:

```
  In file included from /usr/include/c++/8/memory:62,
  from ../deps/v8/src/libplatform/default-foreground-task-runner.h:8,
  from ../deps/v8/src/libplatform/default-foreground-task-runner.cc:5:
  /usr/include/c++/8/bits/stl_algobase.h:59:10: fatal error: bits/c++config.h:
    No such file or directory
  #include <bits/c++config.h>
          ^~~~~~~~~~~~~~~~~~
  compilation terminated.
```

On Debian, `g++-multilib` can be installed to fix this.

[1]: https://gitlab.com/openwrt/docker/-/commit/54849510d7802028b94757051cca6d004a9ca1d1
[2]: https://github.com/openwrt/docker/pull/89

Fixes: https://github.com/openwrt/packages/issues/18476
Fixes: https://forum.openwrt.org/t/why-arent-the-node-and-node-npm-packages-available-on-arm-cortex-a9-vfpv3-d16-in-22-03-2/142722
Signed-off-by: Alois Klink <alois@aloisklink.com>
17 months agoci: add basic config checking with ruff v3
Petr Štetiar [Tue, 16 May 2023 10:57:56 +0000 (12:57 +0200)]
ci: add basic config checking with ruff

Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agophase1: actually make rsync -4 configurable
Thibaut VARÈNE [Mon, 15 May 2023 20:08:50 +0000 (22:08 +0200)]
phase1: actually make rsync -4 configurable

54e80d5ce introduced an interpolate bug that would evaluate an empty
string as being part of the arguments passed to rsync, resulting in a
failure as rsync interprets that empty string as a source.

This commit fixes this by instead appending '4' to regular shortopts
when necessary.

Fixes: 54e80d5ce
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agophase1: perform kmodupload only when needed
Thibaut VARÈNE [Tue, 16 May 2023 08:13:11 +0000 (10:13 +0200)]
phase1: perform kmodupload only when needed

Fixes: 909e899
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agophase1: fix crash on exception during Git update v2
Petr Štetiar [Mon, 15 May 2023 14:18:16 +0000 (16:18 +0200)]
phase1: fix crash on exception during Git update

Fixes following exception:

 2023-05-15 14:08:56+0000 [-] <Build master_apm821xx/nand number:1 results:success> build got exception when running step Git(name='git', repourl='https://git.openwrt.org/openwrt/openwrt.git', mode='full', method='fresh', locks=renderer(<function NetLockDl at 0x7f5d33351ee0>), haltOnFailure=True)
 2023-05-15 14:08:56+0000 [-] Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/twisted/internet/defer.py", line 1792, in gotResult
    _inlineCallbacks(r, gen, status, context)
  File "/usr/local/lib/python3.9/dist-packages/twisted/internet/defer.py", line 1693, in _inlineCallbacks
    result = context.run(
  File "/usr/local/lib/python3.9/dist-packages/twisted/python/failure.py", line 518, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/local/lib/python3.9/dist-packages/buildbot/process/build.py", line 576, in _start_next_step_impl
    log.err(e)
--- <exception caught here> ---
  File "/usr/local/lib/python3.9/dist-packages/buildbot/process/build.py", line 562, in _start_next_step_impl
    results = yield step.startStep(self.conn)
builtins.KeyError: None

as None is valid property value, but cant be used as dict index.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agoci: allow pushing of containers during pull requests
Petr Štetiar [Mon, 15 May 2023 07:25:07 +0000 (09:25 +0200)]
ci: allow pushing of containers during pull requests

Make it possible to push containers in pull requests in private forks,
so the container can be actually runtime tested before merging the
changes.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agobuildworker,buildmaster: bump Debian to version 11
Petr Štetiar [Mon, 15 May 2023 07:14:48 +0000 (09:14 +0200)]
buildworker,buildmaster: bump Debian to version 11

Debian 10 LTS support ends on 6/2024, so it makes no sense to use it as
a base for 23.05 release, so lets switch to Debian 11 which should've
LTS support till 6/2026.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agoBump buildbot version to latest stable release 3.8.0
Petr Štetiar [Mon, 15 May 2023 07:12:16 +0000 (09:12 +0200)]
Bump buildbot version to latest stable release 3.8.0

Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agobuildmaster: fix unpinned buildbot package version
Petr Štetiar [Mon, 15 May 2023 06:53:58 +0000 (08:53 +0200)]
buildmaster: fix unpinned buildbot package version

It seems, that current pip3 install pinning doesnt work properly as it
can result in the following package versions installation:

 buildbot-3.6.1 buildbot-console-view-3.5.0 buildbot-grid-view-3.5.0
 buildbot-waterfall-view-3.5.0 buildbot-worker-3.5.0 buildbot-www-3.5.0

So lets pin the buildbot package itself to BUILDBOT_VERSION as well.

References: https://gitlab.com/openwrt/buildbot/-/jobs/3324049571#L1158
Signed-off-by: Petr Štetiar <ynezz@true.cz>
17 months agophase1: make 'rsync -4' worker-configurable
Thibaut VARÈNE [Tue, 15 Nov 2022 09:44:56 +0000 (10:44 +0100)]
phase1: make 'rsync -4' worker-configurable

We set '-4' in rsync_defopts, asking rsync to "prefer" ipv4 whenever
possible on _all_ workers. This was historically done because some
workers had flaky ipv6 connectivity, however in the future the reverse
may be true, with worker having worse networking over ipv4 than ipv6.

This change introduces an 'rsync_ipv4' worker configuration option:
when set to a true value, the old rsync behavior (adding '-4') is used,
when unset or set to false, the extra rsync argument is not used.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
17 months agophase1: call host ccache in stats
Thibaut VARÈNE [Fri, 28 Oct 2022 09:05:21 +0000 (11:05 +0200)]
phase1: call host ccache in stats

We do not use the staging_dir ccache on buildbots (config seed contains
CONFIG_CCACHE=n), only the host tool if present.
Also only execute this step if 'ccache_command' is set.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
17 months agophase1: tag builders with their intended branch name
Thibaut VARÈNE [Thu, 27 Oct 2022 20:35:09 +0000 (22:35 +0200)]
phase1: tag builders with their intended branch name

This helps sorting them in waterfall and builders views.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
17 months agophase1: documentation update
Thibaut VARÈNE [Thu, 27 Oct 2022 18:31:19 +0000 (20:31 +0200)]
phase1: documentation update

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
17 months agophase1: allow restricting builders to tag builds only
Thibaut VARÈNE [Thu, 27 Oct 2022 12:56:21 +0000 (14:56 +0200)]
phase1: allow restricting builders to tag builds only

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
17 months agophase1: refactor worker parsing
Thibaut VARÈNE [Thu, 27 Oct 2022 12:32:30 +0000 (14:32 +0200)]
phase1: refactor worker parsing

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>