| OLD | NEW |
| 1 # -*- python -*- | 1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 # ex: set syntax=python: | |
| 3 | |
| 4 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 5 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 7 | 4 |
| 8 builder_hostname_map = { | 5 import chromiumos_board_config |
| 9 'amd64-generic ASAN': ['build84-m2'], | |
| 10 'amd64-generic paladin': ['build141-m2'], | |
| 11 'amd64-generic_freon paladin': ['build182-m2'], | |
| 12 'amd64-generic full': ['build90-m2'], | |
| 13 'amd64-generic incremental': ['build86-m2'], | |
| 14 'arm-generic paladin': ['build263-m2'], | |
| 15 'arm-generic full': ['build92-m2'], | |
| 16 'daisy incremental': ['build87-m2'], | |
| 17 'daisy full': ['build91-m2'], | |
| 18 'gizmo paladin': ['build118-m2'], | |
| 19 'mipsel-o32-generic paladin': ['build112-m2'], | |
| 20 'mipsel-o32-generic full': ['build93-m2'], | |
| 21 'panther_embedded-minimal paladin': ['build203-m2'], | |
| 22 'x86-generic ASAN': ['build94-m2'], | |
| 23 'x86-generic paladin': ['build174-m2'], | |
| 24 'x86-generic incremental': ['build85-m2'], | |
| 25 'x86-generic full': ['build89-m2'], | |
| 26 'chromiumos sdk': ['build162-m2'], # Should stay on a faster machine | |
| 27 'refresh packages (chromium:412795)': ['build94-m2'], | |
| 28 } | |
| 29 | 6 |
| 30 hostname_builder_map = {} | 7 from common.cros_chromite import SlaveType |
| 31 for builder, hostnames in builder_hostname_map.iteritems(): | 8 |
| 32 for hostname in hostnames: | 9 # Use the SlaveAlloctor declared in 'board_config'. |
| 33 hostname_builder_map.setdefault(hostname, []).append(builder) | 10 sa = chromiumos_board_config.slave_allocator |
| 11 sa.LoadState(enforce=False) |
| 12 |
| 13 # Baremetal slaves (e.g., build123-m2) |
| 14 sa.AddPool(SlaveType.BAREMETAL, *('build%s-m2' % (number,) for number in ( |
| 15 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 94, 112, 118, 141, 162, 174, 182, |
| 16 203, 263, |
| 17 ))) |
| 18 |
| 19 for board_config in chromiumos_board_config.builder_configs.itervalues(): |
| 20 name = board_config.config.name |
| 21 sa.Join( |
| 22 name, |
| 23 sa.Alloc( |
| 24 'builder', |
| 25 pools=[SlaveType.BAREMETAL], |
| 26 exclusive=False, |
| 27 subtype=name)) |
| 28 |
| 29 def GenSlave(hostname, config_names): |
| 30 return { |
| 31 'master': 'ChromiumOS', |
| 32 'builder': [chromiumos_board_config.builder_configs[c].builder_name |
| 33 for c in config_names], |
| 34 'hostname': str(hostname), |
| 35 'os': 'linux', |
| 36 'version': 'precise', |
| 37 } |
| 34 | 38 |
| 35 slaves = [] | 39 slaves = [] |
| 36 for hostname, builders in hostname_builder_map.iteritems(): | 40 slave_map = sa.GetSlaveMap() |
| 37 slaves.append({'master': 'ChromiumOS', | 41 for hostname, entry in slave_map.entries.iteritems(): |
| 38 'builder': builders, | 42 slaves.append(GenSlave(hostname, entry.keys)) |
| 39 'hostname': hostname, | |
| 40 'os': 'linux', | |
| 41 'version': 'precise'}) | |
| OLD | NEW |