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

Unified Diff: infra/bots/recipe_modules/vars/api.py

Issue 2219873003: [recipes] Smush the rest of builder_spec into appropriate places, other cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « infra/bots/recipe_modules/flavor/ios_flavor.py ('k') | infra/bots/recipes/swarm_trigger.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/recipe_modules/vars/api.py
diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py
index 093cd87da74abd81069ecad069da1f709b00278b..7936602fc7339720c56ca155acc23c17fa085d67 100644
--- a/infra/bots/recipe_modules/vars/api.py
+++ b/infra/bots/recipe_modules/vars/api.py
@@ -7,7 +7,6 @@
from recipe_engine import recipe_api
-import os
BOTO_CHROMIUM_SKIA_GM = 'chromium-skia-gm.boto'
@@ -16,113 +15,6 @@ CONFIG_DEBUG = 'Debug'
CONFIG_RELEASE = 'Release'
-def device_cfg(builder_dict):
- # Android.
- if 'Android' in builder_dict.get('extra_config', ''):
- if 'NoNeon' in builder_dict['extra_config']:
- return 'arm_v7'
- return {
- 'Arm64': 'arm64',
- 'x86': 'x86',
- 'x86_64': 'x86_64',
- 'Mips': 'mips',
- 'Mips64': 'mips64',
- 'MipsDSP2': 'mips_dsp2',
- }.get(builder_dict['target_arch'], 'arm_v7_neon')
- elif builder_dict.get('os') == 'Android':
- return {
- 'AndroidOne': 'arm_v7_neon',
- 'GalaxyS3': 'arm_v7_neon',
- 'GalaxyS4': 'arm_v7_neon',
- 'NVIDIA_Shield': 'arm64',
- 'Nexus10': 'arm_v7_neon',
- 'Nexus5': 'arm_v7_neon',
- 'Nexus6': 'arm_v7_neon',
- 'Nexus7': 'arm_v7_neon',
- 'Nexus7v2': 'arm_v7_neon',
- 'Nexus9': 'arm64',
- 'NexusPlayer': 'x86',
- }[builder_dict['model']]
-
- # iOS.
- if 'iOS' in builder_dict.get('os', ''):
- return {
- 'iPad4': 'iPad4,1',
- }[builder_dict['model']]
-
- return None
-
-
-def product_board(builder_dict):
- if 'Android' in builder_dict.get('os', ''):
- return {
- 'AndroidOne': 'sprout',
- 'GalaxyS3': 'm0', #'smdk4x12', Detected incorrectly by swarming?
- 'GalaxyS4': None, # TODO(borenet,kjlubick)
- 'NVIDIA_Shield': 'foster',
- 'Nexus10': 'manta',
- 'Nexus5': 'hammerhead',
- 'Nexus6': 'shamu',
- 'Nexus7': 'grouper',
- 'Nexus7v2': 'flo',
- 'Nexus9': 'flounder',
- 'NexusPlayer': 'fugu',
- }[builder_dict['model']]
- return None
-
-
-def get_builder_spec(api, builder_name):
- builder_dict = api.builder_name_schema.DictForBuilderName(builder_name)
- rv = {
- 'builder_cfg': builder_dict,
- }
- device = device_cfg(builder_dict)
- if device:
- rv['device_cfg'] = device
- board = product_board(builder_dict)
- if board:
- rv['product.board'] = board
-
- role = builder_dict['role']
- if role == api.builder_name_schema.BUILDER_ROLE_HOUSEKEEPER:
- configuration = CONFIG_RELEASE
- else:
- configuration = builder_dict.get('configuration', CONFIG_DEBUG)
- arch = (builder_dict.get('arch') or builder_dict.get('target_arch'))
- if ('Win' in builder_dict.get('os', '') and arch == 'x86_64'):
- configuration += '_x64'
- rv['configuration'] = configuration
- if configuration == 'Coverage':
- rv['do_compile_steps'] = False
- rv['do_test_steps'] = role == api.builder_name_schema.BUILDER_ROLE_TEST
- rv['do_perf_steps'] = role == api.builder_name_schema.BUILDER_ROLE_PERF
-
- # Do we upload perf results?
- upload_perf_results = False
- if (role == api.builder_name_schema.BUILDER_ROLE_PERF and
- CONFIG_RELEASE in configuration):
- upload_perf_results = True
- rv['upload_perf_results'] = upload_perf_results
-
- # Do we upload correctness results?
- skip_upload_bots = [
- 'ASAN',
- 'Coverage',
- 'MSAN',
- 'TSAN',
- 'UBSAN',
- 'Valgrind',
- ]
- upload_dm_results = True
- for s in skip_upload_bots:
- if s in builder_name:
- upload_dm_results = False
- break
- rv['upload_dm_results'] = upload_dm_results
-
- return rv
-
-
class SkiaVarsApi(recipe_api.RecipeApi):
def make_path(self, *path):
@@ -131,26 +23,6 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.m.path.c.base_paths[key] = tuple(path)
return self.m.path[key]
- def gsutil_env(self, boto_file):
- """Environment variables for gsutil."""
- boto_path = None
- if boto_file:
- boto_path = self.m.path.join(self.home_dir, boto_file)
- return {'AWS_CREDENTIAL_FILE': boto_path,
- 'BOTO_CONFIG': boto_path}
-
- @property
- def home_dir(self):
- """Find the home directory."""
- home_dir = os.path.expanduser('~')
- if self._test_data.enabled:
- home_dir = '[HOME]'
- return home_dir
-
- def get_builder_spec(self, builder_name):
- """Return the builder_spec for the given builder name."""
- return get_builder_spec(self.m, builder_name)
-
def setup(self):
"""Prepare the variables."""
# Setup
@@ -222,18 +94,19 @@ class SkiaVarsApi(recipe_api.RecipeApi):
# Some bots also require a checkout of PDFium.
self.need_pdfium_checkout = 'PDFium' in self.builder_name
- # Obtain the spec for this builder. Use it to set more properties.
- self.builder_spec = get_builder_spec(self.m, self.builder_name)
-
- self.builder_cfg = self.builder_spec['builder_cfg']
+ self.builder_cfg = self.m.builder_name_schema.DictForBuilderName(
+ self.builder_name)
self.role = self.builder_cfg['role']
+ if self.role == self.m.builder_name_schema.BUILDER_ROLE_HOUSEKEEPER:
+ self.configuration = CONFIG_RELEASE
+ else:
+ self.configuration = self.builder_cfg.get('configuration', CONFIG_DEBUG)
+ arch = (self.builder_cfg.get('arch') or self.builder_cfg.get('target_arch'))
+ if ('Win' in self.builder_cfg.get('os', '') and arch == 'x86_64'):
+ self.configuration += '_x64'
- self.configuration = self.builder_spec['configuration']
self.default_env.update({'SKIA_OUT': self.skia_out,
'BUILDTYPE': self.configuration})
- self.do_compile_steps = self.builder_spec.get('do_compile_steps', True)
- self.do_test_steps = self.builder_spec['do_test_steps']
- self.do_perf_steps = self.builder_spec['do_perf_steps']
self.is_trybot = self.builder_cfg['is_trybot']
self.issue = None
self.patchset = None
@@ -242,9 +115,30 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.issue = self.m.properties['issue']
self.patchset = self.m.properties['patchset']
self.rietveld = self.m.properties['rietveld']
- self.upload_dm_results = self.builder_spec['upload_dm_results']
- self.upload_perf_results = self.builder_spec['upload_perf_results']
self.dm_dir = self.m.path.join(
self.swarming_out_dir, 'dm')
self.perf_data_dir = self.m.path.join(self.swarming_out_dir,
'perfdata', self.builder_name, 'data')
+
+ @property
+ def upload_dm_results(self):
+ # TODO(borenet): Move this into the swarm_test recipe.
+ skip_upload_bots = [
+ 'ASAN',
+ 'Coverage',
+ 'MSAN',
+ 'TSAN',
+ 'UBSAN',
+ 'Valgrind',
+ ]
+ upload_dm_results = True
+ for s in skip_upload_bots:
+ if s in self.m.properties['buildername']:
+ upload_dm_results = False
+ break
+ return upload_dm_results
+
+ @property
+ def upload_perf_results(self):
+ # TODO(borenet): Move this into the swarm_perf recipe.
+ return ('Release' in self.m.properties['buildername'])
« no previous file with comments | « infra/bots/recipe_modules/flavor/ios_flavor.py ('k') | infra/bots/recipes/swarm_trigger.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698