| OLD | NEW |
| (Empty) |
| 1 # -*- python -*- | |
| 2 # ex: set syntax=python: | |
| 3 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 | |
| 7 # READ THIS: | |
| 8 # See http://dev.chromium.org/developers/testing/chromium-build-infrastructure | |
| 9 | |
| 10 import os | |
| 11 import socket | |
| 12 | |
| 13 from buildbot.scheduler import Triggerable | |
| 14 | |
| 15 # These modules come from scripts, which must be in the PYTHONPATH. | |
| 16 from master import buildbucket | |
| 17 from master import master_utils | |
| 18 from master import slaves_list | |
| 19 from master.builders_pools import BuildersPools | |
| 20 from master.factory import annotator_factory | |
| 21 from master.try_job_rietveld import TryJobRietveld | |
| 22 | |
| 23 import config | |
| 24 import master_site_config | |
| 25 | |
| 26 ActiveMaster = master_site_config.GpuTryServer | |
| 27 | |
| 28 | |
| 29 MAIL_NOTIFIER = ActiveMaster.is_production_host | |
| 30 UPDATE_CODEREVIEW = ActiveMaster.is_production_host | |
| 31 LISTEN_TO_RIETVELD = ActiveMaster.is_production_host | |
| 32 | |
| 33 # This is the dictionary that the buildmaster pays attention to. We also use | |
| 34 # a shorter alias to save typing. | |
| 35 c = BuildmasterConfig = {} | |
| 36 | |
| 37 config.DatabaseSetup(c, require_dbconfig=ActiveMaster.is_production_host) | |
| 38 | |
| 39 c['change_source'] = [] | |
| 40 | |
| 41 # Avoid merging requests. | |
| 42 c['mergeRequests'] = False | |
| 43 | |
| 44 m_annotator = annotator_factory.AnnotatorFactory() | |
| 45 | |
| 46 gpu_builders = [] | |
| 47 gpu_testers = [] | |
| 48 gpu_triggers = {} | |
| 49 for gpu_builder_name, triggers in gpu_triggers.iteritems(): | |
| 50 gpu_builders.append({ | |
| 51 'name': gpu_builder_name, | |
| 52 'factory': m_annotator.BaseFactory('gpu/build_and_upload', { | |
| 53 'sharded_tests': [], | |
| 54 'build_config': 'Release', | |
| 55 }, [gpu_builder_name]) | |
| 56 }) | |
| 57 for gpu_tester_name in triggers: | |
| 58 gpu_testers.append({ | |
| 59 'name': gpu_tester_name, | |
| 60 'factory': m_annotator.BaseFactory('gpu/download_and_test', { | |
| 61 'sharded_tests': [], | |
| 62 'build_config': 'Release' | |
| 63 }) | |
| 64 }) | |
| 65 | |
| 66 c['builders'] = gpu_builders + gpu_testers | |
| 67 | |
| 68 slaves = slaves_list.SlavesList('slaves.cfg', 'GpuTryServer') | |
| 69 | |
| 70 for builder in c['builders']: | |
| 71 builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) | |
| 72 builder.setdefault('auto_reboot', ActiveMaster.is_production_host) | |
| 73 | |
| 74 c['slaves'] = master_utils.AutoSetupSlaves(c['builders'], | |
| 75 config.Master.GetBotPassword()) | |
| 76 | |
| 77 master_utils.VerifySetup(c, slaves) | |
| 78 | |
| 79 c['schedulers'] = [] | |
| 80 | |
| 81 pools = BuildersPools('gpu') | |
| 82 pools['gpu'].extend([builder['name'] for builder in c['builders']]) | |
| 83 | |
| 84 code_review_sites = {'chrome': ActiveMaster.code_review_site } | |
| 85 | |
| 86 if LISTEN_TO_RIETVELD or True: | |
| 87 c['schedulers'].append(TryJobRietveld( | |
| 88 name='try_job_rietveld', | |
| 89 code_review_sites=code_review_sites, | |
| 90 pools=pools, | |
| 91 project='chrome', | |
| 92 filter_master=True)) | |
| 93 | |
| 94 # Triggerable schedulers for GPU testers. | |
| 95 for gpu_builder_name, triggers in gpu_triggers.iteritems(): | |
| 96 c['schedulers'].append(Triggerable( | |
| 97 name=gpu_builder_name, | |
| 98 builderNames=triggers)) | |
| 99 | |
| 100 # Buildbot master url: | |
| 101 # Must come before AutoSetupMaster(). | |
| 102 if ActiveMaster.is_production_host: | |
| 103 c['buildbotURL'] = ActiveMaster.buildbot_url | |
| 104 else: | |
| 105 c['buildbotURL'] = 'http://%s:%d/' % ( | |
| 106 socket.getfqdn(), ActiveMaster.master_port) | |
| 107 | |
| 108 # Adds common status and tools to this master. | |
| 109 # Use our own mail notifier. | |
| 110 master_utils.AutoSetupMaster(c, ActiveMaster, False) | |
| 111 | |
| 112 if MAIL_NOTIFIER: | |
| 113 # Add a dumb MailNotifier first so it will be used for BuildSlave with | |
| 114 # notify_on_missing set when they go missing. | |
| 115 from buildbot.status import mail | |
| 116 c['status'].append(mail.MailNotifier( | |
| 117 fromaddr=ActiveMaster.from_address, | |
| 118 builders=[], | |
| 119 relayhost=config.Master.smtp, | |
| 120 lookup=master_utils.UsersAreEmails())) | |
| 121 | |
| 122 from master import chromium_notifier | |
| 123 c['status'].append(chromium_notifier.ChromiumNotifier( | |
| 124 fromaddr=ActiveMaster.from_address, | |
| 125 categories_steps={'': ['update_scripts']}, | |
| 126 relayhost=config.Master.smtp, | |
| 127 status_header= | |
| 128 '%(steps)s failed on slave "%(slavename)s" for builder "%(builder)s"', | |
| 129 subject='%(steps)s failed on trybot %(slavename)s on %(date)s', | |
| 130 sendToInterestedUsers=False, | |
| 131 extraRecipients=['chrome-troopers+tryalert@google.com'], | |
| 132 use_getname=True, | |
| 133 enable_mail=ActiveMaster.is_production_host)) | |
| 134 | |
| 135 # Try job result emails. | |
| 136 from master.try_mail_notifier import TryMailNotifier | |
| 137 c['status'].append(TryMailNotifier( | |
| 138 fromaddr=ActiveMaster.from_address, | |
| 139 reply_to=ActiveMaster.reply_to, | |
| 140 subject="try %(result)s for %(reason)s @ r%(revision)s", | |
| 141 mode='all', | |
| 142 relayhost=config.Master.smtp, | |
| 143 lookup=master_utils.UsersAreEmails())) | |
| 144 | |
| 145 if UPDATE_CODEREVIEW: | |
| 146 from master.status_push import TryServerHttpStatusPush | |
| 147 c['status'].append( | |
| 148 TryServerHttpStatusPush(serverUrl=ActiveMaster.code_review_site)) | |
| 149 | |
| 150 buildbucket.setup( | |
| 151 c, | |
| 152 ActiveMaster, | |
| 153 buckets=['master.tryserver.chromium.gpu'], | |
| 154 ) | |
| 155 | |
| 156 # The followings are what is kept on disk. | |
| 157 # Keep last try jobs, the default is too low. Must keep at least a few days | |
| 158 # worth of try jobs. 3000 is not even a full day but the server is full. Keep | |
| 159 # more build objects than log since they are much smaller. | |
| 160 c['buildHorizon'] = 6000 | |
| 161 c['logHorizon'] = 3000 | |
| 162 # Must be at least 2x the number of slaves. | |
| 163 c['eventHorizon'] = 200 | |
| 164 c['logCompressionLimit'] = False | |
| 165 | |
| 166 # Adjust the buildCaches to be 3x the number of slaves per builder. | |
| 167 c['autoBuildCacheRatio'] = 3 | |
| 168 | |
| 169 c['projectURL'] = 'http://dev.chromium.org/developers/testing/try-server-usage' | |
| 170 | |
| 171 # vi: set ts=4 sts=2 sw=2 et: | |
| OLD | NEW |