buildbot.git
4 years agophase2: move usign handling to master
Jo-Philipp Wich [Sun, 30 Jun 2019 16:13:57 +0000 (18:13 +0200)]
phase2: move usign handling to master

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase1: move usign handling to master
Jo-Philipp Wich [Sun, 30 Jun 2019 16:13:44 +0000 (18:13 +0200)]
phase1: move usign handling to master

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agoscripts: signall.sh: add using support
Jo-Philipp Wich [Sun, 30 Jun 2019 16:13:26 +0000 (18:13 +0200)]
scripts: signall.sh: add using support

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agoscripts: add usign secret to public key converter
Jo-Philipp Wich [Fri, 28 Jun 2019 11:09:56 +0000 (13:09 +0200)]
scripts: add usign secret to public key converter

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agotreewide: untangle phase1 and phase2 masters
Jo-Philipp Wich [Fri, 28 Jun 2019 11:05:58 +0000 (13:05 +0200)]
treewide: untangle phase1 and phase2 masters

 - Move shared scripts into a common scripts/ directory
 - Move SSH Git clone key directly into the configuration
 - Update configuration examples

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase1: add further Git clone/pull safety guards
Jo-Philipp Wich [Tue, 25 Jun 2019 18:38:44 +0000 (20:38 +0200)]
phase1: add further Git clone/pull safety guards

- Ensure that we're on a valid branch before invoking buildbot Git()
- Verify that we did end up on a proper branch or tag after clone/pull

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-June/017809.html
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase1: fix GnuPG 2.x compatibility
Jo-Philipp Wich [Tue, 25 Jun 2019 04:40:38 +0000 (06:40 +0200)]
phase1: fix GnuPG 2.x compatibility

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase2: add version suffix to faillogs directory
Jo-Philipp Wich [Mon, 24 Jun 2019 04:31:06 +0000 (06:31 +0200)]
phase2: add version suffix to faillogs directory

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase2: add ability to clone feeds via SSH
Jo-Philipp Wich [Mon, 24 Jun 2019 04:12:31 +0000 (06:12 +0200)]
phase2: add ability to clone feeds via SSH

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase1: add ability to clone feeds via SSH
Jo-Philipp Wich [Mon, 24 Jun 2019 04:12:12 +0000 (06:12 +0200)]
phase1: add ability to clone feeds via SSH

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase1: make feed update and install errors fatal
Jo-Philipp Wich [Sat, 22 Jun 2019 07:11:43 +0000 (09:11 +0200)]
phase1: make feed update and install errors fatal

Do not continue building if the feed cloning failed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase2: improve source archive uploading
Jo-Philipp Wich [Fri, 21 Jun 2019 06:56:24 +0000 (08:56 +0200)]
phase2: improve source archive uploading

Only upload source archives which have been updated sicne the begin
of the build.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase1: improve source archive uploading
Jo-Philipp Wich [Fri, 21 Jun 2019 06:55:18 +0000 (08:55 +0200)]
phase1: improve source archive uploading

Only upload source archives which have been updated sicne the begin
of the build.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase2: use a more reliable method to find the target version
Jo-Philipp Wich [Thu, 20 Jun 2019 15:50:21 +0000 (17:50 +0200)]
phase2: use a more reliable method to find the target version

Replace the slave name based target version detection by a more reliable
approach using SDK provided version information.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase1: honour version prefix when fetching sha256sums
Jo-Philipp Wich [Thu, 20 Jun 2019 15:42:17 +0000 (17:42 +0200)]
phase1: honour version prefix when fetching sha256sums

This is requires for non-master builds which use a slightly different
directory layout on the rsync host.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase2: make feed update and install errors fatal
Jo-Philipp Wich [Mon, 17 Jun 2019 13:20:14 +0000 (15:20 +0200)]
phase2: make feed update and install errors fatal

Do not continue building if the feed cloning failed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agophase2: report disk usage at end of build
Jo-Philipp Wich [Mon, 17 Jun 2019 13:19:23 +0000 (15:19 +0200)]
phase2: report disk usage at end of build

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agophase2: clear staged failure logs as well
Jo-Philipp Wich [Sat, 10 Nov 2018 14:14:15 +0000 (15:14 +0100)]
phase2: clear staged failure logs as well

