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

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

Issue 1916263003: Reland "Skia: Maintain a checkout on swarming (compile) bots" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Fix expectations after roll Created 4 years, 7 months 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
« no previous file with comments | « scripts/slave/recipe_modules/skia/xsan_flavor.py ('k') | scripts/slave/recipes/skia/ct_skps.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 import shlex 7 import shlex
8 8
9 9
10 DEFAULT_TASK_EXPIRATION = 4*60*60 10 DEFAULT_TASK_EXPIRATION = 4*60*60
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 include_hashes: list of str. Hashes of the new includes. 154 include_hashes: list of str. Hashes of the new includes.
155 Returns: 155 Returns:
156 Updated hash of the .isolated file. 156 Updated hash of the .isolated file.
157 """ 157 """
158 isolated_file = self.isolated_file_path(task_name) 158 isolated_file = self.isolated_file_path(task_name)
159 self.m.python.inline('add_isolated_input', program=""" 159 self.m.python.inline('add_isolated_input', program="""
160 import json 160 import json
161 import sys 161 import sys
162 with open(sys.argv[1]) as f: 162 with open(sys.argv[1]) as f:
163 isolated = json.load(f) 163 isolated = json.load(f)
164 if not isolated.get('includes'):
165 isolated['includes'] = []
164 for h in sys.argv[2:]: 166 for h in sys.argv[2:]:
165 isolated['includes'].append(h) 167 isolated['includes'].append(h)
166 with open(sys.argv[1], 'w') as f: 168 with open(sys.argv[1], 'w') as f:
167 json.dump(isolated, f, sort_keys=True) 169 json.dump(isolated, f, sort_keys=True)
168 """, args=[isolated_file] + include_hashes) 170 """, args=[isolated_file] + include_hashes)
169 isolateserver = self.m.swarming_client.path.join('isolateserver.py') 171 isolateserver = self.m.swarming_client.path.join('isolateserver.py')
170 r = self.m.python('upload new .isolated file for %s' % task_name, 172 r = self.m.python('upload new .isolated file for %s' % task_name,
171 script=isolateserver, 173 script=isolateserver,
172 args=['archive', '--isolate-server', 174 args=['archive', '--isolate-server',
173 self.m.isolate.isolate_server, isolated_file], 175 self.m.isolate.isolate_server, isolated_file],
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 def collect_swarming_task_isolate_hash(self, swarming_task): 231 def collect_swarming_task_isolate_hash(self, swarming_task):
230 """Wait for the given swarming task to finish and return its output hash. 232 """Wait for the given swarming task to finish and return its output hash.
231 233
232 Args: 234 Args:
233 swarming_task: An instance of swarming.SwarmingTask. 235 swarming_task: An instance of swarming.SwarmingTask.
234 Returns: 236 Returns:
235 the hash of the isolate output of the task. 237 the hash of the isolate output of the task.
236 """ 238 """
237 res = self.collect_swarming_task(swarming_task) 239 res = self.collect_swarming_task(swarming_task)
238 return res.json.output['shards'][0]['isolated_out']['isolated'] 240 return res.json.output['shards'][0]['isolated_out']['isolated']
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/skia/xsan_flavor.py ('k') | scripts/slave/recipes/skia/ct_skps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698