]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Schedule-suite Use 'multi' tube for multiple types. Scheduling.
authorSandon Van Ness <sandon@inktank.com>
Thu, 21 Nov 2013 23:21:19 +0000 (15:21 -0800)
committerSandon Van Ness <sandon@inktank.com>
Thu, 21 Nov 2013 23:21:19 +0000 (15:21 -0800)
Signed-off-by: Sandon Van Ness <sandon@inktank.com>
schedule_suite.sh
teuthology/lock.py
teuthology/task/internal.py

index 2f1c31b364c5974b29d44328b40423820bf546e4..c71ec4f76fccb8cbfb2c32346d736fcf6a63657c 100755 (executable)
@@ -27,6 +27,14 @@ fi
 [ -z "$distro" ] && distro='ubuntu'
 [ -z "$mtype" ] && mtype='plana'
 
+multi=`echo $mtype | awk -F' |,|-|\t' '{print NF}'`
+if [ $multi -gt 1 ]
+then
+    tube=multi
+else
+    tube=$mtype
+fi
+
 stamp=`date +%Y-%m-%d_%H:%M:%S`
 nicesuite=`echo $suite | sed 's/\//:/g'`
 name=`whoami`"-$stamp-$nicesuite-$ceph-$kernel-$flavor-$mtype"
@@ -172,4 +180,4 @@ echo "name $name"
     --email $email \
     --timeout 36000 \
     --name $name \
-    --worker $mtype
+    --worker $tube
index 7fdde6feb9845fdea70c2dfdc20ff64ba043bde0..82ad4331247cacd4c5cd79040b0b42d9b95bf4d4 100644 (file)
@@ -39,7 +39,7 @@ def lock_many(ctx, num, machinetype, user=None, description=None):
             machines = json.loads(content)
             log.debug('locked {machines}'.format(
                 machines=', '.join(machines.keys())))
-            if machine_type == 'vps':
+            if machinetype == 'vps':
                 ok_machs = {}
                 for machine in machines:
                     if create_if_vm(ctx, machine):
index 2455f6eadd6f7e667801dd19d6bd1e49110d53f5..554979d5c404b8ac51b11d04b603e021bdfd42fc 100644 (file)
@@ -52,6 +52,7 @@ def lock_machines(ctx, config):
     log.info('Locking machines...')
     assert isinstance(config[0], int), 'config[0] must be an integer'
     machine_type = config[1]
+    machine_types = teuthology.get_multi_machine_types(machine_type)
     how_many = config[0]
 
     while True:
@@ -65,12 +66,12 @@ def lock_machines(ctx, config):
             else:
                 assert 0, 'error listing machines'
 
-        is_up = lambda machine: machine['up'] and machine['type'] == machine_type  # noqa
+        is_up = lambda machine: machine['up'] and machine['type'] in machine_types  # noqa
         num_up = len(filter(is_up, machines))
         assert num_up >= how_many, 'not enough machines are up'
 
         # make sure there are machines for non-automated jobs to run
-        is_up_and_free = lambda machine: machine['up'] and machine['locked'] == 0 and machine['type'] == machine_type  # noqa
+        is_up_and_free = lambda machine: machine['up'] and machine['locked'] == 0 and machine['type'] in machine_types  # noqa
         up_and_free = filter(is_up_and_free, machines)
         num_free = len(up_and_free)
         if num_free < 6 and ctx.owner.startswith('scheduled'):