From 5f9a1d8a0facc0cc46433c8923a28b04938136b7 Mon Sep 17 00:00:00 2001 From: Sandon Van Ness Date: Thu, 18 Jul 2013 12:04:08 -0700 Subject: [PATCH] Worker processes by machine type instead of teuthology branch. teuthology-suite and schedulewill now take --worker instead of --branch. The branch is set by setting teuthology_branch in the yaml used to schedule the job. The teuthology branches are assumed to be in ~/teuthology-$branch of whatever user is running the workers. --- schedule_suite.sh | 3 ++- teuthology/queue.py | 12 ++++++++---- teuthology/run.py | 10 ++++------ teuthology/suite.py | 8 ++++---- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/schedule_suite.sh b/schedule_suite.sh index 8963b2882e..57dbc182e7 100755 --- a/schedule_suite.sh +++ b/schedule_suite.sh @@ -56,6 +56,7 @@ echo "teuthology branch $teuthology_branch" fn="/tmp/schedule.suite.$$" trap "rm $fn" EXIT cat < $fn +teuthology_branch: $teuthology_branch kernel: kdb: true sha1: $KERNEL_SHA1 @@ -119,4 +120,4 @@ echo "name $name" --email $email \ --timeout 36000 \ --name $name \ - --branch $teuthology_branch + --worker $mtype diff --git a/teuthology/queue.py b/teuthology/queue.py index 39363c2ff8..d0ad70a09a 100644 --- a/teuthology/queue.py +++ b/teuthology/queue.py @@ -81,11 +81,15 @@ describe. One job is run at a time. log.debug('Config is: %s', job.body) job_config = yaml.safe_load(job.body) safe_archive = safepath.munge(job_config['name']) + teuthology_branch=job_config.get('config').get('teuthology_branch', 'master') + teuth_path = os.path.join(os.getenv("HOME"), 'teuthology-' + teuthology_branch, 'virtualenv', 'bin') + if not os.path.isdir(teuth_path): + raise Exception('Teuthology branch ' + teuthology_branch + ' not found at ' + teuth_path) if job_config.get('last_in_suite', False): log.debug('Generating coverage for %s', job_config['name']) args = [ - os.path.join(os.path.dirname(sys.argv[0]), 'teuthology-results'), + os.path.join(teuth_path, 'teuthology-results'), '--timeout', str(job_config.get('results_timeout', 21600)), '--email', @@ -101,12 +105,12 @@ describe. One job is run at a time. safepath.makedirs(ctx.archive_dir, safe_archive) archive_path = os.path.join(ctx.archive_dir, safe_archive, str(job.jid)) log.info('Running job %d', job.jid) - run_job(job_config, archive_path) + run_job(job_config, archive_path, teuth_path) job.delete() -def run_job(job_config, archive_path): +def run_job(job_config, archive_path, teuth_path): arg = [ - os.path.join(os.path.dirname(sys.argv[0]), 'teuthology'), + os.path.join(teuth_path, 'teuthology'), ] if job_config['verbose']: diff --git a/teuthology/run.py b/teuthology/run.py index f5dc5d1d73..1d0c12808f 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -264,9 +264,9 @@ def schedule(): help='be more verbose', ) parser.add_argument( - '-b', '--branch', - default='master', - help='which branch of teuthology to use', + '-w', '--worker', + default='plana', + help='which worker to use (type of machine)', ) parser.add_argument( '-s', '--show', @@ -289,9 +289,7 @@ def schedule(): import teuthology.queue beanstalk = teuthology.queue.connect(ctx) - tube = 'teuthology' - if ctx.branch != 'master': - tube += '-' + ctx.branch + tube=ctx.worker beanstalk.use(tube) if ctx.show: diff --git a/teuthology/suite.py b/teuthology/suite.py index 6ae30ff3ab..36c7d7ddd7 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -71,9 +71,9 @@ combination, and will override anything in the suite. help='number of times to run/queue each job' ) parser.add_argument( - '-b', '--branch', - default='master', - help='which branch of teuthology to use', + '-w', '--worker', + default='plana', + help='which worker to use (type of machine)', ) parser.add_argument( 'config', @@ -97,7 +97,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, + '--worker', args.worker, ] if args.verbose: base_arg.append('-v') -- 2.39.5