This should prevent persistent slaves from re-uploading stale error logs.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agophase2: reset error log list on each build
Jo-Philipp Wich [Sat, 10 Nov 2018 13:05:00 +0000 (14:05 +0100)]
phase2: reset error log list on each build

The OpenWrt buildroot only ever appends to error.txt, but never clears it.

This causes slaves with persistent build environments to keep uploading
build logs of suceeding packages over and over, even if they've long been
fixed already.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agophase1: build toolchain without ccache
Jo-Philipp Wich [Tue, 25 Sep 2018 14:02:21 +0000 (16:02 +0200)]
phase1: build toolchain without ccache

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agophase1: rework MakeEnv()
Jo-Philipp Wich [Tue, 25 Sep 2018 13:57:28 +0000 (15:57 +0200)]
phase1: rework MakeEnv()

Always set CCC and CCXX since ./staging_dir/host/bin/{gcc,g++} might be
symlinked to the ccache wrapper which uses $CCC / $CCXX to refer to the
actual compiler, even when we intend to invoke the build without ccache.

While being at it, shuffle the code around somewhat to reduce some
redundancy and to make the function a bit shorter.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agophase1: fix disk size reporting command
Jo-Philipp Wich [Tue, 25 Sep 2018 13:19:12 +0000 (15:19 +0200)]
phase1: fix disk size reporting command

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agophase1: use ccache wrappers for all HOSTCC/HOSTCXX uses
Thibaut VARÈNE [Tue, 24 Jul 2018 10:41:16 +0000 (12:41 +0200)]
phase1: use ccache wrappers for all HOSTCC/HOSTCXX uses

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: correct PATH order for ccachestat
Thibaut VARÈNE [Sat, 21 Jul 2018 16:38:37 +0000 (18:38 +0200)]
phase1: correct PATH order for ccachestat

prefer host-wide first

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: report both buildir and homedir disk usage
Thibaut VARÈNE [Fri, 29 Jun 2018 16:20:56 +0000 (18:20 +0200)]
phase1: report both buildir and homedir disk usage

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: regroup common rsync options
Thibaut VARÈNE [Fri, 29 Jun 2018 16:13:14 +0000 (18:13 +0200)]
phase1: regroup common rsync options

"-4 -v --timeout=120 --contimeout=20"

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: use wrappers for ccache
Thibaut VARÈNE [Fri, 29 Jun 2018 10:39:01 +0000 (12:39 +0200)]
phase1: use wrappers for ccache

750174c0cee95925dd322f37c211577d0ebc0dc4 attempted to inject ccache
into the CC environment, but that doesn't work as the CC/CXX variables
are processed by the build system, in order to extract the path to an
executable file.

This commit works around that situation by creating two simple wrapper
scripts on the slave. The remaining logic is unchanged:

When tryccache is False, CC/CXX point to the regular compilers and no
ccache injection is performed.

When tryccache is True, CC/CXX point to their respective wrapper, and
CCACHE is set to the path to ccache (if it exists, empty otherwise),
CCC/CCXX point to the original compilers, and the wrappers will execute
'${CCACHE} ${CCC} "$@"' or '${CCACHE} ${CCXX} "$@"'. If ${CCACHE} is
unset, this falls back to plain compilers.

i.e. ccache is only used if tryccache=True AND ccache has been found on
the slave.

Use 'exec' to avoid lingering shell during execution.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: set rsync timeouts
Thibaut VARÈNE [Thu, 28 Jun 2018 10:22:52 +0000 (12:22 +0200)]
phase1: set rsync timeouts

Regardless of the timeout settings of buildbot or the use of 'pv' to
circumvent them, it is desirable to ensure that rsync will fail if the
connection hangs or cannot be established for any reason.

Otherwise, we might end up with builders stuck on network transfers.

This commit sets data transfer timeout to 120s and connection timeout
to 20s.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: use sha2rsync.pl for 'targetupload'
Thibaut VARÈNE [Wed, 27 Jun 2018 16:19:12 +0000 (18:19 +0200)]
phase1: use sha2rsync.pl for 'targetupload'

