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

Side by Side Diff: scripts/slave/recipe_modules/ct_swarming/api.py

Issue 1441173003: CT Skia recipe to run DM on the top 10k SKPs using swarming (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build@ct-swarming-perf
Patch Set: Fix Created 5 years 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 5
6 from recipe_engine import recipe_api 6 from recipe_engine import recipe_api
7 7
8 8
9 CT_GS_BUCKET = 'cluster-telemetry' 9 CT_GS_BUCKET = 'cluster-telemetry'
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 # Download archives. 78 # Download archives.
79 wpr_dir = page_sets_dir.join('data') 79 wpr_dir = page_sets_dir.join('data')
80 self.m.file.makedirs('Create WPR dir', wpr_dir) 80 self.m.file.makedirs('Create WPR dir', wpr_dir)
81 self.m.gsutil.download( 81 self.m.gsutil.download(
82 bucket=CT_GS_BUCKET, 82 bucket=CT_GS_BUCKET,
83 source='swarming/webpage_archives/%s/slave%s/*' % (page_type, 83 source='swarming/webpage_archives/%s/slave%s/*' % (page_type,
84 slave_num), 84 slave_num),
85 dest=wpr_dir) 85 dest=wpr_dir)
86 86
87 def download_skps(self, page_type, slave_num, skps_chromium_build):
88 """Downloads SKPs corresponding to the specified page type, slave and build.
89
90 The SKPs are downloaded into subdirectories in the downloads_dir.
91
92 Args:
93 page_type: str. The CT page type. Eg: 1k, 10k.
94 slave_num: int. The number of the slave used to determine which GS
95 directory to download from. Eg: for the top 1k, slave1 will
96 contain SKPs from webpages 1-10, slave2 will contain 11-20.
97 skps_chromium_build: str. The build the SKPs were captured from.
98 """
99 skps_dir = self.downloads_dir.join('slave%s' % slave_num, 'skps')
100 self.m.file.makedirs('Create SKPs dir', skps_dir)
borenet 2015/11/24 19:34:28 Should you delete the directory before creating it
rmistry 2015/11/24 19:58:41 Sure. Done.
101 full_source = 'gs://%s/skps/%s/%s/slave%s/*' % (
102 CT_GS_BUCKET, page_type, skps_chromium_build, slave_num)
103 self.m.gsutil(['-m', 'cp', full_source, skps_dir])
104
87 def create_isolated_gen_json(self, isolate_path, base_dir, os_type, 105 def create_isolated_gen_json(self, isolate_path, base_dir, os_type,
88 slave_num, extra_variables): 106 slave_num, extra_variables):
89 """Creates an isolated.gen.json file. 107 """Creates an isolated.gen.json file.
90 108
91 Args: 109 Args:
92 isolate_path: path obj. Path to the isolate file. 110 isolate_path: path obj. Path to the isolate file.
93 base_dir: path obj. Dir that is the base of all paths in the isolate file. 111 base_dir: path obj. Dir that is the base of all paths in the isolate file.
94 os_type: str. The OS type to use when archiving the isolate file. 112 os_type: str. The OS type to use when archiving the isolate file.
95 Eg: linux. 113 Eg: linux.
96 slave_num: int. The slave we want to create isolated.gen.json file for. 114 slave_num: int. The slave we want to create isolated.gen.json file for.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 self.m.swarming.trigger(swarming_tasks) 175 self.m.swarming.trigger(swarming_tasks)
158 return swarming_tasks 176 return swarming_tasks
159 177
160 def collect_swarming_tasks(self, swarming_tasks): 178 def collect_swarming_tasks(self, swarming_tasks):
161 """Collects all swarming tasks triggered by this recipe. 179 """Collects all swarming tasks triggered by this recipe.
162 180
163 Args: 181 Args:
164 swarming_tasks: list of swarming.SwarmingTask instances. 182 swarming_tasks: list of swarming.SwarmingTask instances.
165 """ 183 """
166 return self.m.swarming.collect(swarming_tasks) 184 return self.m.swarming.collect(swarming_tasks)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698