Yuqian Li | c81aaaa | 2017-10-16 12:24:43 -0400 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | |
| 6 | # Recipe module for Skia Swarming calmbench. |
| 7 | |
| 8 | DEPS = [ |
Yuqian Li | c81aaaa | 2017-10-16 12:24:43 -0400 | [diff] [blame] | 9 | 'flavor', |
| 10 | 'recipe_engine/context', |
| 11 | 'recipe_engine/file', |
| 12 | 'recipe_engine/path', |
| 13 | 'recipe_engine/properties', |
| 14 | 'recipe_engine/python', |
| 15 | 'recipe_engine/raw_io', |
| 16 | 'recipe_engine/step', |
| 17 | 'recipe_engine/time', |
| 18 | 'run', |
| 19 | 'vars', |
| 20 | ] |
| 21 | |
| 22 | def RunSteps(api): |
Eric Boren | b702316 | 2018-05-04 13:46:15 -0400 | [diff] [blame] | 23 | api.vars.setup() |
| 24 | api.file.ensure_directory('makedirs tmp_dir', api.vars.tmp_dir) |
| 25 | api.flavor.setup() |
| 26 | |
Yuqian Li | c81aaaa | 2017-10-16 12:24:43 -0400 | [diff] [blame] | 27 | api.flavor.install(skps=True, svgs=True) |
Eric Boren | 9599b0f | 2018-04-17 15:55:57 -0400 | [diff] [blame] | 28 | api.file.ensure_directory('makedirs perf', api.vars.swarming_out_dir) |
| 29 | |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 30 | skia_dir = api.path['start_dir'].join('skia') |
| 31 | with api.context(cwd=skia_dir): |
Yuqian Li | c81aaaa | 2017-10-16 12:24:43 -0400 | [diff] [blame] | 32 | extra_arg = '--svgs %s --skps %s' % (api.flavor.device_dirs.svg_dir, |
| 33 | api.flavor.device_dirs.skp_dir) |
Yuqian Li | ab246cb | 2017-11-02 13:48:23 -0400 | [diff] [blame] | 34 | |
| 35 | # measuring multi-picture-draw in our multi-threaded CPU test is inaccurate |
| 36 | if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU': |
| 37 | extra_arg += ' --mpd false' |
| 38 | config = "8888" |
| 39 | else: |
| 40 | config = "gl" |
| 41 | |
| 42 | command = [ |
Yuqian Li | 4a577af | 2018-01-05 11:13:43 -0500 | [diff] [blame] | 43 | 'python', |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 44 | skia_dir.join('tools', 'calmbench', 'ab.py'), |
Yuqian Li | 4a577af | 2018-01-05 11:13:43 -0500 | [diff] [blame] | 45 | api.vars.swarming_out_dir, |
| 46 | 'modified', 'master', |
Eric Boren | 322a859 | 2018-06-01 10:08:53 -0400 | [diff] [blame] | 47 | api.vars.build_dir.join('nanobench'), |
| 48 | api.vars.build_dir.join('ParentRevision', 'nanobench'), |
Yuqian Li | 4a577af | 2018-01-05 11:13:43 -0500 | [diff] [blame] | 49 | extra_arg, extra_arg, |
| 50 | 2, # reps |
| 51 | "false", # skipbase |
| 52 | config, |
| 53 | -1, # threads; let ab.py decide the threads |
| 54 | "false", # noinit |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 55 | "--githash", api.properties['revision'], |
Yuqian Li | 4a577af | 2018-01-05 11:13:43 -0500 | [diff] [blame] | 56 | "--concise" |
Yuqian Li | c81aaaa | 2017-10-16 12:24:43 -0400 | [diff] [blame] | 57 | ] |
Yuqian Li | 228da62 | 2017-10-26 15:38:30 -0400 | [diff] [blame] | 58 | |
| 59 | keys_blacklist = ['configuration', 'role', 'test_filter'] |
Yuqian Li | 4a577af | 2018-01-05 11:13:43 -0500 | [diff] [blame] | 60 | command.append('--keys') |
Yuqian Li | 228da62 | 2017-10-26 15:38:30 -0400 | [diff] [blame] | 61 | for k in sorted(api.vars.builder_cfg.keys()): |
| 62 | if not k in keys_blacklist: |
| 63 | command.extend([k, api.vars.builder_cfg[k]]) |
| 64 | |
Yuqian Li | c81aaaa | 2017-10-16 12:24:43 -0400 | [diff] [blame] | 65 | api.run(api.step, 'Run calmbench', cmd=command) |
| 66 | api.run.check_failure() |
| 67 | |
| 68 | def GenTests(api): |
Yuqian Li | ab246cb | 2017-11-02 13:48:23 -0400 | [diff] [blame] | 69 | builders = [ |
| 70 | "Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All", |
| 71 | "Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All", |
| 72 | ] |
Yuqian Li | c81aaaa | 2017-10-16 12:24:43 -0400 | [diff] [blame] | 73 | |
Yuqian Li | ab246cb | 2017-11-02 13:48:23 -0400 | [diff] [blame] | 74 | for builder in builders: |
| 75 | test = ( |
| 76 | api.test(builder) + |
| 77 | api.properties(buildername=builder, |
| 78 | repository='https://skia.googlesource.com/skia.git', |
| 79 | revision='abc123', |
| 80 | path_config='kitchen', |
| 81 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| 82 | api.path.exists( |
| 83 | api.path['start_dir'].join('skia'), |
| 84 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
| 85 | 'svg', 'VERSION'), |
| 86 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
| 87 | 'skp', 'VERSION'), |
| 88 | ) |
| 89 | ) |
| 90 | |
| 91 | yield test |