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

Unified Diff: content/test/ct/run_ct_top1k.py

Issue 1410353007: Add CT isolate file and CT script that will be run on swarming slaves (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Setup executable bit for presubmit Created 5 years, 1 month 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
« chrome/ct_top1k.isolate.tmpl ('K') | « content/test/ct/path_util.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
« chrome/ct_top1k.isolate.tmpl ('K') | « content/test/ct/path_util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698