This patch uses sha2rsync.pl to build a list of files to upload
to the remote server via rsync.

Because --files-from is taken as a literal list of files to consider by
rsync (the file list generation is skipped), it will not delete files on
the receiver.

To work around that without implementing a broken client-side upload
queue management system, 'targetupload' is split in two: the first step
uploads and updates new and existing files using rsync standard
mechanism, and the second step does nothing but delete files that are
present on the receiver but not on the sender.

As a side effect, this implements a '--delete-after' deletion style where
files are only deleted after uploads/updates finished successfully.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: add sha2rsync.pl
Thibaut VARÈNE [Thu, 28 Jun 2018 10:07:55 +0000 (12:07 +0200)]
phase1: add sha2rsync.pl

This script is meant to produce a list of files that are different
on the builder (vs server) without incurring the overhead of using
"rsync --checksum"

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: move kmod archive after 'checksums'
Thibaut VARÈNE [Wed, 27 Jun 2018 16:12:39 +0000 (18:12 +0200)]
phase1: move kmod archive after 'checksums'

We don't want the special kmod archive to show up in checksums output.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: disable --size-only for targetupload and kmodupload
Thibaut VARÈNE [Wed, 27 Jun 2018 16:23:35 +0000 (18:23 +0200)]
phase1: disable --size-only for targetupload and kmodupload

This was causing trouble with some files.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: name all download and git steps
Thibaut VARÈNE [Tue, 26 Jun 2018 18:29:47 +0000 (20:29 +0200)]
phase1: name all download and git steps

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: remove ccache helper
Thibaut VARÈNE [Tue, 26 Jun 2018 18:20:17 +0000 (20:20 +0200)]
phase1: remove ccache helper

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: rsync --info is supported from rsync 3.1.0
Thibaut VARÈNE [Tue, 26 Jun 2018 17:20:43 +0000 (19:20 +0200)]
phase1: rsync --info is supported from rsync 3.1.0

upload server runs rsync 3.0.9, until it is updated this feature is
disabled

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: restore 'build' directory after expiry
Thibaut VARÈNE [Tue, 26 Jun 2018 15:48:08 +0000 (17:48 +0200)]
phase1: restore 'build' directory after expiry

expire.sh wipes the salve 'build' directory, which throws the next step
out of its track as os.path.exists() and os.makedirs() do not agree.

Recreate the 'build' directory after expire has deleted everything.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: remove renderable locks: not supported in 0.8.9
Thibaut VARÈNE [Tue, 26 Jun 2018 14:29:48 +0000 (16:29 +0200)]
phase1: remove renderable locks: not supported in 0.8.9

Support for renderable locks was only added in buildbot 0.9.0

0.8.9 fails with:

  File "/usr/lib/python2.7/dist-packages/buildbot/process/buildstep.py", line 266, in startStep
    for access in self.locks]
exceptions.TypeError: '_Renderer' object is not iterable

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: use Interpolate instead of WithProperties
Thibaut VARÈNE [Mon, 25 Jun 2018 10:27:00 +0000 (12:27 +0200)]
phase1: use Interpolate instead of WithProperties

WithProperties is marked as deprecated since buildbot 0.8.7.

Trying to make the config future-proof, this patch replaces every
instance of WithProperties() by the corresponding Interpolate()
equivalent.

As of buildbot 0.8.9 it appears that Interpolate() doesn't correctly
handle integer format with parameters that call a function, so make
GetNumJobs() return a string:

  File "phase1/master.cfg", line 672, in <module>
    command = ["make", Interpolate("-j%(kw:jobs)d", jobs=GetNumJobs), "tools/tar/compile", "V=s"],
    fmtstring % dd
exceptions.TypeError: %d format: a number is required, not str
Configuration Errors:
  error while parsing config file: %d format: a number is required, not str (traceback in logfile)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: add config option for shared workdir
Thibaut VARÈNE [Fri, 22 Jun 2018 13:25:47 +0000 (15:25 +0200)]
phase1: add config option for shared workdir

