From 7fabb26b632e65e4a26efd1d78c62e17c10d32cd Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Wed, 28 Feb 2018 21:58:18 +0000 Subject: [PATCH] builders: use yocto-autobuilder-helper's clobberdir script Removing the build directory (with rm -fr) can take a significant amount of time, longer than the standard buildbot timeout, which delays the builds. Instead, we use the clobberdir script from the helper repository. This script moves the directory contents out of the way to a location which is reaped by a background process. Unfortunately this assumes/requires a copy of the repository is kept in the home directory of the user running buildbot. Signed-off-by: Joshua Lock --- TODO | 2 +- builders.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 280b633..1cdcd2c 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,7 @@ # Future * add mail notification functionality to yocto-autobuilder-helper, it already knows how to iterate error reports. -* Move clobber script, janitor, etc into yocto-autobuilder-helper and make use of them +* Make use of janitor script from yocto-autobuilder-helper * Simple script to start buildbot controller, janitor and PRServer * Review ForceScheduler inputs and whether they are used by the helper scripts, particularly the poky_number parameter of nightly is possibly no longer required * Teach the janitor to pre-clone the repos diff --git a/builders.py b/builders.py index 6b7e0da..22c86f8 100644 --- a/builders.py +++ b/builders.py @@ -41,9 +41,11 @@ def ensure_props_set(props): def create_builder_factory(): f = util.BuildFactory() - # FIXME: use RP's script + # NOTE: Assumes that yocto-autobuilder repo has been cloned to home + # directory of the user running buildbot. + clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir") f.addStep(steps.ShellCommand( - command=["rm", "-fr", util.Interpolate("%(prop:builddir)s/")], + command=[clob, util.Interpolate("%(prop:builddir)s/")], name="Clobber build dir")) f.addStep(steps.Git( repourl='git://git.yoctoproject.org/yocto-autobuilder-helper', @@ -86,9 +88,11 @@ for builder in config.triggered_builders: factory=f)) factory = util.BuildFactory() -# FIXME: use RP's script -factory.addStep(steps.ShellCommand( - command=["rm", "-fr", util.Interpolate("%(prop:builddir)s/")], +# NOTE: Assumes that yocto-autobuilder repo has been cloned to home +# directory of the user running buildbot. +clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir") +f.addStep(steps.ShellCommand( + command=[clob, util.Interpolate("%(prop:builddir)s/")], name="Clobber build dir")) # check out the source factory.addStep(steps.Git(