• Home
  • Raw
  • Download

Lines Matching full:pool

6 """Adjust pool balances to cover DUT shortfalls.
8 This command takes all broken DUTs in a specific pool for specific
9 models and swaps them with working DUTs taken from a selected pool
12 pool sizes, or to create or remove pools.
14 usage: balance_pool.py [ options ] POOL MODEL [ MODEL ... ]
17 POOL Name of the pool to balance
23 Set the number of DUTs in the pool to the specified
26 Add the specified number of DUTs to the pool for every
29 Remove the specified number of DUTs from the pool for
31 -s POOL, --spare POOL
32 Pool from which to draw replacement spares (default:
33 pool:suites)
35 Phase to restrict the balance pool operation to
40 The command attempts to remove all broken DUTs from the target POOL
42 from the spare pool to bring the strength of POOL to the requested
47 DUTs for every MODEL in the target POOL.
50 in the pool to keep the pool at the target COUNT.
52 When reducing pool size, working DUTs will be returned after broken
87 # _VALID_POOL_PATTERN - Regular expression matching pool names that will
90 # Note: This pattern was selected merely to recognize all existing pool
157 """Information about a pool of DUTs matching given labels.
159 This class collects information about all DUTs for a given pool and matching
163 + Ineligible - the DUT is not available to be removed from this pool. The
166 DUTs with more than one pool: label are ineligible for exchange
168 which must always be assigned to pool:suites. These DUTs are
169 always marked with pool:chameleon to prevent their reassignment.
171 TODO(jrbarnette): The use of `pool:chamelon` (instead of just
178 @property pool Name of the pool associated with
179 this pool of DUTs.
181 @property working_hosts The list of this pool's working DUTs.
182 @property broken_hosts The list of this pool's broken DUTs.
183 @property ineligible_hosts The list of this pool's ineligible DUTs.
185 of this pool.
186 @property total_hosts The total number of hosts in pool.
190 def __init__(self, afe, pool, labels, start_time, end_time): argument
191 self.pool = pool
193 self.labels['pool'] = pool
194 self._pool_labels = [_POOL_PREFIX + self.pool]
223 """Return the AFE labels that identify this pool.
226 to remove a DUT from the pool, or added to add a DUT.
250 @param target_total The new target pool size.
259 'True for each pool/model which requests more DUTs than supplied',
264 ts_mon.StringField('pool'),
270 'pool': self.pool,
277 '%s pool (%s): Target of %d is below minimum of %d DUTs.',
278 self.pool, self.labels, target_total, num_ineligible,
283 _log_message('%s %s pool: Target of %d is above minimum.',
284 self.labels.get('model', ''), self.pool, target_total)
292 reduce this pool's supply. Broken DUTs will be preferred
296 DUTs to be left in the pool. If this number exceeds the
297 number of broken DUTs actually in the pool, the returned
303 this pool.
317 """Reassign a list of DUTs from one pool to another.
335 len(hosts), spare_pool.pool, target_pool.pool)
353 'source_pool': spare_pool.pool,
354 'target_pool': target_pool.pool,
374 def _balance_model(arguments, afe, pool, labels, start_time, end_time): argument
379 @param pool Pool of the model to be balanced.
389 main_pool = _DUTPool(afe, pool, labels, start_time, end_time)
413 _log_info(dry_run, 'Balancing %s %s pool:', labels, main_pool.pool)
420 add_msg = 'grow pool by %d DUTs' % spares_needed
422 add_msg = 'shrink pool by %d DUTs' % -spares_needed
424 add_msg = 'no change to pool size'
429 '%s %s pool has %d spares available for balancing pool %s',
430 labels, spare_pool.pool, len(spare_pool.working_hosts),
431 main_pool.pool)
438 '%s %s pool will return %d broken DUTs, '
439 'leaving %d still in the pool.',
440 labels, main_pool.pool,
445 '%s %s pool will return %d surplus DUTs, '
447 labels, main_pool.pool,
453 _log_error('%s %s pool: Refusing to act on pool with %d broken DUTs.',
454 labels, main_pool.pool, len(main_pool.broken_hosts))
487 description='Balance pool shortages from spares on reserve')
497 'pool to the specified count for '
502 'to the pool for every MODEL')
506 'from the pool for every MODEL')
509 metavar='POOL',
510 help='Pool from which to draw replacement '
511 'spares (default: pool:%s)' % _SPARE_DEFAULT)
521 help='Only rebalance a pool if it has at most '
524 help='Forcefully rebalance all DUTs in a pool, even '
543 'DUTs in the specified pool is less than COUNT.',
546 parser.add_argument('pool',
547 metavar='POOL',
548 help='Name of the pool to balance. Use %s to balance '
566 if (arguments.pool == _ALL_CRITICAL_POOLS and
568 parser.error('Cannot specify --spare pool to be %s when balancing all '
570 for p in (arguments.spare, arguments.pool):
572 parser.error('Invalid pool name: %s' % p)
589 for pool in pools:
592 for model in inventory.get_pool_models(pool):
597 balancer_targets.append((pool, labels.getlabels()))
606 balancer_targets.append((pool, labels.getlabels()))
629 def balancer(pool, labels): argument
632 @param pool: The pool to rebalance for the model.
636 _balance_model(arguments, afe, pool, labels,
641 if arguments.pool == _ALL_CRITICAL_POOLS
642 else [arguments.pool])