Chromium Code Reviews| Index: content/test/ct/run_ct_top1k.py |
| diff --git a/content/test/ct/run_ct_top1k.py b/content/test/ct/run_ct_top1k.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..fdc4084101e374eb102907660350f170db84a684 |
| --- /dev/null |
| +++ b/content/test/ct/run_ct_top1k.py |
| @@ -0,0 +1,69 @@ |
| +#!/usr/bin/env python |
| +# Copyright (c) 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. |
| + |
| +"""This script is meant to be run on a Swarming slave.""" |
| + |
| +import argparse |
| +import os |
| +import path_util |
| +import shutil |
| +import stat |
| +import subprocess |
| +import sys |
| + |
| +path_util.AddDirToPathIfNeeded( |
| + path_util.GetChromiumSrcDir(), 'tools', 'telemetry') |
| +from catapult_base import cloud_storage |
| + |
| + |
| +CT_BINARY = 'run_chromium_perf_swarming' |
| +CT_BUCKET = 'cluster-telemetry' |
| +PARENT_DIR = os.path.dirname(os.path.realpath(__file__)) |
| + |
| + |
| +def main(): |
| + parser = argparse.ArgumentParser() |
| + parser.add_argument('-s', '--slave_num', required=True, |
| + help='The slave num of this CT run.') |
| + parser.add_argument('-b', '--benchmark', required=True, |
| + help='The benchmark to run.') |
| + parser.add_argument('-m', '--master', required=True, |
| + help='The master the builder is running on.') |
| + parser.add_argument('-c', '--builder', required=True, |
| + help='The builder that triggered this run.') |
| + parser.add_argument('-g', '--git_hash', required=True, |
| + help='The git hash the build was triggered at.') |
| + |
| + args = parser.parse_args() |
| + |
| + ct_binary_path = os.path.join(PARENT_DIR, CT_BINARY) |
| + chromium_binary_path = os.path.join( |
| + path_util.GetChromiumSrcDir(), 'out', 'Release') |
| + page_sets_dir = os.path.join( |
| + PARENT_DIR, 'slave%s' % args.slave_num, 'page_sets') |
| + telemetry_binaries_dir = os.path.join( |
| + path_util.GetChromiumSrcDir(), 'tools', 'perf') |
| + |
| + # Set executable bit on the binary. |
| + os.chmod(ct_binary_path, os.stat(ct_binary_path).st_mode | stat.S_IEXEC) |
| + |
| + # Run Cluster Telemetry. |
| + cmd = [ |
| + ct_binary_path, |
| + '--worker_num', args.slave_num, |
| + '--chromium_build', chromium_binary_path, |
| + '--benchmark_name', args.benchmark, |
| + '--telemetry_binaries_dir', telemetry_binaries_dir, |
| + '--page_sets_dir', page_sets_dir, |
| + '--master', args.master, |
| + '--builder', args.builder, |
| + '--git_hash', args.git_hash, |
| + '--alsologtostderr', |
| + ] |
| + subprocess.call(cmd) |
|
M-A Ruel
2015/11/16 20:22:02
return subprocess.call(cmd)
otherwise you silently
rmistry
2015/11/17 15:57:46
Done.
|
| + |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main()) |