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

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

Issue 2162563002: [Skia] Convert Sk Images to a CIPD package (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Fix whitespace Created 4 years, 5 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 | « no previous file | scripts/slave/recipe_modules/skia/default_flavor.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 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 import json 6 import json
7 import os 7 import os
8 import re 8 import re
9 import sys 9 import sys
10 10
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 # Obtain the spec for this builder from the Skia repo. Use it to set more 199 # Obtain the spec for this builder from the Skia repo. Use it to set more
200 # properties. 200 # properties.
201 self.builder_spec = self.get_builder_spec(self.skia_dir, self.builder_name) 201 self.builder_spec = self.get_builder_spec(self.skia_dir, self.builder_name)
202 202
203 self.builder_cfg = self.builder_spec['builder_cfg'] 203 self.builder_cfg = self.builder_spec['builder_cfg']
204 self.role = self.builder_cfg['role'] 204 self.role = self.builder_cfg['role']
205 205
206 # Set some important variables. 206 # Set some important variables.
207 self.resource_dir = self.skia_dir.join('resources') 207 self.resource_dir = self.skia_dir.join('resources')
208 self.images_dir = self.slave_dir.join('images') 208 self.images_dir = self.slave_dir.join('skimage')
209 if not self.m.path.exists(self.infrabots_dir.join(
210 'assets', 'skimage', 'VERSION')):
211 # TODO(borenet): Remove this once enough time has passed.
212 self.images_dir = self.slave_dir.join('images')
209 self.skia_out = self.skia_dir.join('out', self.builder_name) 213 self.skia_out = self.skia_dir.join('out', self.builder_name)
210 self.swarming_out_dir = self.make_path(self.m.properties['swarm_out_dir']) 214 self.swarming_out_dir = self.make_path(self.m.properties['swarm_out_dir'])
211 self.local_skp_dir = self.slave_dir.join('skps') 215 self.local_skp_dir = self.slave_dir.join('skps')
212 if not self.is_compile_bot: 216 if not self.is_compile_bot:
213 self.skia_out = self.slave_dir.join('out') 217 self.skia_out = self.slave_dir.join('out')
214 self.tmp_dir = self.m.path['slave_build'].join('tmp') 218 self.tmp_dir = self.m.path['slave_build'].join('tmp')
215 219
216 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM) 220 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM)
217 221
218 self.device_dirs = None 222 self.device_dirs = None
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 GS_SUBDIR_TMPL_SK_IMAGE, 522 GS_SUBDIR_TMPL_SK_IMAGE,
519 tmp_dir, 523 tmp_dir,
520 local_images_dir, 524 local_images_dir,
521 test_expected_version=TEST_EXPECTED_SK_IMAGE_VERSION, 525 test_expected_version=TEST_EXPECTED_SK_IMAGE_VERSION,
522 test_actual_version=self.m.properties.get( 526 test_actual_version=self.m.properties.get(
523 'test_downloaded_sk_image_version', 527 'test_downloaded_sk_image_version',
524 TEST_EXPECTED_SK_IMAGE_VERSION)) 528 TEST_EXPECTED_SK_IMAGE_VERSION))
525 529
526 def _copy_images(self): 530 def _copy_images(self):
527 """Download and copy test images if needed.""" 531 """Download and copy test images if needed."""
528 version = self.check_actual_version( 532 version_file = self.infrabots_dir.join('assets', 'skimage', 'VERSION')
529 VERSION_FILE_SK_IMAGE, 533 if self.m.path.exists(version_file):
530 self.tmp_dir, 534 version_file = self.infrabots_dir.join('assets', 'skimage', 'VERSION')
531 test_actual_version=self.m.properties.get( 535 test_data = self.m.properties.get(
532 'test_downloaded_sk_image_version', 536 'test_actual_skp_version', TEST_EXPECTED_SKP_VERSION)
533 TEST_EXPECTED_SK_IMAGE_VERSION), 537 version = self._readfile(version_file,
534 ) 538 name='Get downloaded skimage VERSION',
539 test_data=test_data).rstrip()
540 self._writefile(self.m.path.join(self.tmp_dir, VERSION_FILE_SK_IMAGE),
541 version)
542 else:
543 # TODO(borenet): Remove this once enough time has passed.
544 version = self.check_actual_version(
545 VERSION_FILE_SK_IMAGE,
546 self.tmp_dir,
547 test_actual_version=self.m.properties.get(
548 'test_downloaded_sk_image_version',
549 TEST_EXPECTED_SK_IMAGE_VERSION),
550 )
535 self.copy_dir( 551 self.copy_dir(
536 version, 552 version,
537 VERSION_FILE_SK_IMAGE, 553 VERSION_FILE_SK_IMAGE,
538 self.tmp_dir, 554 self.tmp_dir,
539 self.images_dir, 555 self.images_dir,
540 self.device_dirs.images_dir, 556 self.device_dirs.images_dir,
541 test_expected_version=self.m.properties.get( 557 test_expected_version=self.m.properties.get(
542 'test_downloaded_sk_image_version', 558 'test_downloaded_sk_image_version',
543 TEST_EXPECTED_SK_IMAGE_VERSION), 559 TEST_EXPECTED_SK_IMAGE_VERSION),
544 test_actual_version=self.m.properties.get( 560 test_actual_version=self.m.properties.get(
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 # Don't bother to include role, which is always Test. 864 # Don't bother to include role, which is always Test.
849 # TryBots are uploaded elsewhere so they can use the same key. 865 # TryBots are uploaded elsewhere so they can use the same key.
850 blacklist = ['role', 'is_trybot'] 866 blacklist = ['role', 'is_trybot']
851 867
852 flat = [] 868 flat = []
853 for k in sorted(self.builder_cfg.keys()): 869 for k in sorted(self.builder_cfg.keys()):
854 if k not in blacklist: 870 if k not in blacklist:
855 flat.append(k) 871 flat.append(k)
856 flat.append(self.builder_cfg[k]) 872 flat.append(self.builder_cfg[k])
857 return flat 873 return flat
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/skia/default_flavor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698