This patch adds a per-slave configuration option:
    shared_wd = <boolean>

This option defaults to False if unset, and should be set to True for
slaves that share a single workdir among all workers.

When it is True, expires.sh and cleanup.sh are disabled as the workdir
housekeeping is entirely handled by the Git() step and the value of the
'do_cleanup' configuration option.

expires.sh and cleanup.sh are unnecessary and potentially detrimental in
this context.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: delete unused code
Thibaut VARÈNE [Fri, 22 Jun 2018 09:08:11 +0000 (11:08 +0200)]
phase1: delete unused code

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: s/SetProperty/SetPropertyFromCommand/
Thibaut VARÈNE [Fri, 22 Jun 2018 09:56:40 +0000 (11:56 +0200)]
phase1: s/SetProperty/SetPropertyFromCommand/

shell.SetProperty() is a deprecated name for SetPropertyFromCommand()

SetProperty() in buildbot documentation refers to master.SetProperty
which behaves in a completely different way

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: move max_builds to slave properties
Thibaut VARÈNE [Fri, 22 Jun 2018 14:17:06 +0000 (16:17 +0200)]
phase1: move max_builds to slave properties

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: use do_cleanup to select Git() method
Thibaut VARÈNE [Fri, 22 Jun 2018 10:16:36 +0000 (12:16 +0200)]
phase1: use do_cleanup to select Git() method

Git() parameters cannot accept a renderer such as Interpolate() (this
feature is only available from buildbot version 0.8.10).

To implement this feature in 0.8.9 we have to split the 'fresh' and
'clean' cases and make them separate steps that are mutually exclusive
(via doStepIf).

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: move do_cleanup to slave properties
Thibaut VARÈNE [Fri, 22 Jun 2018 12:25:17 +0000 (14:25 +0200)]
phase1: move do_cleanup to slave properties

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: report ccache stats at end of build
Thibaut VARÈNE [Thu, 21 Jun 2018 18:16:42 +0000 (20:16 +0200)]
phase1: report ccache stats at end of build

ccache.sh tries to report ccache statistics but at the time this
script is run, the ccache binary hasn't been built and is thus
unavailable.

This patch tries to run 'ccache -s' at the end of the build. It
will look for ccache in the staging_dir first then in the host PATH.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: opportunistic use of ccache
Thibaut VARÈNE [Thu, 21 Jun 2018 19:14:14 +0000 (21:14 +0200)]
phase1: opportunistic use of ccache

Assuming that CONFIG_CCACHE is disabled in the target config.seed,
this patch tries to enable the use of ccache (if available from the host)
for the 'dltar' and 'tools' steps, which are the only two steps where the
build objects are shared by /all/ workers, and thus the two steps where
caching makes the most sense and should provide the most benefits.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: download ccache.sh to slavedir
Thibaut VARÈNE [Thu, 21 Jun 2018 18:11:53 +0000 (20:11 +0200)]
phase1: download ccache.sh to slavedir

Align behaviour with other script downloads.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: remove redundant git steps and document
Thibaut VARÈNE [Thu, 21 Jun 2018 16:39:41 +0000 (18:39 +0200)]
phase1: remove redundant git steps and document

