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