Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 from buildbot.schedulers.basic import SingleBranchScheduler | |
| 6 | |
| 5 # These modules come from scripts/master, which must be in the PYTHONPATH. | 7 # These modules come from scripts/master, which must be in the PYTHONPATH. |
| 6 from master import master_utils | 8 from master import master_utils |
| 7 from master import slaves_list | 9 from master import slaves_list |
| 10 from master.factory import annotator_factory | |
| 8 | 11 |
| 9 import config | 12 import config |
| 10 import master_site_config | 13 import master_site_config |
| 11 ActiveMaster = master_site_config.WebRTC | 14 ActiveMaster = master_site_config.WebRTCPerf |
| 12 | 15 |
| 13 c = BuildmasterConfig = {} | 16 c = BuildmasterConfig = {} |
| 14 c['change_source'] = [] | 17 c['change_source'] = [] |
| 15 c['schedulers'] = [] | 18 c['schedulers'] = [] |
| 16 c['builders'] = [] | 19 c['builders'] = [] |
| 17 c['status'] = [] | 20 c['status'] = [] |
| 18 | 21 |
| 19 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) | 22 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) |
| 20 | 23 |
| 21 import master_source_cfg | 24 import master_source_cfg |
| 22 import master_win_cfg | 25 master_source_cfg.Update(config, c) |
| 23 import master_mac_cfg | |
| 24 import master_linux_cfg | |
| 25 import master_android_cfg | |
| 26 | 26 |
| 27 master_source_cfg.Update(config, c) | 27 ####### BUILDERS |
| 28 master_win_cfg.Update(c) | 28 |
| 29 master_mac_cfg.Update(c) | 29 c['schedulers'].extend([ |
|
ghost stip (do not use)
2016/06/01 18:43:49
you should look into using builders.pyl. it combin
| |
| 30 master_linux_cfg.Update(c) | 30 SingleBranchScheduler(name='webrtc_scheduler', |
| 31 master_android_cfg.Update(c) | 31 branch='master', |
| 32 treeStableTimer=0, | |
| 33 builderNames=[ | |
| 34 'Android32 Builder', | |
| 35 'Android64 Builder', | |
| 36 'Linux Trusty', | |
| 37 'Mac 10.11', | |
| 38 'Win7', | |
| 39 ]), | |
| 40 ]) | |
| 41 | |
| 42 specs = [ | |
| 43 {'name': 'Android32 Builder', 'slavebuilddir': 'android_32'}, | |
| 44 {'name': 'Android64 Builder', 'slavebuilddir': 'android_64'}, | |
| 45 {'name': 'Android32 Tests (M Nexus5X)'}, | |
| 46 {'name': 'Android64 Tests (M Nexus9)'}, | |
| 47 {'name': 'Linux Trusty'}, | |
| 48 {'name': 'Mac 10.11'}, | |
| 49 {'name': 'Win7'}, | |
| 50 ] | |
| 51 | |
| 52 m_annotator = annotator_factory.AnnotatorFactory() | |
| 53 for spec in specs: | |
| 54 builder = { | |
| 55 'name': spec['name'], | |
| 56 'factory': m_annotator.BaseFactory('webrtc/standalone'), | |
| 57 'notify_on_missing': True, | |
| 58 } | |
| 59 if spec.get('slavebuilddir'): | |
| 60 builder['slavebuilddir'] = spec.get('slavebuilddir') | |
| 61 c['builders'].append(builder) | |
| 62 | |
| 32 | 63 |
| 33 # Must come before AutoSetupMaster(). | 64 # Must come before AutoSetupMaster(). |
| 34 c['buildbotURL'] = ActiveMaster.buildbot_url | 65 c['buildbotURL'] = ActiveMaster.buildbot_url |
| 35 | 66 |
| 36 # Associate the slaves to the manual builders. The configuration is in | 67 # Associate the slaves to the manual builders. The configuration is in |
| 37 # slaves.cfg. | 68 # slaves.cfg. |
| 38 slaves = slaves_list.SlavesList('slaves.cfg', 'WebRTC') | 69 slaves = slaves_list.SlavesList('slaves.cfg', 'WebRTCPerf') |
| 39 for builder in c['builders']: | 70 for builder in c['builders']: |
| 40 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) | 71 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) |
| 41 # Disable auto_reboot when testing locally, but don't change for production. | 72 # Disable auto_reboot when testing locally, but don't change for production. |
| 42 if not ActiveMaster.is_production_host: | 73 if not ActiveMaster.is_production_host: |
| 43 builder['auto_reboot'] = False | 74 builder['auto_reboot'] = False |
| 44 | 75 |
| 45 # The 'slaves' list defines the set of allowable buildslaves. List all the | 76 # The 'slaves' list defines the set of allowable buildslaves. List all the |
| 46 # slaves registered to a builder. Remove dupes. | 77 # slaves registered to a builder. Remove dupes. |
| 47 c['slaves'] = master_utils.AutoSetupSlaves( | 78 c['slaves'] = master_utils.AutoSetupSlaves( |
| 48 c['builders'], | 79 c['builders'], |
| 49 config.Master.GetBotPassword()) | 80 config.Master.GetBotPassword()) |
| 50 master_utils.VerifySetup(c, slaves) | 81 master_utils.VerifySetup(c, slaves) |
| 51 | 82 |
| 52 # Adds common status and tools to this master. | 83 # Adds common status and tools to this master. |
| 53 master_utils.AutoSetupMaster(c, ActiveMaster, | 84 master_utils.AutoSetupMaster(c, ActiveMaster, |
| 54 public_html='../master.chromium/public_html', | 85 public_html='../master.chromium/public_html', |
| 55 templates=['./templates', '../master.chromium/templates'], | 86 templates=['./templates', |
| 87 '../master.client.webrtc/templates', | |
| 88 '../master.chromium/templates'], | |
| 56 tagComparator=c['change_source'][0].comparator, | 89 tagComparator=c['change_source'][0].comparator, |
| 57 enable_http_status_push=ActiveMaster.is_production_host) | 90 enable_http_status_push=ActiveMaster.is_production_host) |
| 58 | 91 |
| 59 # Setup notification e-mails for failed builds. | 92 # Setup notification e-mails for failed builds. |
| 60 if ActiveMaster.is_production_host: | 93 if ActiveMaster.is_production_host: |
| 61 from buildbot.status import mail | 94 from buildbot.status import mail |
| 62 lookup = master_utils.FilterDomain( | 95 lookup = master_utils.FilterDomain( |
| 63 domain=ActiveMaster.master_domain, | 96 domain=ActiveMaster.master_domain, |
| 64 permitted_domains=ActiveMaster.permitted_domains) | 97 permitted_domains=ActiveMaster.permitted_domains) |
| 65 c['status'].append(mail.MailNotifier( | 98 c['status'].append(mail.MailNotifier( |
| 66 fromaddr=ActiveMaster.from_address, | 99 fromaddr=ActiveMaster.from_address, |
| 67 extraRecipients=['webrtc-sheriff-mtv@grotations.appspotmail.com', | 100 extraRecipients=['webrtc-sheriff-mtv@grotations.appspotmail.com', |
| 68 'webrtc-sheriff-sto@grotations.appspotmail.com'], | 101 'webrtc-sheriff-sto@grotations.appspotmail.com'], |
| 69 lookup=lookup, | 102 lookup=lookup, |
| 70 mode='problem', | 103 mode='problem', |
| 71 relayhost=config.Master.smtp)) | 104 relayhost=config.Master.smtp)) |
| 72 | 105 |
| 73 # Do it at the end to override values set by AutoSetupMaster, the default is | 106 # Do it at the end to override values set by AutoSetupMaster, the default is |
| 74 # too low. Must keep at least a few days worth of builds. | 107 # too low. Must keep at least a few days worth of builds. |
| 75 c['buildHorizon'] = 3000 | 108 c['buildHorizon'] = 3000 |
| 76 c['logHorizon'] = 3000 | 109 c['logHorizon'] = 3000 |
| 77 # Must be at least 2x the number of slaves. | 110 # Must be at least 2x the number of slaves. |
| 78 c['eventHorizon'] = 200 | 111 c['eventHorizon'] = 200 |
| OLD | NEW |