From f7af3e723e5f9978a0de3ebce82b9f9072da302f Mon Sep 17 00:00:00 2001 From: Sandon Van Ness Date: Thu, 21 Nov 2013 15:21:19 -0800 Subject: [PATCH] Schedule-suite Use 'multi' tube for multiple types. Scheduling. Signed-off-by: Sandon Van Ness --- schedule_suite.sh | 10 +++++++++- teuthology/lock.py | 2 +- teuthology/task/internal.py | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/schedule_suite.sh b/schedule_suite.sh index 2f1c31b364c59..c71ec4f76fccb 100755 --- a/schedule_suite.sh +++ b/schedule_suite.sh @@ -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 diff --git a/teuthology/lock.py b/teuthology/lock.py index 7fdde6feb9845..82ad4331247ca 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -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): diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index 2455f6eadd6f7..554979d5c404b 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -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'): -- 2.39.5