| Index: scripts/slave/recipes/perf/ct_top1k_rr_perf.py
|
| diff --git a/scripts/slave/recipes/perf/ct_top1k_rr_perf.py b/scripts/slave/recipes/perf/ct_top1k_rr_perf.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0e143ae522df12391db972983d5acd5f3954a39d
|
| --- /dev/null
|
| +++ b/scripts/slave/recipes/perf/ct_top1k_rr_perf.py
|
| @@ -0,0 +1,112 @@
|
| +# Copyright 2015 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +
|
| +DEPS = [
|
| + 'archive',
|
| + 'ct_swarming',
|
| + 'file',
|
| + 'properties',
|
| + 'time',
|
| +]
|
| +
|
| +
|
| +CT_PAGE_TYPE = '1k'
|
| +CT_BINARY = 'run_chromium_perf_swarming'
|
| +CT_ISOLATE_TEMPLATE = 'ct_top1k.isolate.tmpl'
|
| +
|
| +# Number of slaves to shard CT runs to.
|
| +# TODO(rmistry): Change the below to 100 when ready to run the full top 1k.
|
| +CT_NUM_SLAVES = 2
|
| +
|
| +
|
| +def _DownloadAndExtractBinary(api):
|
| + """Downloads the binary from the revision passed to the recipe."""
|
| + api.archive.download_and_unzip_build(
|
| + step_name='Download and Extract Binary',
|
| + target='Release',
|
| + build_url=None, # This is a required parameter, but has no effect.
|
| + build_archive_url=api.properties['parent_build_archive_url'])
|
| +
|
| +
|
| +def RunSteps(api):
|
| + # Figure out which benchmark to use.
|
| + buildername = api.properties['buildername']
|
| + if 'Repaint' in buildername:
|
| + benchmark = 'repaint'
|
| + elif 'RR' in buildername:
|
| + benchmark = 'rasterize_and_record_micro'
|
| + else:
|
| + raise Exception('Do not recognise the buildername %s.' % buildername)
|
| +
|
| + # Checkout chromium and swarming.
|
| + api.ct_swarming.checkout_dependencies()
|
| +
|
| + # Download the prebuilt chromium binary.
|
| + _DownloadAndExtractBinary(api)
|
| +
|
| + # Download Cluster Telemetry binary.
|
| + api.ct_swarming.download_CT_binary(CT_BINARY)
|
| +
|
| + # List that will contain all .isolated.gen.json file locations.
|
| + isolated_gen_json_files = []
|
| +
|
| + # Record how long the step took in swarming tasks.
|
| + swarming_start_time = api.time.time()
|
| +
|
| + for slave_num in range(1, CT_NUM_SLAVES + 1):
|
| + slave_dir = api.ct_swarming.downloads_dir.join('slave%s' % slave_num)
|
| +
|
| + # Download page sets and archives.
|
| + api.ct_swarming.download_page_artifacts(CT_PAGE_TYPE, slave_num, slave_dir)
|
| +
|
| + # TODO(rmistry): Remove the entire below section after crrev.com/1410353007
|
| + # is submitted.
|
| + api.file.copy(
|
| + 'copy %s' % CT_ISOLATE_TEMPLATE,
|
| + '/repos/chromium/src/chrome/%s' % CT_ISOLATE_TEMPLATE,
|
| + api.ct_swarming.chromium_src_dir.join('chrome', CT_ISOLATE_TEMPLATE))
|
| + for f in ['run_ct_top1k.py', 'path_util.py']:
|
| + api.file.copy(
|
| + 'copy %s' % f,
|
| + '/repos/chromium/src/content/test/ct/%s' % f,
|
| + api.ct_swarming.chromium_src_dir.join('content', 'test', 'ct', f))
|
| +
|
| + # Create this slave's isolate file from the CT_ISOLATE_TEMPLATE.
|
| + isolate_dir = api.ct_swarming.chromium_src_dir.join('chrome')
|
| + isolate_template_path = isolate_dir.join(CT_ISOLATE_TEMPLATE)
|
| + generated_isolate_path = isolate_dir.join(
|
| + 'slave%s.ct_top1k.isolate' % slave_num)
|
| + with open(str(generated_isolate_path), 'wb') as fout:
|
| + with open(str(isolate_template_path), 'rb') as fin:
|
| + for line in fin:
|
| + fout.write(line.replace('[[SLAVE_NUM]]', str(slave_num))
|
| + .replace('[[MASTER]]', api.properties['mastername'])
|
| + .replace('[[BUILDER]]', api.properties['buildername'])
|
| + .replace('[[GIT_HASH]]',
|
| + api.properties['git_revision'])
|
| + .replace('[[BENCHMARK]]', benchmark))
|
| +
|
| + # Create the slave's isolated.gen.json file to use for batcharchiving.
|
| + isolated_gen_json_files.append(
|
| + api.ct_swarming.create_isolated_gen_json(
|
| + generated_isolate_path, isolate_dir, 'linux', slave_num))
|
| +
|
| + # Batcharchive everything on the isolate server for efficiency.
|
| + api.ct_swarming.batcharchive(isolated_gen_json_files)
|
| +
|
| + # Trigger all swarming tasks.
|
| + for slave_num in range(1, CT_NUM_SLAVES + 1):
|
| + api.ct_swarming.trigger_swarming_task(
|
| + 'ct-1k-task-%s' % slave_num, slave_num,
|
| + dimensions=['os Ubuntu', 'gpu 10de'])
|
| +
|
| + # Now collect all tasks.
|
| + for slave_num in range(1, CT_NUM_SLAVES + 1):
|
| + api.ct_swarming.collect_swarming_task(slave_num)
|
| +
|
| + api.ct_swarming.cleanup()
|
| +
|
| + print ('Running isolating, triggering and collecting swarming tasks took a '
|
| + 'total of %s seconds') % (api.time.time() - swarming_start_time)
|
|
|