| 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 | 5 |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 def setup(self, running_in_swarming=False): | 151 def setup(self, running_in_swarming=False): |
| 152 """Prepare the bot to run.""" | 152 """Prepare the bot to run.""" |
| 153 # Setup | 153 # Setup |
| 154 self.failed = [] | 154 self.failed = [] |
| 155 | 155 |
| 156 self.builder_name = self.m.properties['buildername'] | 156 self.builder_name = self.m.properties['buildername'] |
| 157 self.master_name = self.m.properties['mastername'] | 157 self.master_name = self.m.properties['mastername'] |
| 158 self.slave_name = self.m.properties['slavename'] | 158 self.slave_name = self.m.properties['slavename'] |
| 159 | 159 |
| 160 self.slave_dir = self.m.infra_paths['slave_build'] | 160 self.slave_dir = self.m.path['slave_build'] |
| 161 self.skia_dir = self.slave_dir.join('skia') | 161 self.skia_dir = self.slave_dir.join('skia') |
| 162 self.infrabots_dir = self.skia_dir.join('infra', 'bots') | 162 self.infrabots_dir = self.skia_dir.join('infra', 'bots') |
| 163 | 163 |
| 164 self.default_env = {} | 164 self.default_env = {} |
| 165 if running_in_swarming: | 165 if running_in_swarming: |
| 166 self.default_env['CHROME_HEADLESS'] = '1' | 166 self.default_env['CHROME_HEADLESS'] = '1' |
| 167 depot_tools = self.slave_dir.join('depot_tools') | 167 depot_tools = self.slave_dir.join('depot_tools') |
| 168 self.default_env['PATH'] = '%s:%%(PATH)s' % depot_tools | 168 self.default_env['PATH'] = '%s:%%(PATH)s' % depot_tools |
| 169 | 169 |
| 170 # We run through this recipe in one of two ways: | 170 # We run through this recipe in one of two ways: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 190 # Set some important variables. | 190 # Set some important variables. |
| 191 self.resource_dir = self.skia_dir.join('resources') | 191 self.resource_dir = self.skia_dir.join('resources') |
| 192 self.images_dir = self.slave_dir.join('images') | 192 self.images_dir = self.slave_dir.join('images') |
| 193 if self.running_in_swarming: | 193 if self.running_in_swarming: |
| 194 self.swarming_out_dir = self.m.properties['swarm_out_dir'] | 194 self.swarming_out_dir = self.m.properties['swarm_out_dir'] |
| 195 self.out_dir = self.slave_dir.join('out') | 195 self.out_dir = self.slave_dir.join('out') |
| 196 self.local_skp_dir = self.slave_dir.join('skps') | 196 self.local_skp_dir = self.slave_dir.join('skps') |
| 197 else: | 197 else: |
| 198 self.out_dir = self.m.path['checkout'].join('out', self.builder_name) | 198 self.out_dir = self.m.path['checkout'].join('out', self.builder_name) |
| 199 self.local_skp_dir = self.slave_dir.join('playback', 'skps') | 199 self.local_skp_dir = self.slave_dir.join('playback', 'skps') |
| 200 self.tmp_dir = self.m.infra_paths['slave_build'].join('tmp') | 200 self.tmp_dir = self.m.path['slave_build'].join('tmp') |
| 201 | 201 |
| 202 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM) | 202 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM) |
| 203 | 203 |
| 204 self.device_dirs = None | 204 self.device_dirs = None |
| 205 self._ccache = None | 205 self._ccache = None |
| 206 self._checked_for_ccache = False | 206 self._checked_for_ccache = False |
| 207 self.configuration = self.builder_spec['configuration'] | 207 self.configuration = self.builder_spec['configuration'] |
| 208 self.default_env.update({'SKIA_OUT': self.out_dir, | 208 self.default_env.update({'SKIA_OUT': self.out_dir, |
| 209 'BUILDTYPE': self.configuration}) | 209 'BUILDTYPE': self.configuration}) |
| 210 self.default_env.update(self.builder_spec['env']) | 210 self.default_env.update(self.builder_spec['env']) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 def _run_once(self, fn, *args, **kwargs): | 251 def _run_once(self, fn, *args, **kwargs): |
| 252 if not hasattr(self, '_already_ran'): | 252 if not hasattr(self, '_already_ran'): |
| 253 self._already_ran = {} | 253 self._already_ran = {} |
| 254 if not fn.__name__ in self._already_ran: | 254 if not fn.__name__ in self._already_ran: |
| 255 self._already_ran[fn.__name__] = True | 255 self._already_ran[fn.__name__] = True |
| 256 fn(*args, **kwargs) | 256 fn(*args, **kwargs) |
| 257 | 257 |
| 258 def update_repo(self, repo): | 258 def update_repo(self, repo): |
| 259 """Update an existing repo. This is safe to call without gen_steps.""" | 259 """Update an existing repo. This is safe to call without gen_steps.""" |
| 260 repo_path = self.m.infra_paths['slave_build'].join(repo.name) | 260 repo_path = self.m.path['slave_build'].join(repo.name) |
| 261 if self.m.path.exists(repo_path): | 261 if self.m.path.exists(repo_path): |
| 262 if self.m.platform.is_win: | 262 if self.m.platform.is_win: |
| 263 git = 'git.bat' | 263 git = 'git.bat' |
| 264 else: | 264 else: |
| 265 git = 'git' | 265 git = 'git' |
| 266 self.m.step('git remote set-url', | 266 self.m.step('git remote set-url', |
| 267 cmd=[git, 'remote', 'set-url', 'origin', repo.url], | 267 cmd=[git, 'remote', 'set-url', 'origin', repo.url], |
| 268 cwd=repo_path, | 268 cwd=repo_path, |
| 269 infra_step=True) | 269 infra_step=True) |
| 270 self.m.step('git fetch', | 270 self.m.step('git fetch', |
| 271 cmd=[git, 'fetch'], | 271 cmd=[git, 'fetch'], |
| 272 cwd=repo_path, | 272 cwd=repo_path, |
| 273 infra_step=True) | 273 infra_step=True) |
| 274 self.m.step('git reset', | 274 self.m.step('git reset', |
| 275 cmd=[git, 'reset', '--hard', repo.revision], | 275 cmd=[git, 'reset', '--hard', repo.revision], |
| 276 cwd=repo_path, | 276 cwd=repo_path, |
| 277 infra_step=True) | 277 infra_step=True) |
| 278 self.m.step('git clean', | 278 self.m.step('git clean', |
| 279 cmd=[git, 'clean', '-d', '-f'], | 279 cmd=[git, 'clean', '-d', '-f'], |
| 280 cwd=repo_path, | 280 cwd=repo_path, |
| 281 infra_step=True) | 281 infra_step=True) |
| 282 | 282 |
| 283 def checkout_steps(self): | 283 def checkout_steps(self): |
| 284 """Run the steps to obtain a checkout of Skia.""" | 284 """Run the steps to obtain a checkout of Skia.""" |
| 285 if self.running_in_swarming: | 285 if self.running_in_swarming: |
| 286 # We should've obtained the Skia checkout through isolates, so we don't | 286 # We should've obtained the Skia checkout through isolates, so we don't |
| 287 # need to perform the checkout ourselves. | 287 # need to perform the checkout ourselves. |
| 288 self.m.path['checkout'] = self.m.infra_paths['slave_build'].join('skia') | 288 self.m.path['checkout'] = self.m.path['slave_build'].join('skia') |
| 289 self.got_revision = self.m.properties['revision'] | 289 self.got_revision = self.m.properties['revision'] |
| 290 return | 290 return |
| 291 | 291 |
| 292 # Initial cleanup. | 292 # Initial cleanup. |
| 293 gclient_cfg = self.m.gclient.make_config() | 293 gclient_cfg = self.m.gclient.make_config() |
| 294 skia = gclient_cfg.solutions.add() | 294 skia = gclient_cfg.solutions.add() |
| 295 skia.name = 'skia' | 295 skia.name = 'skia' |
| 296 skia.managed = False | 296 skia.managed = False |
| 297 skia.url = global_constants.SKIA_REPO | 297 skia.url = global_constants.SKIA_REPO |
| 298 skia.revision = self.m.properties.get('revision') or 'origin/master' | 298 skia.revision = self.m.properties.get('revision') or 'origin/master' |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 self.run( | 705 self.run( |
| 706 self.m.python, | 706 self.m.python, |
| 707 'Upload DM Results', | 707 'Upload DM Results', |
| 708 script=self.resource('upload_dm_results.py'), | 708 script=self.resource('upload_dm_results.py'), |
| 709 args=[ | 709 args=[ |
| 710 self.dm_dir, | 710 self.dm_dir, |
| 711 self.got_revision, | 711 self.got_revision, |
| 712 self.builder_name, | 712 self.builder_name, |
| 713 self.m.properties['buildnumber'], | 713 self.m.properties['buildnumber'], |
| 714 self.m.properties['issue'] if self.is_trybot else '', | 714 self.m.properties['issue'] if self.is_trybot else '', |
| 715 self.m.infra_paths['slave_build'].join('skia', 'common', 'py', 'ut
ils'), | 715 self.m.path['slave_build'].join('skia', 'common', 'py', 'utils'), |
| 716 ], | 716 ], |
| 717 cwd=self.m.path['checkout'], | 717 cwd=self.m.path['checkout'], |
| 718 env=self.gsutil_env_chromium_skia_gm, | 718 env=self.gsutil_env_chromium_skia_gm, |
| 719 abort_on_failure=False, | 719 abort_on_failure=False, |
| 720 infra_step=True) | 720 infra_step=True) |
| 721 | 721 |
| 722 # See skia:2789. | 722 # See skia:2789. |
| 723 if ('Valgrind' in self.builder_name and | 723 if ('Valgrind' in self.builder_name and |
| 724 self.builder_cfg.get('cpu_or_gpu') == 'GPU'): | 724 self.builder_cfg.get('cpu_or_gpu') == 'GPU'): |
| 725 abandonGpuContext = list(args) | 725 abandonGpuContext = list(args) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 if self.upload_perf_results: | 810 if self.upload_perf_results: |
| 811 self.m.file.makedirs('perf_dir', self.perf_data_dir) | 811 self.m.file.makedirs('perf_dir', self.perf_data_dir) |
| 812 self.flavor.copy_directory_contents_to_host( | 812 self.flavor.copy_directory_contents_to_host( |
| 813 self.device_dirs.perf_data_dir, self.perf_data_dir) | 813 self.device_dirs.perf_data_dir, self.perf_data_dir) |
| 814 | 814 |
| 815 if self.running_in_swarming: | 815 if self.running_in_swarming: |
| 816 # If we're running in Swarming, we wrote the results into the Swarming | 816 # If we're running in Swarming, we wrote the results into the Swarming |
| 817 # out dir, so we don't need to upload. | 817 # out dir, so we don't need to upload. |
| 818 return | 818 return |
| 819 | 819 |
| 820 gsutil_path = self.m.infra_paths['depot_tools'].join( | 820 gsutil_path = self.m.path['depot_tools'].join( |
| 821 'third_party', 'gsutil', 'gsutil') | 821 'third_party', 'gsutil', 'gsutil') |
| 822 upload_args = [self.builder_name, self.m.properties['buildnumber'], | 822 upload_args = [self.builder_name, self.m.properties['buildnumber'], |
| 823 self.perf_data_dir, self.got_revision, gsutil_path] | 823 self.perf_data_dir, self.got_revision, gsutil_path] |
| 824 if self.is_trybot: | 824 if self.is_trybot: |
| 825 upload_args.append(self.m.properties['issue']) | 825 upload_args.append(self.m.properties['issue']) |
| 826 self.run(self.m.python, | 826 self.run(self.m.python, |
| 827 'Upload %s Results' % target, | 827 'Upload %s Results' % target, |
| 828 script=self.resource('upload_bench_results.py'), | 828 script=self.resource('upload_bench_results.py'), |
| 829 args=upload_args, | 829 args=upload_args, |
| 830 cwd=self.m.path['checkout'], | 830 cwd=self.m.path['checkout'], |
| (...skipping 26 matching lines...) Expand all Loading... |
| 857 # Don't bother to include role, which is always Test. | 857 # Don't bother to include role, which is always Test. |
| 858 # TryBots are uploaded elsewhere so they can use the same key. | 858 # TryBots are uploaded elsewhere so they can use the same key. |
| 859 blacklist = ['role', 'is_trybot'] | 859 blacklist = ['role', 'is_trybot'] |
| 860 | 860 |
| 861 flat = [] | 861 flat = [] |
| 862 for k in sorted(self.builder_cfg.keys()): | 862 for k in sorted(self.builder_cfg.keys()): |
| 863 if k not in blacklist: | 863 if k not in blacklist: |
| 864 flat.append(k) | 864 flat.append(k) |
| 865 flat.append(self.builder_cfg[k]) | 865 flat.append(self.builder_cfg[k]) |
| 866 return flat | 866 return flat |
| OLD | NEW |