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 388 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 for manual bisect. | |
412 # (https://bugs.chromium.org/p/chromium/issues/detail?id=604452) | |
413 if (mastername.startswith('chromium.perf') and | |
414 buildername == 'Linux Builder'): | |
dtu
2016/08/05 21:06:19
This condition could be brittle -- prefer not to d
miimnk
2016/08/08 22:41:26
Done.
Added an option in master_config.
| |
415 self.m.archive.zip_and_upload_build( | |
416 'package build for bisect', | |
417 self.m.chromium.c.build_config_fs, | |
418 build_url=self._build_gs_archive_url( | |
419 mastername, master_config, buildername, strip_symbol = True), | |
dtu
2016/08/05 21:06:19
style nit: no space around =
style nit: this line
miimnk
2016/08/08 22:41:26
Done.
| |
420 build_revision=build_revision, | |
421 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, | |
422 update_properties=update_step.presentation.properties, | |
423 includePerfTestFiles=False, | |
424 store_by_hash=False | |
425 ) | |
426 | |
409 self.m.archive.zip_and_upload_build( | 427 self.m.archive.zip_and_upload_build( |
410 'package build', | 428 'package build', |
411 self.m.chromium.c.build_config_fs, | 429 self.m.chromium.c.build_config_fs, |
412 build_url=self._build_gs_archive_url( | 430 build_url=self._build_gs_archive_url( |
413 mastername, master_config, buildername), | 431 mastername, master_config, buildername), |
414 build_revision=build_revision, | 432 build_revision=build_revision, |
415 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, | 433 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, |
416 # TODO(machenbach): Make asan a configuration switch. | 434 # TODO(machenbach): Make asan a configuration switch. |
417 package_dsym_files=( | 435 package_dsym_files=( |
418 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and | 436 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
755 self.m.swarming.default_user = requester | 773 self.m.swarming.default_user = requester |
756 | 774 |
757 patch_project = self.m.properties.get('patch_project') | 775 patch_project = self.m.properties.get('patch_project') |
758 if patch_project: | 776 if patch_project: |
759 self.m.swarming.add_default_tag('patch_project:%s' % patch_project) | 777 self.m.swarming.add_default_tag('patch_project:%s' % patch_project) |
760 else: | 778 else: |
761 self.m.swarming.default_priority = MASTER_SWARMING_PRIORITIES[mastername] | 779 self.m.swarming.default_priority = MASTER_SWARMING_PRIORITIES[mastername] |
762 self.m.swarming.add_default_tag('purpose:post-commit') | 780 self.m.swarming.add_default_tag('purpose:post-commit') |
763 self.m.swarming.add_default_tag('purpose:CI') | 781 self.m.swarming.add_default_tag('purpose:CI') |
764 | 782 |
765 def _build_gs_archive_url(self, mastername, master_config, buildername): | 783 def _build_gs_archive_url(self, mastername, master_config, buildername, |
784 strip_symbol = False): | |
dtu
2016/08/05 21:06:19
style nit: no space around =
miimnk
2016/08/08 22:41:27
Done.
| |
766 """Returns the archive URL to pass to self.m.archive.zip_and_upload_build. | 785 """Returns the archive URL to pass to self.m.archive.zip_and_upload_build. |
767 | 786 |
768 Most builders on most masters use a standard format for the build archive | 787 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 | 788 URL, but some builders on some masters may specify custom places to upload |
770 builds to. These special cases include: | 789 builds to. These special cases include: |
771 'chromium.perf' or 'chromium.perf.fyi': | 790 'chromium.perf' or 'chromium.perf.fyi': |
772 Exclude the name of the master from the url. | 791 Exclude the name of the master from the url. |
773 'tryserver.chromium.perf', or | 792 'tryserver.chromium.perf', or |
774 linux_full_bisect_builder on 'tryserver.chromium.linux': | 793 linux_full_bisect_builder on 'tryserver.chromium.linux': |
775 Return None so that the archive url specified in factory_properties | 794 Return None so that the archive url specified in factory_properties |
776 (as set on the master's configuration) is used instead. | 795 (as set on the master's configuration) is used instead. |
777 """ | 796 """ |
778 if mastername.startswith('chromium.perf'): | 797 if mastername.startswith('chromium.perf'): |
798 if strip_symbol: | |
dtu
2016/08/05 21:06:19
This function has completely separate code paths w
miimnk
2016/08/08 22:41:27
I see that the part of the code is indeed unrelate
| |
799 return self.m.archive.legacy_upload_url( | |
800 master_config.get('bisect_build_gs_bucket'), | |
801 extra_url_components=master_config.get('bisect_build_gs_extra')) | |
779 return self.m.archive.legacy_upload_url( | 802 return self.m.archive.legacy_upload_url( |
780 master_config.get('build_gs_bucket'), | 803 master_config.get('build_gs_bucket'), |
781 extra_url_components=None) | 804 extra_url_components=None) |
782 elif (mastername == 'tryserver.chromium.perf' or | 805 elif (mastername == 'tryserver.chromium.perf' or |
783 (mastername == 'tryserver.chromium.linux' and | 806 (mastername == 'tryserver.chromium.linux' and |
784 buildername == 'linux_full_bisect_builder')): | 807 buildername == 'linux_full_bisect_builder')): |
785 return None | 808 return None |
786 else: | 809 else: |
787 return self.m.archive.legacy_upload_url( | 810 return self.m.archive.legacy_upload_url( |
788 master_config.get('build_gs_bucket'), | 811 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): | 852 def get_compile_targets_for_scripts(self): |
830 return self.m.python( | 853 return self.m.python( |
831 name='get compile targets for scripts', | 854 name='get compile targets for scripts', |
832 script=self.m.path['checkout'].join( | 855 script=self.m.path['checkout'].join( |
833 'testing', 'scripts', 'get_compile_targets.py'), | 856 'testing', 'scripts', 'get_compile_targets.py'), |
834 args=[ | 857 args=[ |
835 '--output', self.m.json.output(), | 858 '--output', self.m.json.output(), |
836 '--', | 859 '--', |
837 ] + self.get_common_args_for_scripts(), | 860 ] + self.get_common_args_for_scripts(), |
838 step_test_data=lambda: self.m.json.test_api.output({})) | 861 step_test_data=lambda: self.m.json.test_api.output({})) |
OLD | NEW |