Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: infra/bots/recipes/swarm_perf.py

Issue 2198973002: [Recipes] Move test and perf steps into test and perf recipes (Closed) Base URL: https://skia.googlesource.com/skia.git@fix_buildbot_spec
Patch Set: ready for review Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « infra/bots/recipes/swarm_compile.py ('k') | infra/bots/recipes/swarm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/recipes/swarm_perf.py
diff --git a/infra/bots/recipes/swarm_perf.py b/infra/bots/recipes/swarm_perf.py
index 93332b707fc455e470deb7a0c9208ff3915c10e3..f2ea06ce87806f605a4317a4daa8efe469e290ea 100644
--- a/infra/bots/recipes/swarm_perf.py
+++ b/infra/bots/recipes/swarm_perf.py
@@ -7,6 +7,7 @@
DEPS = [
+ 'build/file',
'core',
'recipe_engine/json',
'recipe_engine/path',
@@ -14,6 +15,8 @@ DEPS = [
'recipe_engine/properties',
'recipe_engine/raw_io',
'run',
+ 'flavor',
+ 'vars',
]
@@ -31,10 +34,85 @@ TEST_BUILDERS = {
}
+def perf_steps(api):
+ """Run Skia benchmarks."""
+ if api.vars.upload_perf_results:
+ api.flavor.create_clean_device_dir(
+ api.flavor.device_dirs.perf_data_dir)
+
+ # Run nanobench.
+ properties = [
+ '--properties',
+ 'gitHash', api.vars.got_revision,
+ 'build_number', api.vars.build_number,
+ ]
+ if api.vars.is_trybot:
+ properties.extend([
+ 'issue', api.vars.issue,
+ 'patchset', api.vars.patchset,
+ ])
+
+ target = 'nanobench'
+ if 'VisualBench' in api.vars.builder_name:
+ target = 'visualbench'
+ args = [
+ target,
+ '--undefok', # This helps branches that may not know new flags.
+ '-i', api.flavor.device_dirs.resource_dir,
+ '--skps', api.flavor.device_dirs.skp_dir,
+ '--images', api.flavor.device_path_join(
+ api.flavor.device_dirs.images_dir, 'nanobench'),
+ ]
+
+ skip_flag = None
+ if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU':
+ skip_flag = '--nogpu'
+ elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU':
+ skip_flag = '--nocpu'
+ if skip_flag:
+ args.append(skip_flag)
+ args.extend(api.vars.nanobench_flags)
+
+ if api.vars.upload_perf_results:
+ json_path = api.flavor.device_path_join(
+ api.flavor.device_dirs.perf_data_dir,
+ 'nanobench_%s.json' % api.vars.got_revision)
+ args.extend(['--outResultsFile', json_path])
+ args.extend(properties)
+
+ keys_blacklist = ['configuration', 'role', 'is_trybot']
+ args.append('--key')
+ for k in sorted(api.vars.builder_cfg.keys()):
+ if not k in keys_blacklist:
+ args.extend([k, api.vars.builder_cfg[k]])
+
+ api.run(api.flavor.step, target, cmd=args,
+ abort_on_failure=False,
+ env=api.vars.default_env)
+
+ # See skia:2789.
+ if ('Valgrind' in api.vars.builder_name and
+ api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU'):
+ abandonGpuContext = list(args)
+ abandonGpuContext.extend(['--abandonGpuContext', '--nocpu'])
+ api.run(api.flavor.step,
+ '%s --abandonGpuContext' % target,
+ cmd=abandonGpuContext, abort_on_failure=False,
+ env=api.vars.default_env)
+
+ # Copy results to swarming out dir.
+ if api.vars.upload_perf_results:
+ api.file.makedirs('perf_dir', api.vars.perf_data_dir)
+ api.flavor.copy_directory_contents_to_host(
+ api.flavor.device_dirs.perf_data_dir,
+ api.vars.perf_data_dir)
+
+
def RunSteps(api):
api.core.setup()
- api.core.perf_steps()
- api.core.cleanup_steps()
+ api.flavor.install()
+ perf_steps(api)
+ api.flavor.cleanup_steps()
api.run.check_failure()
« no previous file with comments | « infra/bots/recipes/swarm_compile.py ('k') | infra/bots/recipes/swarm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698