| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 # vim: set ft=python: | 4 # vim: set ft=python: |
| 5 | 5 |
| 6 from buildbot.changes import svnpoller | 6 from buildbot.changes import svnpoller |
| 7 from buildbot.scheduler import Dependent | 7 from buildbot.scheduler import Dependent |
| 8 from buildbot.scheduler import Scheduler | |
| 9 from buildbot.scheduler import Triggerable | |
| 10 | 8 |
| 11 from common import chromium_utils | 9 from common import chromium_utils |
| 12 | 10 |
| 13 from master import build_utils | 11 from master import build_utils |
| 14 from master import master_config | 12 from master import master_config |
| 15 from master import master_utils | 13 from master import master_utils |
| 14 from master import recipe_master_helper |
| 16 from master import slaves_list | 15 from master import slaves_list |
| 17 from master.factory import annotator_factory | 16 from master.factory import annotator_factory |
| 18 from master.factory import chromium_factory | 17 from master.factory import chromium_factory |
| 19 | 18 |
| 20 import collections | 19 import collections |
| 21 import config | 20 import config |
| 22 import master_site_config | 21 import master_site_config |
| 23 | 22 |
| 24 ActiveMaster = master_site_config.ChromiumGPU | 23 ActiveMaster = master_site_config.ChromiumGPU |
| 25 | 24 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 # Load the slave list. We need some information from it in order to | 63 # Load the slave list. We need some information from it in order to |
| 65 # produce the builders. | 64 # produce the builders. |
| 66 slaves = slaves_list.SlavesList('slaves.cfg', 'ChromiumGPU') | 65 slaves = slaves_list.SlavesList('slaves.cfg', 'ChromiumGPU') |
| 67 | 66 |
| 68 ####### SCHEDULERS | 67 ####### SCHEDULERS |
| 69 | 68 |
| 70 ## configure the Schedulers | 69 ## configure the Schedulers |
| 71 | 70 |
| 72 # Main scheduler for all changes in trunk. | 71 # Main scheduler for all changes in trunk. |
| 73 | 72 |
| 74 polling_builders = [] | 73 trigger_name_map = recipe_master_helper.AddSchedulersAndTriggers( |
| 75 # Maps the parent builder to a set of the names of the builders it triggers. | 74 buildmaster_config=c, slave_list=slaves, scheduler_name='gpu', branch='src') |
| 76 trigger_map = collections.defaultdict(list) | |
| 77 # Maps the name of the parent builder to the (synthesized) name of its | |
| 78 # trigger, wrapped in a list. | |
| 79 trigger_name_map = {} | |
| 80 next_group_id = 0 | |
| 81 for slave in slaves.slaves: | |
| 82 builder = slave['builder'] | |
| 83 parent_builder = slave.get('triggered_by') | |
| 84 if parent_builder is not None: | |
| 85 trigger_map[parent_builder].append(builder) | |
| 86 if parent_builder not in trigger_name_map: | |
| 87 trigger_name_map[parent_builder] = 'trigger_group_%d' % next_group_id | |
| 88 next_group_id += 1 | |
| 89 else: | |
| 90 polling_builders.append(builder) | |
| 91 s_gpu = Scheduler(name='gpu', | |
| 92 branch='src', | |
| 93 treeStableTimer=60, | |
| 94 builderNames=polling_builders) | |
| 95 c['schedulers'] = [s_gpu] | |
| 96 for name, builders in trigger_map.iteritems(): | |
| 97 c['schedulers'].append(Triggerable(name=trigger_name_map[name], | |
| 98 builderNames=builders)) | |
| 99 | 75 |
| 100 ####### BUILDERS | 76 ####### BUILDERS |
| 101 | 77 |
| 102 builders = [] | 78 builders = [] |
| 103 | 79 |
| 104 # ---------------------------------------------------------------------------- | 80 # ---------------------------------------------------------------------------- |
| 105 # FACTORIES | 81 # FACTORIES |
| 106 | 82 |
| 107 m_annotator = annotator_factory.AnnotatorFactory() | 83 m_annotator = annotator_factory.AnnotatorFactory() |
| 108 m_android = chromium_factory.ChromiumFactory( | 84 m_android = chromium_factory.ChromiumFactory( |
| 109 'src/build', 'linux2', nohooks_on_update=True, target_os='android') | 85 'src/build', 'linux2', nohooks_on_update=True, target_os='android') |
| 110 | 86 |
| 111 # Some shortcut to simplify the code below. | 87 # Some shortcut to simplify the code below. |
| 112 F_ANDROID = m_android.ChromiumAnnotationFactory | 88 F_ANDROID = m_android.ChromiumAnnotationFactory |
| 113 | 89 |
| 114 # TODO(kbr): switch the Android builder to use recipes too. | 90 # TODO(kbr): switch the Android builder to use recipes too. |
| 115 desktop_builders = [] | 91 recipe_master_helper.AddRecipeBasedBuilders( |
| 116 for slave in slaves.slaves: | 92 c, slaves, m_annotator, trigger_name_map) |
| 117 if 'recipe' in slave: | |
| 118 factory_properties = { | |
| 119 'test_results_server': 'test-results.appspot.com', | |
| 120 'generate_gtest_json': True, | |
| 121 'build_config': slave['build_config'] | |
| 122 } | |
| 123 if 'perf_id' in slave: | |
| 124 factory_properties['show_perf_results'] = True | |
| 125 factory_properties['perf_id'] = slave['perf_id'] | |
| 126 name = slave['builder'] | |
| 127 desktop_builders.append({ | |
| 128 'name': name, | |
| 129 'factory': m_annotator.BaseFactory( | |
| 130 slave['recipe'], | |
| 131 factory_properties, | |
| 132 [trigger_name_map[name]] if name in trigger_name_map else None) | |
| 133 }) | |
| 134 | 93 |
| 135 f_android_nexus7_dbg = F_ANDROID( | 94 f_android_nexus7_dbg = F_ANDROID( |
| 136 target='Debug', | 95 target='Debug', |
| 137 slave_type='AnnotatedBuilder', | 96 slave_type='AnnotatedBuilder', |
| 138 annotation_script='src/build/android/buildbot/bb_run_bot.py', | 97 annotation_script='src/build/android/buildbot/bb_run_bot.py', |
| 139 factory_properties={ | 98 factory_properties={ |
| 140 'android_bot_id': 'gpu-builder-tests-dbg', | 99 'android_bot_id': 'gpu-builder-tests-dbg', |
| 141 'gclient_timeout': 3600 | 100 'gclient_timeout': 3600 |
| 142 }) | 101 }) |
| 143 | 102 |
| 144 # ---------------------------------------------------------------------------- | 103 # ---------------------------------------------------------------------------- |
| 145 # BUILDER DEFINITIONS | 104 # BUILDER DEFINITIONS |
| 146 | 105 |
| 147 b_android_nexus7 = {'name': 'Android Debug (Nexus 7)', | 106 b_android_nexus7 = {'name': 'Android Debug (Nexus 7)', |
| 148 'factory': f_android_nexus7_dbg} | 107 'factory': f_android_nexus7_dbg} |
| 149 | 108 |
| 150 c['builders'] = desktop_builders + [ b_android_nexus7 ] | 109 c['builders'] += [ b_android_nexus7 ] |
| 151 | 110 |
| 152 # Associate the slaves to the manual builders. The configuration is in | 111 # Associate the slaves to the manual builders. The configuration is in |
| 153 # slaves.cfg. | 112 # slaves.cfg. |
| 154 for builder in c['builders']: | 113 for builder in c['builders']: |
| 155 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) | 114 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) |
| 156 | 115 |
| 157 ####### BUILDSLAVES | 116 ####### BUILDSLAVES |
| 158 | 117 |
| 159 # The 'slaves' list defines the set of allowable buildslaves. List all the | 118 # The 'slaves' list defines the set of allowable buildslaves. List all the |
| 160 # slaves registered to a builder. Remove dupes. | 119 # slaves registered to a builder. Remove dupes. |
| 161 c['slaves'] = master_utils.AutoSetupSlaves(c['builders'], | 120 c['slaves'] = master_utils.AutoSetupSlaves(c['builders'], |
| 162 config.Master.GetBotPassword()) | 121 config.Master.GetBotPassword()) |
| 163 | 122 |
| 164 # Make sure everything works together. | 123 # Make sure everything works together. |
| 165 master_utils.VerifySetup(c, slaves) | 124 master_utils.VerifySetup(c, slaves) |
| 166 | 125 |
| 167 ####### STATUS TARGETS | 126 ####### STATUS TARGETS |
| 168 | 127 |
| 169 # Adds common status and tools to this master. | 128 # Adds common status and tools to this master. |
| 170 master_utils.AutoSetupMaster(c, ActiveMaster, | 129 master_utils.AutoSetupMaster(c, ActiveMaster, |
| 171 public_html='../master.chromium/public_html', | 130 public_html='../master.chromium/public_html', |
| 172 templates=['../master.chromium/templates'], | 131 templates=['../master.chromium/templates'], |
| 173 enable_http_status_push=ActiveMaster.is_production_host) | 132 enable_http_status_push=ActiveMaster.is_production_host) |
| 174 | 133 |
| 175 ####### PROJECT IDENTITY | 134 ####### PROJECT IDENTITY |
| 176 | 135 |
| 177 # Buildbot master url: | 136 # Buildbot master url: |
| 178 c['buildbotURL'] = 'http://build.chromium.org/p/chromium.gpu/' | 137 c['buildbotURL'] = 'http://build.chromium.org/p/chromium.gpu/' |
| OLD | NEW |