From a09153b6886cd5b33c90427721350ba56d1e6327 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Fri, 21 Sep 2012 14:54:19 -0700 Subject: [PATCH] Allow scheduled jobs to use different teuthology branches teuthology-[schedule|suite] get a parameter to specify the branch, to put the job in a branch-specific queue. Workers running that branch of teuthology can pull jobs from that queue. Signed-off-by: Josh Durgin --- schedule_suite.sh | 11 +++++++++-- teuthology/queue.py | 7 ++++++- teuthology/run.py | 10 +++++++++- teuthology/suite.py | 6 ++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/schedule_suite.sh b/schedule_suite.sh index 48299e63eb6..4e3145808d8 100755 --- a/schedule_suite.sh +++ b/schedule_suite.sh @@ -69,9 +69,16 @@ fi stamp=`date +%Y-%m-%d_%H:%M:%S` name=`whoami`"-$stamp-$suite-$ceph-$kernel-$flavor" +if wget http://github.com/ceph/teuthology/tree/$ceph -O- 2>/dev/null ; then + teuthology_branch=$ceph +else + echo "branch $ceph not in teuthology.git; will use master for teuthology" + teuthology_branch='master' +fi + ~/src/teuthology/virtualenv/bin/teuthology-suite -v $fn \ --collections ~/src/ceph-qa-suite/suites/$suite/* \ --email $email \ --timeout 21600 \ - --name $name - + --name $name \ + --branch $teuthology_branch diff --git a/teuthology/queue.py b/teuthology/queue.py index 1f5d2da5e07..f33f03818eb 100644 --- a/teuthology/queue.py +++ b/teuthology/queue.py @@ -38,6 +38,11 @@ describe. One job is run at a time. help='path in which to store logs', required=True, ) + parser.add_argument( + '-t', '--tube', + help='which beanstalk tube to read jobs from', + required=True, + ) ctx = parser.parse_args() @@ -62,7 +67,7 @@ describe. One job is run at a time. read_config(ctx) beanstalk = connect(ctx) - beanstalk.watch('teuthology') + beanstalk.watch(ctx.tube) beanstalk.ignore('default') while True: diff --git a/teuthology/run.py b/teuthology/run.py index 3ebd2af5414..89edb3a7dad 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -228,6 +228,11 @@ def schedule(): default=False, help='be more verbose', ) + parser.add_argument( + '-b', '--branch', + default='master', + help='which branch of teuthology to use', + ) ctx = parser.parse_args() if not ctx.last_in_suite: @@ -242,7 +247,10 @@ def schedule(): import teuthology.queue beanstalk = teuthology.queue.connect(ctx) - beanstalk.use('teuthology') + tube = 'teuthology' + if ctx.branch != 'master': + tube += '-' + ctx.branch + beanstalk.use(tube) if ctx.delete: for jobid in ctx.delete: diff --git a/teuthology/suite.py b/teuthology/suite.py index 73386d8a851..09a7e0c8dbf 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -65,6 +65,11 @@ combination, and will override anything in the suite. type=int, help='number of times to run/queue each job' ) + parser.add_argument( + '-b', '--branch', + default='master', + help='which branch of teuthology to use', + ) parser.add_argument( 'config', metavar='CONFFILE', @@ -87,6 +92,7 @@ combination, and will override anything in the suite. os.path.join(os.path.dirname(sys.argv[0]), 'teuthology-schedule'), '--name', args.name, '--num', str(args.num), + '--branch', args.branch, ] if args.verbose: base_arg.append('-v')