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

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

Issue 2167883004: [Skia] Convert SKPs to a CIPD package (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Fix boto env, ensure tmp_dir exists since it's no longer isolated 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
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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 # Set some important variables. 207 # Set some important variables.
208 self.resource_dir = self.skia_dir.join('resources') 208 self.resource_dir = self.skia_dir.join('resources')
209 self.images_dir = self.slave_dir.join('skimage') 209 self.images_dir = self.slave_dir.join('skimage')
210 if not self.m.path.exists(self.infrabots_dir.join( 210 if not self.m.path.exists(self.infrabots_dir.join(
211 'assets', 'skimage', 'VERSION')): 211 'assets', 'skimage', 'VERSION')):
212 # TODO(borenet): Remove this once enough time has passed. 212 # TODO(borenet): Remove this once enough time has passed.
213 self.images_dir = self.slave_dir.join('images') 213 self.images_dir = self.slave_dir.join('images')
214 self.skia_out = self.skia_dir.join('out', self.builder_name) 214 self.skia_out = self.skia_dir.join('out', self.builder_name)
215 self.swarming_out_dir = self.make_path(self.m.properties['swarm_out_dir']) 215 self.swarming_out_dir = self.make_path(self.m.properties['swarm_out_dir'])
216 self.local_skp_dir = self.slave_dir.join('skps') 216 self.local_skp_dir = self.slave_dir.join('skp')
217 if not self.m.path.exists(self.infrabots_dir.join(
218 'assets', 'skp', 'VERSION')):
219 # TODO(borenet): Remove this once enough time has passed.
220 self.local_skp_dir = self.slave_dir.join('skps')
217 if not self.is_compile_bot: 221 if not self.is_compile_bot:
218 self.skia_out = self.slave_dir.join('out') 222 self.skia_out = self.slave_dir.join('out')
219 self.tmp_dir = self.m.path['slave_build'].join('tmp') 223 self.tmp_dir = self.m.path['slave_build'].join('tmp')
224 if not self.m.path.exists(self.tmp_dir):
225 self._run_once(self.m.file.makedirs,
226 'tmp_dir',
227 self.tmp_dir,
228 infra_step=True)
220 229
221 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM) 230 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM)
222 231
223 self.device_dirs = None 232 self.device_dirs = None
224 self._ccache = None 233 self._ccache = None
225 self._checked_for_ccache = False 234 self._checked_for_ccache = False
226 self.configuration = self.builder_spec['configuration'] 235 self.configuration = self.builder_spec['configuration']
227 self.default_env.update({'SKIA_OUT': self.skia_out, 236 self.default_env.update({'SKIA_OUT': self.skia_out,
228 'BUILDTYPE': self.configuration}) 237 'BUILDTYPE': self.configuration})
229 self.default_env.update(self.builder_spec['env']) 238 self.default_env.update(self.builder_spec['env'])
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 local_images_dir, 534 local_images_dir,
526 test_expected_version=TEST_EXPECTED_SK_IMAGE_VERSION, 535 test_expected_version=TEST_EXPECTED_SK_IMAGE_VERSION,
527 test_actual_version=self.m.properties.get( 536 test_actual_version=self.m.properties.get(
528 'test_downloaded_sk_image_version', 537 'test_downloaded_sk_image_version',
529 TEST_EXPECTED_SK_IMAGE_VERSION)) 538 TEST_EXPECTED_SK_IMAGE_VERSION))
530 539
531 def _copy_images(self): 540 def _copy_images(self):
532 """Download and copy test images if needed.""" 541 """Download and copy test images if needed."""
533 version_file = self.infrabots_dir.join('assets', 'skimage', 'VERSION') 542 version_file = self.infrabots_dir.join('assets', 'skimage', 'VERSION')
534 if self.m.path.exists(version_file): 543 if self.m.path.exists(version_file):
535 version_file = self.infrabots_dir.join('assets', 'skimage', 'VERSION')
536 test_data = self.m.properties.get( 544 test_data = self.m.properties.get(
537 'test_actual_skp_version', TEST_EXPECTED_SKP_VERSION) 545 'test_downloaded_sk_image_version', TEST_EXPECTED_SK_IMAGE_VERSION)
538 version = self._readfile(version_file, 546 version = self._readfile(version_file,
539 name='Get downloaded skimage VERSION', 547 name='Get downloaded skimage VERSION',
540 test_data=test_data).rstrip() 548 test_data=test_data).rstrip()
541 self._writefile(self.m.path.join(self.tmp_dir, VERSION_FILE_SK_IMAGE), 549 self._writefile(self.m.path.join(self.tmp_dir, VERSION_FILE_SK_IMAGE),
542 version) 550 version)
543 else: 551 else:
544 # TODO(borenet): Remove this once enough time has passed. 552 # TODO(borenet): Remove this once enough time has passed.
545 version = self.check_actual_version( 553 version = self.check_actual_version(
546 VERSION_FILE_SK_IMAGE, 554 VERSION_FILE_SK_IMAGE,
547 self.tmp_dir, 555 self.tmp_dir,
(...skipping 21 matching lines...) Expand all
569 VERSION_FILE_SKP, 577 VERSION_FILE_SKP,
570 GS_SUBDIR_TMPL_SKP, 578 GS_SUBDIR_TMPL_SKP,
571 tmp_dir, 579 tmp_dir,
572 local_skp_dir, 580 local_skp_dir,
573 test_expected_version=TEST_EXPECTED_SKP_VERSION, 581 test_expected_version=TEST_EXPECTED_SKP_VERSION,
574 test_actual_version=self.m.properties.get( 582 test_actual_version=self.m.properties.get(
575 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION)) 583 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION))
576 584
577 def _copy_skps(self): 585 def _copy_skps(self):
578 """Download and copy the SKPs if needed.""" 586 """Download and copy the SKPs if needed."""
579 version = self.check_actual_version( 587 version_file = self.infrabots_dir.join('assets', 'skp', 'VERSION')
580 VERSION_FILE_SKP, 588 if self.m.path.exists(version_file):
581 self.tmp_dir, 589 test_data = self.m.properties.get(
582 test_actual_version=self.m.properties.get( 590 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION)
583 'test_downloaded_skp_version', 591 version = self._readfile(version_file,
584 TEST_EXPECTED_SKP_VERSION), 592 name='Get downloaded SKP VERSION',
585 ) 593 test_data=test_data).rstrip()
594 self._writefile(self.m.path.join(self.tmp_dir, VERSION_FILE_SKP), version)
595 else:
596 # TODO(borenet): Remove this once enough time has passed.
597 version = self.check_actual_version(
598 VERSION_FILE_SKP,
599 self.tmp_dir,
600 test_actual_version=self.m.properties.get(
601 'test_downloaded_skp_version',
602 TEST_EXPECTED_SKP_VERSION),
603 )
586 self.copy_dir( 604 self.copy_dir(
587 version, 605 version,
588 VERSION_FILE_SKP, 606 VERSION_FILE_SKP,
589 self.tmp_dir, 607 self.tmp_dir,
590 self.local_skp_dir, 608 self.local_skp_dir,
591 self.device_dirs.skp_dir, 609 self.device_dirs.skp_dir,
592 test_expected_version=self.m.properties.get( 610 test_expected_version=self.m.properties.get(
593 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION), 611 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION),
594 test_actual_version=self.m.properties.get( 612 test_actual_version=self.m.properties.get(
595 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION)) 613 'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION))
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 # Don't bother to include role, which is always Test. 880 # Don't bother to include role, which is always Test.
863 # TryBots are uploaded elsewhere so they can use the same key. 881 # TryBots are uploaded elsewhere so they can use the same key.
864 blacklist = ['role', 'is_trybot'] 882 blacklist = ['role', 'is_trybot']
865 883
866 flat = [] 884 flat = []
867 for k in sorted(self.builder_cfg.keys()): 885 for k in sorted(self.builder_cfg.keys()):
868 if k not in blacklist: 886 if k not in blacklist:
869 flat.append(k) 887 flat.append(k)
870 flat.append(self.builder_cfg[k]) 888 flat.append(self.builder_cfg[k])
871 return flat 889 return flat
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698