aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules
diff options
context:
space:
mode:
authorGravatar rmistry <rmistry@google.com>2016-08-09 13:46:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-09 13:46:48 -0700
commit5eab99183c5dd74e24176daef8f742d61a7aeab3 (patch)
tree525942393c885178a2802b512a218577317815be /infra/bots/recipe_modules
parentd6113140f7ae8996f679ac6698a60fb8c1386da3 (diff)
Move ct_skps recipe from tools repo to Skia repo.
Also move the isolate file and script from Chromium repo to the Skia repo. BUG=skia:5620 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221413002 Review-Url: https://codereview.chromium.org/2221413002
Diffstat (limited to 'infra/bots/recipe_modules')
-rw-r--r--infra/bots/recipe_modules/ct/__init__.py11
-rw-r--r--infra/bots/recipe_modules/ct/api.py51
-rw-r--r--infra/bots/recipe_modules/run/api.py2
-rw-r--r--infra/bots/recipe_modules/vars/api.py3
4 files changed, 66 insertions, 1 deletions
diff --git a/infra/bots/recipe_modules/ct/__init__.py b/infra/bots/recipe_modules/ct/__init__.py
new file mode 100644
index 0000000000..b1dfd6886a
--- /dev/null
+++ b/infra/bots/recipe_modules/ct/__init__.py
@@ -0,0 +1,11 @@
+# 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 = [
+ 'build/file',
+ 'build/gsutil',
+ 'recipe_engine/path',
+ 'recipe_engine/step',
+ 'run',
+]
diff --git a/infra/bots/recipe_modules/ct/api.py b/infra/bots/recipe_modules/ct/api.py
new file mode 100644
index 0000000000..91478fb50e
--- /dev/null
+++ b/infra/bots/recipe_modules/ct/api.py
@@ -0,0 +1,51 @@
+# 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.
+
+
+from recipe_engine import recipe_api
+
+import re
+
+
+class CTApi(recipe_api.RecipeApi):
+ """Provides steps to run CT tasks."""
+
+ CT_GS_BUCKET = 'cluster-telemetry'
+
+ def download_swarming_skps(self, page_type, slave_num, skps_chromium_build,
+ dest_dir, start_range, num_skps):
+ """Downloads SKPs corresponding to the specified page type, slave and build.
+
+ The SKPs are stored in Google Storage in the following dirs in CT_GS_BUCKET:
+ /swarming/skps/${page_type}/${skps_chromium_build}/{start_range..end_num}/
+ The SKPs are downloaded into subdirectories in the dest_dir.
+
+ Args:
+ api: RecipeApi instance.
+ page_type: str. The CT page type. Eg: 1k, 10k.
+ slave_num: int. The number of the swarming bot.
+ skps_chromium_build: str. The build the SKPs were captured from.
+ dest_dir: path obj. The directory to download SKPs into.
+ start_range: int. The subdirectory number to start from.
+ num_skps: int. The total number of SKPs to download starting with
+ start_range.
+ """
+ slave_dest_dir = dest_dir.join('slave%s' % slave_num )
+ remote_dir = 'gs://%s/swarming/skps/%s/%s' % (
+ self.CT_GS_BUCKET, page_type, skps_chromium_build)
+
+ # Delete and recreate the local dir.
+ self.m.run.rmtree(slave_dest_dir)
+ self.m.file.makedirs(self.m.path.basename(slave_dest_dir), slave_dest_dir)
+
+ # Populate the empty local dir.
+ gsutil_args = ['-m', 'cp']
+ for i in range(start_range, start_range+num_skps):
+ gsutil_args.append('%s/%s/*.skp' % (str(remote_dir), i))
+ gsutil_args.append(str(slave_dest_dir))
+ try:
+ self.m.gsutil(gsutil_args, use_retry_wrapper=False)
+ except self.m.step.StepFailure: # pragma: nocover
+ # Some subdirectories might have no SKPs in them.
+ pass
diff --git a/infra/bots/recipe_modules/run/api.py b/infra/bots/recipe_modules/run/api.py
index 0763529cb4..eb0f8e679a 100644
--- a/infra/bots/recipe_modules/run/api.py
+++ b/infra/bots/recipe_modules/run/api.py
@@ -12,6 +12,8 @@ from recipe_engine import recipe_api
BUILD_PRODUCTS_ISOLATE_WHITELIST = [
'dm',
'dm.exe',
+ 'get_images_from_skps',
+ 'get_images_from_skps.exe',
'nanobench',
'nanobench.exe',
'*.so',
diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py
index 7936602fc7..3e0c7172de 100644
--- a/infra/bots/recipe_modules/vars/api.py
+++ b/infra/bots/recipe_modules/vars/api.py
@@ -49,7 +49,8 @@ class SkiaVarsApi(recipe_api.RecipeApi):
# Compile bots keep a persistent checkout.
self.persistent_checkout = (self.is_compile_bot or
- 'RecreateSKPs' in self.builder_name)
+ 'RecreateSKPs' in self.builder_name or
+ '-CT_' in self.builder_name)
if self.persistent_checkout:
if 'Win' in self.builder_name:
self.checkout_root = self.make_path('C:\\', 'b', 'work')