| OLD | NEW |
| 1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 # 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 |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import chromiumos_board_config | 5 import chromiumos_board_config |
| 6 | 6 |
| 7 from common.cros_chromite import ChromiteTarget | 7 from common.cros_chromite import ChromiteTarget |
| 8 from common.cros_chromite import SlaveType | 8 from common.cros_chromite import SlaveType |
| 9 | 9 |
| 10 # Use the SlaveAlloctor declared in 'board_config'. | 10 # Use the SlaveAlloctor declared in 'board_config'. |
| 11 sa = chromiumos_board_config.slave_allocator | 11 sa = chromiumos_board_config.slave_allocator |
| 12 sa.LoadState(enforce=False) | 12 sa.LoadState(enforce=False) |
| 13 | 13 |
| 14 def shared(slave_type): | 14 def shared(slave_type): |
| 15 return '%s_shared' % (slave_type,) | 15 return '%s_shared' % (slave_type,) |
| 16 | 16 |
| 17 # Baremetal slaves | 17 # Baremetal slaves |
| 18 sa.AddPool(SlaveType.BAREMETAL, *('build%s-m2' % (n,) for n in set([ | 18 sa.AddPool(SlaveType.BAREMETAL, *('build%s-m2' % (n,) for n in set([ |
| 19 85, 86, 87, 92, 112, 162, 174, 182, 203, 257, 263, 323, 326, | 19 85, 86, 87, 92, 112, 162, 174, 182, 203, 257, 258, 317, 263, 323, 326, |
| 20 333, |
| 20 ]) - set([ | 21 ]) - set([ |
| 21 # Decommissioned slaves (please include bug so we can re-include when Fixed). | 22 # Decommissioned slaves (please include bug so we can re-include when Fixed). |
| 22 91, # crbug.com/606427 | 23 91, # crbug.com/606427 |
| 23 257, # crbug.com/635304 | 24 257, # crbug.com/635304 |
| 24 ]))) | 25 ]))) |
| 25 | 26 |
| 26 # GCE slaves | 27 # GCE slaves |
| 27 sa.AddPool(SlaveType.GCE, *('cros%s-c2' % (n,) for n in ( | 28 sa.AddPool(SlaveType.GCE, *('cros%s-c2' % (n,) for n in ( |
| 28 199, | 29 199, |
| 29 ))) | 30 ))) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 50 subtype=name)) | 51 subtype=name)) |
| 51 else: | 52 else: |
| 52 sa.Join( | 53 sa.Join( |
| 53 name, | 54 name, |
| 54 sa.Alloc( | 55 sa.Alloc( |
| 55 'builder', | 56 'builder', |
| 56 pools=[board_config.slave_type], | 57 pools=[board_config.slave_type], |
| 57 exclusive=True, | 58 exclusive=True, |
| 58 subtype=name)) | 59 subtype=name)) |
| 59 | 60 |
| 61 # If the board requires a floating builder, add that. |
| 62 if board_config.floating: |
| 63 sa.Join( |
| 64 name, |
| 65 sa.Alloc( |
| 66 'floating', |
| 67 subtype=board_config.config.category, |
| 68 pools=[board_config.slave_type], |
| 69 count=board_config.floating, |
| 70 exclusive=True)) |
| 71 |
| 60 def GenSlave(hostname, config_names): | 72 def GenSlave(hostname, config_names): |
| 61 return { | 73 return { |
| 62 'master': 'ChromiumOS', | 74 'master': 'ChromiumOS', |
| 63 'builder': [chromiumos_board_config.builder_configs[c].builder_name | 75 'builder': [chromiumos_board_config.builder_configs[c].builder_name |
| 64 for c in config_names], | 76 for c in config_names], |
| 65 'hostname': str(hostname), | 77 'hostname': str(hostname), |
| 66 'os': 'linux', | 78 'os': 'linux', |
| 67 'version': 'precise', | 79 'version': 'precise', |
| 68 } | 80 } |
| 69 | 81 |
| 70 slaves = [] | 82 slaves = [] |
| 71 slave_map = sa.GetSlaveMap() | 83 slave_map = sa.GetSlaveMap() |
| 72 for hostname, entry in slave_map.entries.iteritems(): | 84 for hostname, entry in slave_map.entries.iteritems(): |
| 73 slaves.append(GenSlave(hostname, entry.keys)) | 85 slaves.append(GenSlave(hostname, entry.keys)) |
| OLD | NEW |