OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import contextlib | 6 import contextlib |
7 import copy | 7 import copy |
8 import itertools | 8 import itertools |
9 import json | 9 import json |
10 | 10 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 bot_db = bdb_module.BotConfigAndTestDB() | 205 bot_db = bdb_module.BotConfigAndTestDB() |
206 bot_db._add_master_dict_and_test_spec(mastername, master_dict, {}) | 206 bot_db._add_master_dict_and_test_spec(mastername, master_dict, {}) |
207 return bot_db | 207 return bot_db |
208 | 208 |
209 def prepare_checkout(self, bot_config, root_solution_revision=None, | 209 def prepare_checkout(self, bot_config, root_solution_revision=None, |
210 force=False): | 210 force=False): |
211 update_step = self.ensure_checkout( | 211 update_step = self.ensure_checkout( |
212 bot_config, root_solution_revision, force=force) | 212 bot_config, root_solution_revision, force=force) |
213 | 213 |
214 if (self.m.chromium.c.compile_py.compiler and | 214 if (self.m.chromium.c.compile_py.compiler and |
215 'goma' in self.m.chromium.c.compile_py.compiler): | 215 'goma' in self.m.chromium.c.compile_py.compiler): |
216 self.m.chromium.ensure_goma(canary=bot_config.get('goma_canary', False)) | 216 self.m.chromium.ensure_goma(canary=bot_config.get('goma_canary', False)) |
217 | 217 |
218 self.set_up_swarming(bot_config) | 218 self.set_up_swarming(bot_config) |
219 self.runhooks(update_step) | 219 self.runhooks(update_step) |
220 | 220 |
221 bot_db = bdb_module.BotConfigAndTestDB() | 221 bot_db = bdb_module.BotConfigAndTestDB() |
222 bot_config.initialize_bot_db(self, bot_db, update_step) | 222 bot_config.initialize_bot_db(self, bot_db, update_step) |
223 | 223 |
224 if self.m.chromium.c.lto and \ | 224 if self.m.chromium.c.lto and \ |
225 not self.m.chromium.c.env.LLVM_FORCE_HEAD_REVISION: | 225 not self.m.chromium.c.env.LLVM_FORCE_HEAD_REVISION: |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
399 verbose=True, | 399 verbose=True, |
400 set_swarm_hashes=False) | 400 set_swarm_hashes=False) |
401 | 401 |
402 def archive_build(self, mastername, buildername, update_step, bot_db): | 402 def archive_build(self, mastername, buildername, update_step, bot_db): |
403 bot_config = bot_db.get_bot_config(mastername, buildername) | 403 bot_config = bot_db.get_bot_config(mastername, buildername) |
404 | 404 |
405 if bot_config.get('bot_type') == 'builder': | 405 if bot_config.get('bot_type') == 'builder': |
406 if not bot_config.get('cf_archive_build'): | 406 if not bot_config.get('cf_archive_build'): |
407 master_config = bot_db.get_master_settings(mastername) | 407 master_config = bot_db.get_master_settings(mastername) |
408 build_revision = update_step.presentation.properties['got_revision'] | 408 build_revision = update_step.presentation.properties['got_revision'] |
409 | |
410 # For archiving 'chromium.perf', the builder also archives a version | |
411 # without perf test files. | |
412 if mastername.startswith('chromium.perf'): | |
413 self.m.archive.zip_and_upload_build( | |
414 'package build', | |
stgao
2016/07/11 19:04:27
This seems to add a new step, should we make a new
miimnk
2016/07/11 22:08:47
How about if we name it to 'package build bisect'.
| |
415 self.m.chromium.c.build_config_fs, | |
416 build_url=self._build_gs_archive_url( | |
417 mastername, master_config, buildername, strip_symbol = True), | |
418 build_revision=build_revision, | |
419 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, | |
420 # TODO(machenbach): Make asan a configuration switch. | |
stgao
2016/07/11 19:04:27
What's this for?
miimnk
2016/07/11 22:08:47
I essentially copied and pasted the self.m.archive
| |
421 package_dsym_files=( | |
422 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and | |
423 self.m.chromium.c.HOST_PLATFORM == 'mac'), | |
424 update_properties=update_step.presentation.properties, | |
425 includePerfTestFiles=False, | |
426 store_by_hash=False | |
427 ) | |
428 | |
409 self.m.archive.zip_and_upload_build( | 429 self.m.archive.zip_and_upload_build( |
410 'package build', | 430 'package build', |
411 self.m.chromium.c.build_config_fs, | 431 self.m.chromium.c.build_config_fs, |
412 build_url=self._build_gs_archive_url( | 432 build_url=self._build_gs_archive_url( |
413 mastername, master_config, buildername), | 433 mastername, master_config, buildername), |
414 build_revision=build_revision, | 434 build_revision=build_revision, |
415 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, | 435 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, |
416 # TODO(machenbach): Make asan a configuration switch. | 436 # TODO(machenbach): Make asan a configuration switch. |
417 package_dsym_files=( | 437 package_dsym_files=( |
418 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and | 438 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 isolated_targets=isolated_targets, | 487 isolated_targets=isolated_targets, |
468 name='generate_build_files%s' % name_suffix) | 488 name='generate_build_files%s' % name_suffix) |
469 | 489 |
470 self.m.chromium.compile(compile_targets, name='compile%s' % name_suffix) | 490 self.m.chromium.compile(compile_targets, name='compile%s' % name_suffix) |
471 | 491 |
472 def download_and_unzip_build(self, mastername, buildername, update_step, | 492 def download_and_unzip_build(self, mastername, buildername, update_step, |
473 bot_db, build_archive_url=None, | 493 bot_db, build_archive_url=None, |
474 build_revision=None, override_bot_type=None): | 494 build_revision=None, override_bot_type=None): |
475 assert isinstance(bot_db, bdb_module.BotConfigAndTestDB), \ | 495 assert isinstance(bot_db, bdb_module.BotConfigAndTestDB), \ |
476 "bot_db argument %r was not a BotConfigAndTestDB" % (bot_db) | 496 "bot_db argument %r was not a BotConfigAndTestDB" % (bot_db) |
497 | |
477 # We only want to do this for tester bots (i.e. those which do not compile | 498 # We only want to do this for tester bots (i.e. those which do not compile |
478 # locally). | 499 # locally). |
479 bot_type = override_bot_type or bot_db.get_bot_config( | 500 bot_type = override_bot_type or bot_db.get_bot_config( |
480 mastername, buildername).get('bot_type') | 501 mastername, buildername).get('bot_type') |
481 if bot_type != 'tester': | 502 if bot_type != 'tester': |
482 return | 503 return |
483 | 504 |
484 # Protect against hard to debug mismatches between directory names | 505 # Protect against hard to debug mismatches between directory names |
485 # used to run tests from and extract build to. We've had several cases | 506 # used to run tests from and extract build to. We've had several cases |
486 # where a stale build directory was used on a tester, and the extracted | 507 # where a stale build directory was used on a tester, and the extracted |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
755 self.m.swarming.default_user = requester | 776 self.m.swarming.default_user = requester |
756 | 777 |
757 patch_project = self.m.properties.get('patch_project') | 778 patch_project = self.m.properties.get('patch_project') |
758 if patch_project: | 779 if patch_project: |
759 self.m.swarming.add_default_tag('patch_project:%s' % patch_project) | 780 self.m.swarming.add_default_tag('patch_project:%s' % patch_project) |
760 else: | 781 else: |
761 self.m.swarming.default_priority = MASTER_SWARMING_PRIORITIES[mastername] | 782 self.m.swarming.default_priority = MASTER_SWARMING_PRIORITIES[mastername] |
762 self.m.swarming.add_default_tag('purpose:post-commit') | 783 self.m.swarming.add_default_tag('purpose:post-commit') |
763 self.m.swarming.add_default_tag('purpose:CI') | 784 self.m.swarming.add_default_tag('purpose:CI') |
764 | 785 |
765 def _build_gs_archive_url(self, mastername, master_config, buildername): | 786 def _build_gs_archive_url(self, mastername, master_config, buildername, strip_ symbol = False): |
766 """Returns the archive URL to pass to self.m.archive.zip_and_upload_build. | 787 """Returns the archive URL to pass to self.m.archive.zip_and_upload_build. |
767 | 788 |
768 Most builders on most masters use a standard format for the build archive | 789 Most builders on most masters use a standard format for the build archive |
769 URL, but some builders on some masters may specify custom places to upload | 790 URL, but some builders on some masters may specify custom places to upload |
770 builds to. These special cases include: | 791 builds to. These special cases include: |
771 'chromium.perf' or 'chromium.perf.fyi': | 792 'chromium.perf' or 'chromium.perf.fyi': |
772 Exclude the name of the master from the url. | 793 Exclude the name of the master from the url. |
773 'tryserver.chromium.perf', or | 794 'tryserver.chromium.perf', or |
774 linux_full_bisect_builder on 'tryserver.chromium.linux': | 795 linux_full_bisect_builder on 'tryserver.chromium.linux': |
775 Return None so that the archive url specified in factory_properties | 796 Return None so that the archive url specified in factory_properties |
776 (as set on the master's configuration) is used instead. | 797 (as set on the master's configuration) is used instead. |
777 """ | 798 """ |
778 if mastername.startswith('chromium.perf'): | 799 if mastername.startswith('chromium.perf'): |
800 if strip_symbol: | |
801 return self.m.archive.legacy_upload_url( | |
802 master_config.get('bisect_build_gs_bucket'), | |
803 extra_url_components=None) | |
779 return self.m.archive.legacy_upload_url( | 804 return self.m.archive.legacy_upload_url( |
780 master_config.get('build_gs_bucket'), | 805 master_config.get('build_gs_bucket'), |
781 extra_url_components=None) | 806 extra_url_components=None) |
782 elif (mastername == 'tryserver.chromium.perf' or | 807 elif (mastername == 'tryserver.chromium.perf' or |
783 (mastername == 'tryserver.chromium.linux' and | 808 (mastername == 'tryserver.chromium.linux' and |
784 buildername == 'linux_full_bisect_builder')): | 809 buildername == 'linux_full_bisect_builder')): |
785 return None | 810 return None |
786 else: | 811 else: |
787 return self.m.archive.legacy_upload_url( | 812 return self.m.archive.legacy_upload_url( |
788 master_config.get('build_gs_bucket'), | 813 master_config.get('build_gs_bucket'), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
829 def get_compile_targets_for_scripts(self): | 854 def get_compile_targets_for_scripts(self): |
830 return self.m.python( | 855 return self.m.python( |
831 name='get compile targets for scripts', | 856 name='get compile targets for scripts', |
832 script=self.m.path['checkout'].join( | 857 script=self.m.path['checkout'].join( |
833 'testing', 'scripts', 'get_compile_targets.py'), | 858 'testing', 'scripts', 'get_compile_targets.py'), |
834 args=[ | 859 args=[ |
835 '--output', self.m.json.output(), | 860 '--output', self.m.json.output(), |
836 '--', | 861 '--', |
837 ] + self.get_common_args_for_scripts(), | 862 ] + self.get_common_args_for_scripts(), |
838 step_test_data=lambda: self.m.json.test_api.output({})) | 863 step_test_data=lambda: self.m.json.test_api.output({})) |
OLD | NEW |