OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 slave import recipe_api | 6 from slave import recipe_api |
7 from slave import recipe_config_types | 7 from slave import recipe_config_types |
8 from common.skia import builder_name_schema | 8 from common.skia import builder_name_schema |
9 from common.skia import global_constants | 9 from common.skia import global_constants |
10 from . import android_flavor | 10 from . import android_flavor |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 # or we may end up deleting our output on machines where they're the same. | 267 # or we may end up deleting our output on machines where they're the same. |
268 host_dm_dir = self.m.path['slave_build'].join('dm') | 268 host_dm_dir = self.m.path['slave_build'].join('dm') |
269 self.flavor.create_clean_host_dir(host_dm_dir) | 269 self.flavor.create_clean_host_dir(host_dm_dir) |
270 if str(host_dm_dir) != str(self.device_dirs.dm_dir): | 270 if str(host_dm_dir) != str(self.device_dirs.dm_dir): |
271 self.flavor.create_clean_device_dir(self.device_dirs.dm_dir) | 271 self.flavor.create_clean_device_dir(self.device_dirs.dm_dir) |
272 | 272 |
273 # Obtain the list of already-generated hashes. | 273 # Obtain the list of already-generated hashes. |
274 hash_filename = 'uninteresting_hashes.txt' | 274 hash_filename = 'uninteresting_hashes.txt' |
275 self.m.path.makedirs('tmp_dir', self.tmp_dir) | 275 self.m.path.makedirs('tmp_dir', self.tmp_dir) |
276 host_hashes_file = self.tmp_dir.join(hash_filename) | 276 host_hashes_file = self.tmp_dir.join(hash_filename) |
277 self.m.python('get uninteresting hashes', | 277 self.m.python.inline( |
278 script=self.skia_dir.join('tools', 'get_uploaded_hashes.py'), | 278 'get uninteresting hashes', |
279 args=['chromium-skia-gm', 'dm-images-v1', host_hashes_file], | 279 """ |
280 cwd=self.skia_dir) | 280 import contextlib |
| 281 import sys |
| 282 import urllib2 |
| 283 |
| 284 HASHES_URL = 'https://gold.skia.org/2/_/hashes' |
| 285 |
| 286 with open(sys.argv[1], 'w') as f: |
| 287 with contextlib.closing(urllib2.urlopen(HASHES_URL)) as w: |
| 288 f.write(w.read()) |
| 289 """, |
| 290 args=[host_hashes_file], |
| 291 cwd=self.skia_dir) |
281 if isinstance(self.device_dirs.tmp_dir, basestring): | 292 if isinstance(self.device_dirs.tmp_dir, basestring): |
282 hashes_file = self.device_dirs.tmp_dir + '/' + hash_filename | 293 hashes_file = self.device_dirs.tmp_dir + '/' + hash_filename |
283 else: | 294 else: |
284 hashes_file = self.device_dirs.tmp_dir.join(hash_filename) | 295 hashes_file = self.device_dirs.tmp_dir.join(hash_filename) |
285 self.flavor.copy_file_to_device(host_hashes_file, hashes_file) | 296 self.flavor.copy_file_to_device(host_hashes_file, hashes_file) |
286 | 297 |
287 # Run DM. | 298 # Run DM. |
288 args = [ | 299 args = [ |
289 'dm', | 300 'dm', |
290 '--verbose', | 301 '--verbose', |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 # TryBots are uploaded elsewhere so they can use the same key. | 442 # TryBots are uploaded elsewhere so they can use the same key. |
432 blacklist = ['role', 'is_trybot'] | 443 blacklist = ['role', 'is_trybot'] |
433 | 444 |
434 params = builder_name_schema.DictForBuilderName(self.c.BUILDER_NAME) | 445 params = builder_name_schema.DictForBuilderName(self.c.BUILDER_NAME) |
435 flat = [] | 446 flat = [] |
436 for k in sorted(params.keys()): | 447 for k in sorted(params.keys()): |
437 if k not in blacklist: | 448 if k not in blacklist: |
438 flat.append(k) | 449 flat.append(k) |
439 flat.append(params[k]) | 450 flat.append(params[k]) |
440 return flat | 451 return flat |
OLD | NEW |