From 91b8790cc785036b2d48a10df3d8b8c2632f1f23 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 25 May 2011 00:02:33 -0400 Subject: [PATCH] Move the buildbot workdirs to a non-volatile directory /tmp/ is a good directory for throwing temporary things, but not so good for things you want to keep around for a relatively long time. Especially on Ubuntu, which has a default policy of deleting files in /tmp/ on reboot - meaning that the git repos that form the basis of the repository have all of their files wiped - greatly confusing the buildbot, which tries to run 'git reset --head' in an empty directory and fails miserably in that situation. So - ensure that WORKDIR is set to something that exists and which will exist for the duration of your CI server, and you'll be all right. Signed-off-by: Dan Scott --- examples/buildbot.cfg | 9 +++++++-- src/perl/lib/OpenSRF/Utils/Cache.pm | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/buildbot.cfg b/examples/buildbot.cfg index d2d74c3..c2a980c 100644 --- a/examples/buildbot.cfg +++ b/examples/buildbot.cfg @@ -8,6 +8,11 @@ # a shorter alias to save typing. c = BuildmasterConfig = {} +# WORKDIR must be an absolute path that is not volatile; systems +# like Ubuntu wipe /tmp/ on a reboot, for example, which is +# disastrous for build history, at least for gitpoller +WORKDIR = '/home/buildmaster/' + ####### BUILDSLAVES # The 'slaves' list defines the set of recognized buildslaves. Each element is @@ -50,7 +55,7 @@ for osrf_branch in OSRF_BRANCHES: c['change_source'].append(gitpoller.GitPoller( project='OpenSRF', repourl=osrf_git, - workdir='/tmp/buildbot_osrf_' + osrf_branch, + workdir= WORKDIR + 'buildbot_osrf_' + osrf_branch, branch=osrf_branch )) @@ -58,7 +63,7 @@ for eg_branch in EG_BRANCHES: c['change_source'].append(gitpoller.GitPoller( project='Evergreen', repourl=eg_git, - workdir='/tmp/buildbot_eg_' + eg_branch, + workdir= WORKDIR + 'buildbot_eg_' + eg_branch, branch=eg_branch )) diff --git a/src/perl/lib/OpenSRF/Utils/Cache.pm b/src/perl/lib/OpenSRF/Utils/Cache.pm index 1fb56a4..b7344d2 100644 --- a/src/perl/lib/OpenSRF/Utils/Cache.pm +++ b/src/perl/lib/OpenSRF/Utils/Cache.pm @@ -94,6 +94,9 @@ sub new { $self->{persist} = $persist || 0; $self->{memcache} = Cache::Memcached->new( { servers => $servers } ); if(!$self->{memcache}) { + open(CACHEFOO, '>', '/tmp/cached'); + print CACHEFOO "De nada\n"; + close(CACHEFOO); throw OpenSRF::EX::PANIC ("Unable to create a new memcache object for $cache_type"); } -- 2.11.0