mirror of
https://github.com/ceph/ceph
synced 2025-02-05 18:03:54 +00:00
Schedule-suite Use 'multi' tube for multiple types. Scheduling.
Signed-off-by: Sandon Van Ness <sandon@inktank.com>
This commit is contained in:
parent
c38eeec85f
commit
f7af3e723e
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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'):
|
||||
|
Loading…
Reference in New Issue
Block a user