| 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, merged_length): |
| 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 return merged_length <= int(math.log(queue_length, 2)) |
| 40 |
| 41 # Tell buildbot that we want to use a non-standard fuction with 4 parameters. |
| 42 setattr(merge_requests_logarithmic, 'with_length', True) |
| 31 | 43 |
| 32 ####### DATABASE | 44 ####### DATABASE |
| 33 | 45 |
| 34 config.DatabaseSetup(c) | 46 config.DatabaseSetup(c) |
| 35 | 47 |
| 36 ####### CHANGESOURCES | 48 ####### CHANGESOURCES |
| 37 | 49 |
| 38 comparator = gitiles_poller.GitilesRevisionComparator() | 50 comparator = gitiles_poller.GitilesRevisionComparator() |
| 39 c['change_source'] = [ | 51 c['change_source'] = [ |
| 40 gitiles_poller.GitilesPoller( | 52 gitiles_poller.GitilesPoller( |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 'factory': m_annotator.BaseFactory('v8'), | 230 'factory': m_annotator.BaseFactory('v8'), |
| 219 'category': CATEGORY_FYI, | 231 'category': CATEGORY_FYI, |
| 220 'auto_reboot' : False, | 232 'auto_reboot' : False, |
| 221 } | 233 } |
| 222 | 234 |
| 223 b_v8_linux_predictable = { | 235 b_v8_linux_predictable = { |
| 224 'name': 'V8 Linux - predictable', | 236 'name': 'V8 Linux - predictable', |
| 225 'factory': m_annotator.BaseFactory('v8'), | 237 'factory': m_annotator.BaseFactory('v8'), |
| 226 'category': CATEGORY_FYI + '|predictable', | 238 'category': CATEGORY_FYI + '|predictable', |
| 227 'auto_reboot' : False, | 239 'auto_reboot' : False, |
| 240 'mergeRequests': merge_requests_logarithmic, |
| 228 } | 241 } |
| 229 | 242 |
| 230 b_v8_linux_interpreted_regexp = { | 243 b_v8_linux_interpreted_regexp = { |
| 231 'name': 'V8 Linux - interpreted regexp', | 244 'name': 'V8 Linux - interpreted regexp', |
| 232 'builddir': 'v8-linux-interpreted-regexp', | 245 'builddir': 'v8-linux-interpreted-regexp', |
| 233 'factory': m_annotator.BaseFactory('v8'), | 246 'factory': m_annotator.BaseFactory('v8'), |
| 234 'category': CATEGORY_FYI, | 247 'category': CATEGORY_FYI, |
| 235 'auto_reboot' : False, | 248 'auto_reboot' : False, |
| 236 } | 249 } |
| 237 | 250 |
| (...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. | 704 # too low. Must keep at least a few days worth of builds. |
| 692 c['buildHorizon'] = 1000 | 705 c['buildHorizon'] = 1000 |
| 693 c['logHorizon'] = 500 | 706 c['logHorizon'] = 500 |
| 694 # Must be at least 2x the number of slaves. | 707 # Must be at least 2x the number of slaves. |
| 695 c['eventHorizon'] = 200 | 708 c['eventHorizon'] = 200 |
| 696 | 709 |
| 697 ####### PROJECT IDENTITY | 710 ####### PROJECT IDENTITY |
| 698 | 711 |
| 699 c['projectName'] = ActiveMaster.project_name | 712 c['projectName'] = ActiveMaster.project_name |
| 700 c['projectURL'] = config.Master.project_url | 713 c['projectURL'] = config.Master.project_url |
| OLD | NEW |