buildbot update
cover buildbot update
Hi,
Goes on top of stefans update. Untested. Shoveling over some goodies from my local buildbot config.
https://github.com/kraxel/buildbot/tree/kraxel
(will create a pull req in a moment)
One question on the buildslave config (which isn't in the tree for security reasons): Do you have max_builds=1 in there, i.e. like this:
c['slaves'].append(BuildSlave("rhel6.xenb", "idonttellyoumypasswd", max_builds=1))
This makes sure buildbot runs at most a single build per buildslave, and I think this would make the slow_lock obsolete ...
cheers,
Gerd
Gerd Hoffmann (6):
add linebreaks to make create_build_factory more readable make tests configurable
fix out-of-tree build
use --disable-debug-info
save config.log
add log tail to failure reports
qemu-master.cfg | 58 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.9.7
PATCH 1/6 add linebreaks to make create_build_factory more readable
--- qemu-master.cfg | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
qemu-master.cfg +18 -6
@@ -681,17 +681,29 @@ from buildbot.steps.shell import Configure, Compile, ShellCommand, Test # test=None #) -def create_build_factory(repourl, branch="HEAD", make="make", configure_args=[], outoftree=False): +def create_build_factory(repourl, branch="HEAD", + make="make", configure_args=[], + outoftree=False): """Return a BuildFactory pre-configured with common build steps""" f = factory.BuildFactory() - f.addStep(Git(repourl=repourl, timeout=2400, mode='copy', retry=(5 * 60, 3), locks=repo_locks_from_url(repourl))) + f.addStep(Git(repourl=repourl, + timeout=2400, mode='copy', retry=(5 * 60, 3), + locks=repo_locks_from_url(repourl))) workdir = f.workdir if outoftree: - f.addStep(ShellCommand(command="mkdir -p outoftree", env={'LANG': 'C'})) + f.addStep(ShellCommand(command="mkdir -p outoftree", + env={'LANG': 'C'})) workdir = os.path.join(workdir, 'outoftree') - f.addStep(Configure(command=["./configure"] + list(configure_args), env={'LANG': 'C'}, workdir=workdir)) - f.addStep(Compile(command=[make, "CFLAGS=-O2"], env={'LANG': 'C'}, timeout=2400, workdir=workdir)) - f.addStep(Test(command=[make, "check"], env={'LANG': 'C'}, maxTime=2400, workdir=workdir)) + f.addStep(Configure(command=["./configure"] + list(configure_args), + env={'LANG': 'C'}, workdir=workdir)) + f.addStep(Compile(command=[make, "CFLAGS=-O2"], + env={'LANG': 'C'}, + timeout=2400, + workdir=workdir)) + f.addStep(Test(command=[make, "check"], + env={'LANG': 'C'}, + maxTime=2400, + workdir=workdir)) return f f_default = create_build_factory("git://git.qemu-project.org/qemu.git")
Signature · 1 line
1.7.9.7
PATCH 2/6 make tests configurable
In reply to Gerd Hoffmann--- qemu-master.cfg | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
qemu-master.cfg +6 -5
@@ -683,7 +683,7 @@ from buildbot.steps.shell import Configure, Compile, ShellCommand, Test def create_build_factory(repourl, branch="HEAD", make="make", configure_args=[], - outoftree=False): + outoftree=False, runtests=True): """Return a BuildFactory pre-configured with common build steps""" f = factory.BuildFactory() f.addStep(Git(repourl=repourl,
@@ -700,10 +700,11 @@ def create_build_factory(repourl, branch="HEAD", env={'LANG': 'C'}, timeout=2400, workdir=workdir)) - f.addStep(Test(command=[make, "check"], - env={'LANG': 'C'}, - maxTime=2400, - workdir=workdir)) + if runtests: + f.addStep(Test(command=[make, "check"], + env={'LANG': 'C'}, + maxTime=2400, + workdir=workdir)) return f f_default = create_build_factory("git://git.qemu-project.org/qemu.git")
Signature · 1 line
1.7.9.7
PATCH 3/6 fix out-of-tree build
In reply to Gerd Hoffmann--- qemu-master.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
qemu-master.cfg +3 -1
@@ -690,11 +690,13 @@ def create_build_factory(repourl, branch="HEAD", timeout=2400, mode='copy', retry=(5 * 60, 3), locks=repo_locks_from_url(repourl))) workdir = f.workdir + configure = "./configure" if outoftree: f.addStep(ShellCommand(command="mkdir -p outoftree", env={'LANG': 'C'})) workdir = os.path.join(workdir, 'outoftree') - f.addStep(Configure(command=["./configure"] + list(configure_args), + configure = "../configure" + f.addStep(Configure(command=[configure] + list(configure_args), env={'LANG': 'C'}, workdir=workdir)) f.addStep(Compile(command=[make, "CFLAGS=-O2"], env={'LANG': 'C'},
Signature · 1 line
1.7.9.7
PATCH 4/6 use --disable-debug-info
In reply to Gerd Hoffmann--- qemu-master.cfg | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
qemu-master.cfg +4 -2
@@ -696,9 +696,11 @@ def create_build_factory(repourl, branch="HEAD", env={'LANG': 'C'})) workdir = os.path.join(workdir, 'outoftree') configure = "../configure" - f.addStep(Configure(command=[configure] + list(configure_args), + f.addStep(Configure(command=[configure, + "--disable-debug-info"] + + list(configure_args), env={'LANG': 'C'}, workdir=workdir)) - f.addStep(Compile(command=[make, "CFLAGS=-O2"], + f.addStep(Compile(command=[make], env={'LANG': 'C'}, timeout=2400, workdir=workdir))
Signature · 1 line
1.7.9.7
PATCH 5/6 save config.log
In reply to Gerd Hoffmann--- qemu-master.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
qemu-master.cfg +3 -1
@@ -699,7 +699,9 @@ def create_build_factory(repourl, branch="HEAD", f.addStep(Configure(command=[configure, "--disable-debug-info"] + list(configure_args), - env={'LANG': 'C'}, workdir=workdir)) + env={'LANG': 'C'}, + logfiles={"config.log": "config.log"}, + workdir=workdir)) f.addStep(Compile(command=[make], env={'LANG': 'C'}, timeout=2400,
Signature · 1 line
1.7.9.7
PATCH 6/6 add log tail to failure reports
In reply to Gerd Hoffmann--- qemu-master.cfg | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
qemu-master.cfg +27 -0
@@ -45,6 +45,32 @@ emailAddressesNotify = ["[email protected]", "[email protected]", "agraf@ ####### STATUS TARGETS +def logtailMessageFormatter(mode, name, build, results, master_status): + result = Results[results] + defmsg = mail.defaultMessage(mode, name, build, results, master_status); + text = list(); + text.append(defmsg['body']); + + # get log for last step + logs = build.getLogs() + for log in reversed(logs): + if log.getName() == 'stdio': + break + content = log.getText().splitlines() # Note: can be VERY LARGE + url = "%s/steps/%s/logs/%s" % (master_status.getURLForThing(build), + log.getStep().getName(), + log.getName()) + + # append log info to standard message + text.append("========== log tail ==========") + for line in content[-32:]: + text.append(unicode(line,'utf8')) + text.append("") + text.append("========== full log ==========") + text.append(url); + + return { 'body' : "\n".join(text), 'type' : 'plain' } + c['status'] = [] from buildbot.status import html
@@ -57,6 +83,7 @@ c['status'].append( fromaddr=emailAddressFrom, mode='problem', # only send mail about a build which failed when the previous build passed extraRecipients=emailAddressesNotify, + messageFormatter=logtailMessageFormatter, sendToInterestedUsers=False ) )
Signature · 1 line
1.7.9.7