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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 # Recipe module for Skia Swarming perf. 6 # Recipe module for Skia Swarming perf.
7 7
8 8
9 DEPS = [ 9 DEPS = [
10 'build/file',
10 'core', 11 'core',
11 'recipe_engine/json', 12 'recipe_engine/json',
12 'recipe_engine/path', 13 'recipe_engine/path',
13 'recipe_engine/platform', 14 'recipe_engine/platform',
14 'recipe_engine/properties', 15 'recipe_engine/properties',
15 'recipe_engine/raw_io', 16 'recipe_engine/raw_io',
16 'run', 17 'run',
18 'flavor',
19 'vars',
17 ] 20 ]
18 21
19 22
20 TEST_BUILDERS = { 23 TEST_BUILDERS = {
21 'client.skia': { 24 'client.skia': {
22 'skiabot-linux-swarm-000': [ 25 'skiabot-linux-swarm-000': [
23 'Perf-Win-MSVC-GCE-CPU-AVX2-x86_64-Release', 26 'Perf-Win-MSVC-GCE-CPU-AVX2-x86_64-Release',
24 'Perf-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug', 27 'Perf-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug',
25 'Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot', 28 'Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot',
26 'Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind', 29 'Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind',
27 'Perf-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release', 30 'Perf-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release',
28 'Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-VisualBench', 31 'Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-VisualBench',
29 ], 32 ],
30 }, 33 },
31 } 34 }
32 35
33 36
37 def perf_steps(api):
38 """Run Skia benchmarks."""
39 if api.vars.upload_perf_results:
40 api.flavor.create_clean_device_dir(
41 api.flavor.device_dirs.perf_data_dir)
42
43 # Run nanobench.
44 properties = [
45 '--properties',
46 'gitHash', api.vars.got_revision,
47 'build_number', api.vars.build_number,
48 ]
49 if api.vars.is_trybot:
50 properties.extend([
51 'issue', api.vars.issue,
52 'patchset', api.vars.patchset,
53 ])
54
55 target = 'nanobench'
56 if 'VisualBench' in api.vars.builder_name:
57 target = 'visualbench'
58 args = [
59 target,
60 '--undefok', # This helps branches that may not know new flags.
61 '-i', api.flavor.device_dirs.resource_dir,
62 '--skps', api.flavor.device_dirs.skp_dir,
63 '--images', api.flavor.device_path_join(
64 api.flavor.device_dirs.images_dir, 'nanobench'),
65 ]
66
67 skip_flag = None
68 if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU':
69 skip_flag = '--nogpu'
70 elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU':
71 skip_flag = '--nocpu'
72 if skip_flag:
73 args.append(skip_flag)
74 args.extend(api.vars.nanobench_flags)
75
76 if api.vars.upload_perf_results:
77 json_path = api.flavor.device_path_join(
78 api.flavor.device_dirs.perf_data_dir,
79 'nanobench_%s.json' % api.vars.got_revision)
80 args.extend(['--outResultsFile', json_path])
81 args.extend(properties)
82
83 keys_blacklist = ['configuration', 'role', 'is_trybot']
84 args.append('--key')
85 for k in sorted(api.vars.builder_cfg.keys()):
86 if not k in keys_blacklist:
87 args.extend([k, api.vars.builder_cfg[k]])
88
89 api.run(api.flavor.step, target, cmd=args,
90 abort_on_failure=False,
91 env=api.vars.default_env)
92
93 # See skia:2789.
94 if ('Valgrind' in api.vars.builder_name and
95 api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU'):
96 abandonGpuContext = list(args)
97 abandonGpuContext.extend(['--abandonGpuContext', '--nocpu'])
98 api.run(api.flavor.step,
99 '%s --abandonGpuContext' % target,
100 cmd=abandonGpuContext, abort_on_failure=False,
101 env=api.vars.default_env)
102
103 # Copy results to swarming out dir.
104 if api.vars.upload_perf_results:
105 api.file.makedirs('perf_dir', api.vars.perf_data_dir)
106 api.flavor.copy_directory_contents_to_host(
107 api.flavor.device_dirs.perf_data_dir,
108 api.vars.perf_data_dir)
109
110
34 def RunSteps(api): 111 def RunSteps(api):
35 api.core.setup() 112 api.core.setup()
36 api.core.perf_steps() 113 api.flavor.install()
37 api.core.cleanup_steps() 114 perf_steps(api)
115 api.flavor.cleanup_steps()
38 api.run.check_failure() 116 api.run.check_failure()
39 117
40 118
41 def GenTests(api): 119 def GenTests(api):
42 def AndroidTestData(builder): 120 def AndroidTestData(builder):
43 test_data = ( 121 test_data = (
44 api.step_data( 122 api.step_data(
45 'get EXTERNAL_STORAGE dir', 123 'get EXTERNAL_STORAGE dir',
46 stdout=api.raw_io.output('/storage/emulated/legacy')) + 124 stdout=api.raw_io.output('/storage/emulated/legacy')) +
47 api.step_data( 125 api.step_data(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 api.path.exists( 190 api.path.exists(
113 api.path['slave_build'].join('skia'), 191 api.path['slave_build'].join('skia'),
114 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets', 192 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
115 'skimage', 'VERSION'), 193 'skimage', 'VERSION'),
116 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets', 194 api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
117 'skp', 'VERSION'), 195 'skp', 'VERSION'),
118 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt') 196 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
119 ) + 197 ) +
120 api.platform('win', 64) 198 api.platform('win', 64)
121 ) 199 )
OLDNEW
« 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