| OLD | NEW |
| 1 # Copyright 2016 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 import collections | 5 import collections |
| 6 | 6 |
| 7 from recipe_engine import recipe_api | 7 from recipe_engine import recipe_api |
| 8 | 8 |
| 9 | 9 |
| 10 PER_TARGET_SWARMING_DIMS = collections.defaultdict(dict) | 10 PER_TARGET_SWARMING_DIMS = collections.defaultdict(dict) |
| 11 PER_TARGET_SWARMING_DIMS.update({ | 11 PER_TARGET_SWARMING_DIMS.update({ |
| 12 'android': { | 12 'android': { |
| 13 'android_devices': '6', | 13 'android_devices': '6', |
| 14 'cpu': None, | 14 'cpu': None, |
| 15 'gpu': None, | 15 'gpu': None, |
| 16 'os': 'Android', | 16 'os': 'Android', |
| 17 } | 17 } |
| 18 }) | 18 }) |
| 19 | 19 |
| 20 | 20 |
| 21 MASTER_SWARMING_PRIORITIES = collections.defaultdict(lambda: 25) | 21 MASTER_SWARMING_PRIORITIES = collections.defaultdict(lambda: 25) |
| 22 MASTER_SWARMING_PRIORITIES.update({ | 22 MASTER_SWARMING_PRIORITIES.update({ |
| 23 'chromium.fyi': 35, # This should be lower than the CQ. | 23 'chromium.fyi': 35, # This should be lower than the CQ. |
| 24 'chromium.memory.fyi': 27, | 24 'chromium.memory.full': 27, |
| 25 }) | 25 }) |
| 26 | 26 |
| 27 | 27 |
| 28 class ChromiumSwarmingApi(recipe_api.RecipeApi): | 28 class ChromiumSwarmingApi(recipe_api.RecipeApi): |
| 29 def configure_swarming(self, project_name, precommit, mastername=None): | 29 def configure_swarming(self, project_name, precommit, mastername=None): |
| 30 """Configures default swarming dimensions and tags. | 30 """Configures default swarming dimensions and tags. |
| 31 | 31 |
| 32 Uses the 'chromium' global config to determine target platform defaults, | 32 Uses the 'chromium' global config to determine target platform defaults, |
| 33 make sure something like chromium_tests.configure_build() has been called | 33 make sure something like chromium_tests.configure_build() has been called |
| 34 beforehand. | 34 beforehand. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 62 self.m.swarming.add_default_tag('purpose:ManualTS') | 62 self.m.swarming.add_default_tag('purpose:ManualTS') |
| 63 self.m.swarming.default_user = requester | 63 self.m.swarming.default_user = requester |
| 64 | 64 |
| 65 patch_project = self.m.properties.get('patch_project') | 65 patch_project = self.m.properties.get('patch_project') |
| 66 if patch_project: | 66 if patch_project: |
| 67 self.m.swarming.add_default_tag('patch_project:%s' % patch_project) | 67 self.m.swarming.add_default_tag('patch_project:%s' % patch_project) |
| 68 else: | 68 else: |
| 69 self.m.swarming.default_priority = MASTER_SWARMING_PRIORITIES[mastername] | 69 self.m.swarming.default_priority = MASTER_SWARMING_PRIORITIES[mastername] |
| 70 self.m.swarming.add_default_tag('purpose:post-commit') | 70 self.m.swarming.add_default_tag('purpose:post-commit') |
| 71 self.m.swarming.add_default_tag('purpose:CI') | 71 self.m.swarming.add_default_tag('purpose:CI') |
| OLD | NEW |