| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # ex: set syntax=python: | 2 # ex: set syntax=python: |
| 3 | 3 |
| 4 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 4 # Copyright (c) 2012 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 |
| 9 from buildbot.process import buildrequest |
| 8 from buildbot.scheduler import Nightly | 10 from buildbot.scheduler import Nightly |
| 9 from buildbot.scheduler import Scheduler | 11 from buildbot.scheduler import Scheduler |
| 10 | 12 |
| 11 from master import gitiles_poller | 13 from master import gitiles_poller |
| 12 from master import master_config | 14 from master import master_config |
| 13 from master import master_utils | 15 from master import master_utils |
| 14 from master import slaves_list | 16 from master import slaves_list |
| 15 from master.factory import annotator_factory | 17 from master.factory import annotator_factory |
| 16 | 18 |
| 17 import config | 19 import config |
| 18 import master_site_config | 20 import master_site_config |
| 19 | 21 |
| 22 import math |
| 20 import os | 23 import os |
| 21 | 24 |
| 22 | 25 |
| 23 ActiveMaster = master_site_config.V8 | 26 ActiveMaster = master_site_config.V8 |
| 24 MAIL_NOTIFIER = ActiveMaster.is_production_host | 27 MAIL_NOTIFIER = ActiveMaster.is_production_host |
| 25 | 28 |
| 26 # This is the dictionary that the buildmaster pays attention to. We also use | 29 # This is the dictionary that the buildmaster pays attention to. We also use |
| 27 # a shorter alias to save typing. | 30 # a shorter alias to save typing. |
| 28 c = BuildmasterConfig = {} | 31 c = BuildmasterConfig = {} |
| 29 c['status'] = [] | 32 c['status'] = [] |
| 30 | 33 |
| 34 def merge_requests_logarithmic(req1, req2, queue_length=1): |
| 35 """Merges builds dependent on the number of builds in the queue.""" |
| 36 if not buildrequest.BuildRequest.canBeMergedWith(req1, req2): |
| 37 return False |
| 38 |
| 39 # We inject our own data into the left build request's dict to keep track of |
| 40 # the number of merged builds. Buildbot compares the left one with all others |
| 41 # in the queue. |
| 42 num = req1.brdict.setdefault('monkey_patch_merged', 2) |
| 43 if num > int(math.log(queue_length or 1, 2)) + 1: |
| 44 return False |
| 45 req1.brdict['monkey_patch_merged'] = num + 1 |
| 46 return True |
| 31 | 47 |
| 32 ####### DATABASE | 48 ####### DATABASE |
| 33 | 49 |
| 34 config.DatabaseSetup(c) | 50 config.DatabaseSetup(c) |
| 35 | 51 |
| 36 ####### CHANGESOURCES | 52 ####### CHANGESOURCES |
| 37 | 53 |
| 38 comparator = gitiles_poller.GitilesRevisionComparator() | 54 comparator = gitiles_poller.GitilesRevisionComparator() |
| 39 c['change_source'] = [ | 55 c['change_source'] = [ |
| 40 gitiles_poller.GitilesPoller( | 56 gitiles_poller.GitilesPoller( |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 'factory': m_annotator.BaseFactory('v8'), | 234 'factory': m_annotator.BaseFactory('v8'), |
| 219 'category': CATEGORY_FYI, | 235 'category': CATEGORY_FYI, |
| 220 'auto_reboot' : False, | 236 'auto_reboot' : False, |
| 221 } | 237 } |
| 222 | 238 |
| 223 b_v8_linux_predictable = { | 239 b_v8_linux_predictable = { |
| 224 'name': 'V8 Linux - predictable', | 240 'name': 'V8 Linux - predictable', |
| 225 'factory': m_annotator.BaseFactory('v8'), | 241 'factory': m_annotator.BaseFactory('v8'), |
| 226 'category': CATEGORY_FYI + '|predictable', | 242 'category': CATEGORY_FYI + '|predictable', |
| 227 'auto_reboot' : False, | 243 'auto_reboot' : False, |
| 244 'mergeRequests': merge_requests_logarithmic, |
| 228 } | 245 } |
| 229 | 246 |
| 230 b_v8_linux_interpreted_regexp = { | 247 b_v8_linux_interpreted_regexp = { |
| 231 'name': 'V8 Linux - interpreted regexp', | 248 'name': 'V8 Linux - interpreted regexp', |
| 232 'builddir': 'v8-linux-interpreted-regexp', | 249 'builddir': 'v8-linux-interpreted-regexp', |
| 233 'factory': m_annotator.BaseFactory('v8'), | 250 'factory': m_annotator.BaseFactory('v8'), |
| 234 'category': CATEGORY_FYI, | 251 'category': CATEGORY_FYI, |
| 235 'auto_reboot' : False, | 252 'auto_reboot' : False, |
| 236 } | 253 } |
| 237 | 254 |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 # too low. Must keep at least a few days worth of builds. | 708 # too low. Must keep at least a few days worth of builds. |
| 692 c['buildHorizon'] = 1000 | 709 c['buildHorizon'] = 1000 |
| 693 c['logHorizon'] = 500 | 710 c['logHorizon'] = 500 |
| 694 # Must be at least 2x the number of slaves. | 711 # Must be at least 2x the number of slaves. |
| 695 c['eventHorizon'] = 200 | 712 c['eventHorizon'] = 200 |
| 696 | 713 |
| 697 ####### PROJECT IDENTITY | 714 ####### PROJECT IDENTITY |
| 698 | 715 |
| 699 c['projectName'] = ActiveMaster.project_name | 716 c['projectName'] = ActiveMaster.project_name |
| 700 c['projectURL'] = config.Master.project_url | 717 c['projectURL'] = config.Master.project_url |
| OLD | NEW |