| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # ex: set syntax=python: | 2 # ex: set syntax=python: |
| 3 | 3 |
| 4 # Copyright 2015 The Chromium Authors. All rights reserved. | 4 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
| 7 | 7 |
| 8 import config | 8 import config |
| 9 import master_site_config | 9 import master_site_config |
| 10 | 10 |
| 11 from buildbot.scheduler import Periodic | 11 from buildbot.scheduler import Periodic |
| 12 from buildbot.schedulers.basic import AnyBranchScheduler |
| 12 from buildbot.schedulers.timed import Nightly | 13 from buildbot.schedulers.timed import Nightly |
| 13 from buildbot.status import mail | 14 from buildbot.status import mail |
| 14 | 15 |
| 15 from master import exception_notifier | 16 from master import exception_notifier |
| 17 from master import gitiles_poller |
| 16 from master import master_utils | 18 from master import master_utils |
| 17 from master import slaves_list | 19 from master import slaves_list |
| 18 from master.factory import annotator_factory | 20 from master.factory import annotator_factory |
| 19 | 21 |
| 20 | 22 |
| 21 ActiveMaster = master_site_config.InfraCron | 23 ActiveMaster = master_site_config.InfraCron |
| 22 | 24 |
| 23 c = BuildmasterConfig = {} | 25 c = BuildmasterConfig = {} |
| 24 c['slavePortnum'] = ActiveMaster.slave_port | 26 c['slavePortnum'] = ActiveMaster.slave_port |
| 25 c['schedulers'] = [] | 27 c['schedulers'] = [] |
| 26 c['builders'] = [] | 28 c['builders'] = [] |
| 27 c['change_source'] = [] | 29 c['change_source'] = [] |
| 28 c['status'] = [] | 30 c['status'] = [] |
| 29 | 31 |
| 30 def mergeRequests(req1, req2): | 32 def mergeRequests(req1, req2): |
| 31 if 'publish_tarball' in (req1.buildername, req2.buildername): | 33 if 'publish_tarball' in (req1.buildername, req2.buildername): |
| 32 return False | 34 return False |
| 33 return req1.canBeMergedWith(req2) | 35 return req1.canBeMergedWith(req2) |
| 34 c['mergeRequests'] = mergeRequests | 36 c['mergeRequests'] = mergeRequests |
| 35 | 37 |
| 36 f_annotations = annotator_factory.AnnotatorFactory(ActiveMaster) | 38 f_annotations = annotator_factory.AnnotatorFactory(ActiveMaster) |
| 37 | 39 |
| 38 ####### DATABASE | 40 ####### DATABASE |
| 39 | 41 |
| 40 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) | 42 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) |
| 41 | 43 |
| 44 |
| 45 ####### CHANGE SOURCES |
| 46 INFRA_REPO_URL = 'https://chromium.googlesource.com/infra/infra' |
| 47 |
| 48 c['change_source'].extend([ |
| 49 gitiles_poller.GitilesPoller( |
| 50 repo_url='https://chromium.googlesource.com/infra/infra', |
| 51 project='infra', |
| 52 branches=['master'], |
| 53 pollInterval=10, |
| 54 revlinktmpl=INFRA_REPO_URL+'/+/%s'), |
| 55 ]) |
| 56 |
| 42 ####### BUILDERS | 57 ####### BUILDERS |
| 43 | 58 |
| 44 c['builders'].extend([ | 59 c['builders'].extend([ |
| 45 { | 60 { |
| 46 'name': 'gnumbd', | 61 'name': 'gnumbd', |
| 47 'factory': f_annotations.BaseFactory( | 62 'factory': f_annotations.BaseFactory( |
| 48 'infra/gnumbd', | 63 'infra/gnumbd', |
| 49 {'target_repo': 'https://chromium.googlesource.com/chromium/src'}), | 64 {'target_repo': 'https://chromium.googlesource.com/chromium/src'}), |
| 50 'auto_reboot' : False, | 65 'auto_reboot' : False, |
| 51 'category': '1cron', | 66 'category': '1cron', |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 { | 161 { |
| 147 'name': 'Chromium Linux Codesearch', | 162 'name': 'Chromium Linux Codesearch', |
| 148 'factory': f_annotations.BaseFactory(recipe='chromium_codesearch'), | 163 'factory': f_annotations.BaseFactory(recipe='chromium_codesearch'), |
| 149 'category': '2codesearch', | 164 'category': '2codesearch', |
| 150 }, | 165 }, |
| 151 { | 166 { |
| 152 'name': 'ChromiumOS Codesearch', | 167 'name': 'ChromiumOS Codesearch', |
| 153 'factory': f_annotations.BaseFactory(recipe='chromium_codesearch'), | 168 'factory': f_annotations.BaseFactory(recipe='chromium_codesearch'), |
| 154 'category': '2codesearch', | 169 'category': '2codesearch', |
| 155 }, | 170 }, |
| 171 { |
| 172 'name': 'git-hash-metrics', |
| 173 'factory': f_annotations.BaseFactory(recipe='git_hash_metric'), |
| 174 'category': '3monitoring', |
| 175 }, |
| 156 ]) | 176 ]) |
| 157 | 177 |
| 158 ####### SCHEDULERS | 178 ####### SCHEDULERS |
| 159 | 179 |
| 160 c['schedulers'].extend([ | 180 c['schedulers'].extend([ |
| 161 # Period is intentionally small so that if a builder fails fast, it also | 181 # Period is intentionally small so that if a builder fails fast, it also |
| 162 # gets restarted fast. | 182 # gets restarted fast. |
| 163 Periodic( | 183 Periodic( |
| 164 name='infra-runner-scheduler', | 184 name='infra-runner-scheduler', |
| 165 periodicBuildTimer=1*60, | 185 periodicBuildTimer=1*60, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 190 branch=None, | 210 branch=None, |
| 191 builderNames=['publish_tarball'], | 211 builderNames=['publish_tarball'], |
| 192 hour=range(0, 24, 3), | 212 hour=range(0, 24, 3), |
| 193 ), | 213 ), |
| 194 Nightly( | 214 Nightly( |
| 195 name='codesearch-scheduler', | 215 name='codesearch-scheduler', |
| 196 branch='master', | 216 branch='master', |
| 197 hour=range(0, 24, 4), | 217 hour=range(0, 24, 4), |
| 198 minute=0, | 218 minute=0, |
| 199 builderNames=['Chromium Linux Codesearch', 'ChromiumOS Codesearch']), | 219 builderNames=['Chromium Linux Codesearch', 'ChromiumOS Codesearch']), |
| 220 |
| 221 # Trigger this builder on any change anywhere. |
| 222 AnyBranchScheduler( |
| 223 name='git-hash-metrics', |
| 224 builderNames=['git-hash-metrics']), |
| 200 ]) | 225 ]) |
| 201 | 226 |
| 202 ####### BUILDSLAVES | 227 ####### BUILDSLAVES |
| 203 | 228 |
| 204 # Associate the slaves to the builders. The configuration is in slaves.cfg. | 229 # Associate the slaves to the builders. The configuration is in slaves.cfg. |
| 205 slaves = slaves_list.SlavesList('slaves.cfg', 'InfraCron') | 230 slaves = slaves_list.SlavesList('slaves.cfg', 'InfraCron') |
| 206 for builder in c['builders']: | 231 for builder in c['builders']: |
| 207 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) | 232 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) |
| 208 | 233 |
| 209 # The 'slaves' list defines the set of allowable buildslaves. List all the | 234 # The 'slaves' list defines the set of allowable buildslaves. List all the |
| (...skipping 25 matching lines...) Expand all Loading... |
| 235 sendToInterestedUsers=False, | 260 sendToInterestedUsers=False, |
| 236 extraRecipients=['blink-infra+alerts@google.com', | 261 extraRecipients=['blink-infra+alerts@google.com', |
| 237 'chrome-troopers+alerts@google.com'], | 262 'chrome-troopers+alerts@google.com'], |
| 238 ), | 263 ), |
| 239 ]) | 264 ]) |
| 240 | 265 |
| 241 ####### PROJECT IDENTITY | 266 ####### PROJECT IDENTITY |
| 242 | 267 |
| 243 c['projectName'] = ActiveMaster.project_name | 268 c['projectName'] = ActiveMaster.project_name |
| 244 c['buildbotURL'] = ActiveMaster.buildbot_url | 269 c['buildbotURL'] = ActiveMaster.buildbot_url |
| OLD | NEW |