Based on buildbot documentation and the contents of
`buildbot/steps/source/git.py'

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: Git step method 'clean' only works in mode 'full'
Thibaut VARÈNE [Thu, 21 Jun 2018 15:31:56 +0000 (17:31 +0200)]
phase1: Git step method 'clean' only works in mode 'full'

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: don't expire the tree if cleanup is requested
Thibaut VARÈNE [Thu, 21 Jun 2018 10:22:00 +0000 (12:22 +0200)]
phase1: don't expire the tree if cleanup is requested

expire.sh will wipe the git repository, which is unnecessary and
adds overhead (redownload) if cleanup is already enacted.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: do not exceed nproc build concurrency
Thibaut VARÈNE [Thu, 21 Jun 2018 09:04:37 +0000 (11:04 +0200)]
phase1: do not exceed nproc build concurrency

Contrary to popular belief, exceeding the number of available CPU cores
in parallel builds (by running e.g. 'make -j$(($nproc+1))' where 'nproc'
is the number of active CPUs on the system) brings no performance benefit,
and may in fact negatively affect build times. This performance hit can
be further aggravated by the extra memory pressure resulting from the
extraneous jobs.

See:
- https://blog.regehr.org/archives/1416
- http://blog.stuffedcow.net/2011/08/hyperthreading-performance/

This is particularly relevant in two distinct cases:
- on hyper-threaded systems, where half of the active CPUs are separate
  threads on the same physical core;
- on virtualized guests systems, where the host physical CPUs are already
  affected by system overhead not visible to the guest.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: update config.seed.example with CCACHE=n, AUTOREMOVE=y
Thibaut VARÈNE [Wed, 20 Jun 2018 18:42:47 +0000 (20:42 +0200)]
phase1: update config.seed.example with CCACHE=n, AUTOREMOVE=y

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: kernelversion: add missing LF
Thibaut VARÈNE [Wed, 20 Jun 2018 17:05:05 +0000 (19:05 +0200)]
phase1: kernelversion: add missing LF

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: "Building and installing" for appropriate steps
Thibaut VARÈNE [Wed, 20 Jun 2018 17:03:01 +0000 (19:03 +0200)]
phase1: "Building and installing" for appropriate steps

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: don't enable rsync compression where unnecessary
Thibaut VARÈNE [Thu, 21 Jun 2018 11:51:26 +0000 (13:51 +0200)]
phase1: don't enable rsync compression where unnecessary

Enabling rsync compression for already compressed files adds CPU
and memory overhead that negatively impacts upload speed on data
that cannot be further compressed.

By default rsync ignores '-z' on a number of files it knows to be
already compressed (based on filename suffix), but the list is not
exhaustive and doesn't include e.g. '.ipk'. Instead of trying to maintain
a list of all known compressed suffixes uploaded by the build system,
it's simpler and less error prone to simply disable the option for
specific steps where all or nearly all of the transferred files are known
to be already compressed.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: reduce verbosity of rsync
Thibaut VARÈNE [Wed, 20 Jun 2018 18:37:59 +0000 (20:37 +0200)]
phase1: reduce verbosity of rsync

The purpose of this patch is to reduce uplink bandwidth contention when
rsync uploads are running.

This patch:
- replaces '-v' and '--progress' by '--info=name' in rsync's parameter
  list (assuming it's necessary to output a list of updated files)
- introduces a wrapper script 'rsync.sh' which checks for the presence
  and executability of 'pv' and pipes the output of rsync through
  'pv -t -i 60 -f' if possible, and falls back to plain rsync otherwise.

'--info=name' prints one line to stdout for each file that is updated on
the remote side.
'pv -t -i 60 -f' prints a 1mn-resolution timer to stderr, with the goal
of preventing the current buildbot step to timeout due to lack of process
output.

It's worth noting that '--progress' did not prevent some timeouts (most
notably on the 'sourceupload' step) since --progress only emits output
for files that are updated on the remote side.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: rsync: use --size-only instead of --checksum
Thibaut VARÈNE [Wed, 20 Jun 2018 15:36:02 +0000 (17:36 +0200)]
phase1: rsync: use --size-only instead of --checksum

'--checksum' puts heavy I/O and memory load on both the sender and the
receiver and dramatically reduces rsync's speedup. Furthermore, if
multiple slaves are uploading at once the receiver may become overloaded,
slowing down the whole build farm. From rsync manpage:
    Generating the checksums means that both sides will expend a lot of
    disk I/O reading all the data in the files in the transfer (and this
    is prior to any reading that will be done to transfer changed files),
    so this can slow things down significantly.
This slowdown causes timeouts for some build slaves, noticeably in the
'sourceupload' step.

'--size-only' matches files by size only. Compared to '--checksum', it is
faster, and does not aggravate the collision/error risk (if two files of
the same name and size have different checksums, we don't have a heuristic
to determine which is "correct" and which is "invalid" anyway)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: provide upload/download locking
Thibaut VARÈNE [Thu, 7 Jun 2018 17:12:38 +0000 (19:12 +0200)]
phase1: provide upload/download locking

This patch offers an optional locking mechanism to ensure that specific
build slaves do not perform concurrent network operations

Each slave definition can feature two additional options:

ul_lock = <lock identifier string>
dl_lock = <lock identifier string>

In the scenario where a group of build slaves share the same physical
network link, these variables can be used as follows:

If the link is full duplex capable, each slave from the target group
would be configured with e.g.:

dl_lock = slavegroup1_dl
ul_lock = slavegroup1_ul

This enables separate locks for uplink and downlink.

If the link is not full duplex capable, then each slave from the target
group would be configured with e.g.:

dl_lock = slavegroup1
ul_lock = slavegroup1

Effectively making uplink and downlink share the same lock

If neither option is set, no lock is enforced and the patch is a no-op.

In this patch the locks are only applied to steps that cause significant
network traffic.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
5 years agophase1: add kmod archiving and cleanup settings
Jo-Philipp Wich [Wed, 20 Jun 2018 14:43:59 +0000 (16:43 +0200)]
phase1: add kmod archiving and cleanup settings

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agophase2: cleanup.sh: add hack to remove npm / jsmake debris
Jo-Philipp Wich [Wed, 20 Jun 2018 14:43:58 +0000 (16:43 +0200)]
phase2: cleanup.sh: add hack to remove npm / jsmake debris

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agosourceupload: add slave name to rsync temp directory name
Jo-Philipp Wich [Wed, 6 Jun 2018 20:04:01 +0000 (22:04 +0200)]
sourceupload: add slave name to rsync temp directory name

This solves clashes when the same target builders on different clusters
upload source archives at the same time.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase1: move cleanup.sh script out of build/ subdir
Jo-Philipp Wich [Tue, 9 Jan 2018 14:33:04 +0000 (15:33 +0100)]
phase1: move cleanup.sh script out of build/ subdir

When cleanup.sh itself is placed into the build/ subdir, subsequent Git()
source steps will fail with a directory not empty error.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase2: LEDE -> OpenWrt rebranding
Jo-Philipp Wich [Sat, 9 Dec 2017 14:02:12 +0000 (15:02 +0100)]
phase2: LEDE -> OpenWrt rebranding

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase1: add support for per-slave cleanup
Jo-Philipp Wich [Wed, 6 Dec 2017 15:25:21 +0000 (16:25 +0100)]
phase1: add support for per-slave cleanup

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase2: abort if ccache or dl/ setup failed
Jo-Philipp Wich [Wed, 6 Dec 2017 14:55:21 +0000 (15:55 +0100)]
phase2: abort if ccache or dl/ setup failed

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase1: ccache.sh: fail on error
Jo-Philipp Wich [Wed, 6 Dec 2017 14:54:11 +0000 (15:54 +0100)]
phase1: ccache.sh: fail on error

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase1: rename gpg signature files .gpg -> .asc
Alexander Couzens [Fri, 3 Mar 2017 00:27:34 +0000 (01:27 +0100)]
phase1: rename gpg signature files .gpg -> .asc

gnupg doesn't recognize .gpg files by it's extension.

> gpg --verify sha256sums.gpg
>> gpg: no signed data
>> gpg: can't hash datafile: No data

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
6 years agophase1: dumpinfo.pl: honour source-only flag for subtargets as well
Jo-Philipp Wich [Thu, 2 Nov 2017 14:39:34 +0000 (15:39 +0100)]
phase1: dumpinfo.pl: honour source-only flag for subtargets as well

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase1: remove automatic tagging support
Jo-Philipp Wich [Tue, 3 Oct 2017 13:16:18 +0000 (15:16 +0200)]
phase1: remove automatic tagging support

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase2: add hack to derive base feed url from buildroot
Jo-Philipp Wich [Tue, 3 Oct 2017 09:26:14 +0000 (11:26 +0200)]
phase2: add hack to derive base feed url from buildroot

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase2: prefer IPv4 for remote rsync operations
Jo-Philipp Wich [Tue, 22 Aug 2017 17:15:07 +0000 (19:15 +0200)]
phase2: prefer IPv4 for remote rsync operations

Various build slaves tend to have slow or unrelaible IPv6 connectivity
so instruct rsync to prefer IPv4 for file transfer.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agophase1: prefer IPv4 for remote rsync operations
Jo-Philipp Wich [Tue, 22 Aug 2017 17:14:23 +0000 (19:14 +0200)]
phase1: prefer IPv4 for remote rsync operations

Various build slaves tend to have slow or unrelaible IPv6 connectivity
so instruct rsync to prefer IPv4 for file transfer.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: do not perform shallow fetches
Jo-Philipp Wich [Thu, 16 Mar 2017 18:34:11 +0000 (19:34 +0100)]
phase1: do not perform shallow fetches

We do need the full history later on.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: fetch before checking out git branch
Jo-Philipp Wich [Tue, 14 Mar 2017 12:58:05 +0000 (13:58 +0100)]
phase1: fetch before checking out git branch

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase2: invoke feeds update with -f
Jo-Philipp Wich [Wed, 15 Feb 2017 09:08:23 +0000 (10:08 +0100)]
phase2: invoke feeds update with -f

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: update config.seed.example for the new CONFIG_BUILDBOT option
Felix Fietkau [Tue, 14 Feb 2017 13:20:42 +0000 (14:20 +0100)]
phase1: update config.seed.example for the new CONFIG_BUILDBOT option

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years agophase1: fix bad argument to MasterShellCommand()
Jo-Philipp Wich [Mon, 6 Feb 2017 13:03:43 +0000 (14:03 +0100)]
phase1: fix bad argument to MasterShellCommand()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: fix misspelled function name
Jo-Philipp Wich [Mon, 6 Feb 2017 13:03:05 +0000 (14:03 +0100)]
phase1: fix misspelled function name

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: prioritize tagged build requests
Jo-Philipp Wich [Mon, 6 Feb 2017 12:41:47 +0000 (13:41 +0100)]
phase1: prioritize tagged build requests

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase2: rely on rsync to merge updated SDK components
Jo-Philipp Wich [Mon, 6 Feb 2017 12:30:09 +0000 (13:30 +0100)]
phase2: rely on rsync to merge updated SDK components

Relying on the file modtime is unreliable so we cannot trust tar's
--keep-newer-files to properly overwrite changed SDK components.

Extract into a different directory instead and use rsync with checksum
mode to replace updated SDK files.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase2: stop build process on compile failures
Jo-Philipp Wich [Mon, 6 Feb 2017 12:27:26 +0000 (13:27 +0100)]
phase2: stop build process on compile failures

Do not proceed the build if package/compile failed in order to prevent
breaking the live repositories.

Since aborts in this phase usually happen due to out-of-space or other
unrecoverable issues, it makes no sense to continue processing the
partially finished build artifacts.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase2: increase package compilation timeout
Jo-Philipp Wich [Thu, 2 Feb 2017 17:27:34 +0000 (18:27 +0100)]
phase2: increase package compilation timeout

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: maketag.sh: write version and version.date files as well
Jo-Philipp Wich [Tue, 31 Jan 2017 08:18:59 +0000 (09:18 +0100)]
phase1: maketag.sh: write version and version.date files as well

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: fix workdir of maketag.sh step
Jo-Philipp Wich [Sun, 29 Jan 2017 16:51:33 +0000 (17:51 +0100)]
phase1: fix workdir of maketag.sh step

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: allow tag versions with rc designations
Jo-Philipp Wich [Sat, 28 Jan 2017 13:01:50 +0000 (14:01 +0100)]
phase1: allow tag versions with rc designations

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase2: --keep-newer-files and --no-overwrite-dir are exclusive
Jo-Philipp Wich [Fri, 27 Jan 2017 16:24:31 +0000 (17:24 +0100)]
phase2: --keep-newer-files and --no-overwrite-dir are exclusive

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: ccache.sh: also overwrite dangling symlinks
Jo-Philipp Wich [Tue, 24 Jan 2017 13:47:33 +0000 (14:47 +0100)]
phase1: ccache.sh: also overwrite dangling symlinks

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1/dumpinfo.pl: add a feature flag for skipping targets
Felix Fietkau [Tue, 24 Jan 2017 11:45:29 +0000 (12:45 +0100)]
phase1/dumpinfo.pl: add a feature flag for skipping targets

Also get rid of the uml special case

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years agophase1: fix GNU tar build target
Jo-Philipp Wich [Mon, 23 Jan 2017 14:15:09 +0000 (15:15 +0100)]
phase1: fix GNU tar build target

Recent buildroots do not have a dedicated tools/*/install target anymore.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: move ccache.sh invocation step as well
Jo-Philipp Wich [Mon, 23 Jan 2017 13:59:56 +0000 (14:59 +0100)]
phase1: move ccache.sh invocation step as well

The previous commit just moved the download step and not the actual invocation.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase2: set CCACHE_BASEDIR
Jo-Philipp Wich [Mon, 23 Jan 2017 13:25:38 +0000 (14:25 +0100)]
phase2: set CCACHE_BASEDIR

Add CCACHE_BASEDIR to make environment in order to improve cache hit rate for
the global shared cache.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: set CCACHE_BASEDIR
Jo-Philipp Wich [Mon, 23 Jan 2017 13:24:58 +0000 (14:24 +0100)]
phase1: set CCACHE_BASEDIR

Add CCACHE_BASEDIR to default environment in order to improve cache hit rate
for the global shared cache.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: move ccache preparation after defconfig
Jo-Philipp Wich [Mon, 23 Jan 2017 13:23:36 +0000 (14:23 +0100)]
phase1: move ccache preparation after defconfig

The ccache.sh helper script uses make targets to figure out staging_dir paths
which might trigger interactive menuconfig in case there is no populated
.config file yet, leading to command timeouts on fresh trees.

Move the ccache preparation step after defconfig in order to avoid triggering
menuconfig.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: ccache.sh: avoid creating nested symlink
Jo-Philipp Wich [Mon, 23 Jan 2017 13:21:41 +0000 (14:21 +0100)]
phase1: ccache.sh: avoid creating nested symlink

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1, phase2: add unified ccache handling
Jo-Philipp Wich [Sun, 22 Jan 2017 14:23:13 +0000 (15:23 +0100)]
phase1, phase2: add unified ccache handling

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: run package/cleanup before package/compile
Felix Fietkau [Sun, 22 Jan 2017 12:50:01 +0000 (13:50 +0100)]
phase1: run package/cleanup before package/compile

This is done by the full make run as well, and it cleans up
STAGING_DIR_ROOT/

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years agophase2: implement tree expiry, use CONFIG_AUTOREMOVE
Jo-Philipp Wich [Thu, 19 Jan 2017 02:14:02 +0000 (03:14 +0100)]
phase2: implement tree expiry, use CONFIG_AUTOREMOVE

 - Implement option to expire the build tree after it reached its maximum age
 - Enable the CONFIG_AUTOREMOVE feature to keep build_dir small
 - Do not clobber pre-existing SDK directory when extracting newer SDK

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1, phase2: reduce backlog size
Jo-Philipp Wich [Tue, 10 Jan 2017 18:59:32 +0000 (19:59 +0100)]
phase1, phase2: reduce backlog size

The build logs take up a lot of space and are relatively rarely needed,
so only keep logs for the last 20 builds and general info for the last
30 builds.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1: support to request specific CC / CXX versions
Jo-Philipp Wich [Sun, 8 Jan 2017 18:43:11 +0000 (19:43 +0100)]
phase1: support to request specific CC / CXX versions

In order to ensure the portability of the resulting SDK to a broad range of
systems, add support to request specific host compiler versions by overriding
the CC and CXX environment variables.

Also ship a script which aids in locating proper executables.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agophase1, phase2: use --progress for larger rsync uploads
Jo-Philipp Wich [Wed, 4 Jan 2017 12:57:29 +0000 (13:57 +0100)]
phase1, phase2: use --progress for larger rsync uploads

This avoids build step timeouts on slaves with weak connectivity to the
central rsync server.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>