]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Worker processes by machine type instead of teuthology branch.
authorSandon Van Ness <sandon@inktank.com>
Thu, 18 Jul 2013 19:04:08 +0000 (12:04 -0700)
committerSandon Van Ness <sandon@inktank.com>
Thu, 18 Jul 2013 19:04:08 +0000 (12:04 -0700)
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
teuthology/queue.py
teuthology/run.py
teuthology/suite.py

index 8963b2882e61aafa1da6029622e96579e627f5c0..57dbc182e75a5e60cf32461328dd8b5bc5bfeb53 100755 (executable)
@@ -56,6 +56,7 @@ echo "teuthology branch $teuthology_branch"
 fn="/tmp/schedule.suite.$$"
 trap "rm $fn" EXIT
 cat <<EOF > $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
index 39363c2ff8aa594b3389ddef2ca575680a26f3e7..d0ad70a09a8902c7baec07a6ff469afa9d9bd573 100644 (file)
@@ -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']:
index f5dc5d1d73415e363b85ed765b826bfd91178f90..1d0c12808fef2673260a214efa908808c9896828 100644 (file)
@@ -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:
index 6ae30ff3abb26285547b30063bdad5be769a5132..36c7d7ddd7e9e3246d4674980bfda4dd336060f8 100644 (file)
@@ -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')