Bug 1562287: Add an option to `mach try` to disable 3-tier PGO; r=mshal,ahal

Often times, PGO builds aren't required for testing things (in particular,
testing release automation). However, at least when testing release automation,
we do need to use the shippable build type.

Add an option to mach try that will disable using the 3-tier PGO jobs.

Differential Revision: https://phabricator.services.mozilla.com/D36365

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Prince 2019-07-04 19:03:04 +00:00
Родитель 770166e1f5
Коммит cc334f7f17
9 изменённых файлов: 36 добавлений и 9 удалений

Просмотреть файл

@ -120,6 +120,7 @@ PER_PROJECT_PARAMETERS = {
try_task_config_schema = Schema({
Required('tasks'): [basestring],
Optional('templates'): {basestring: object},
Optional('disable-pgo'): bool,
})
@ -264,7 +265,7 @@ def get_decision_parameters(config, options):
parameters['required_signoffs'] = []
parameters['signoff_urls'] = {}
parameters['try_mode'] = None
parameters['try_task_config'] = None
parameters['try_task_config'] = {}
parameters['try_options'] = None
# owner must be an email, but sometimes (e.g., for ffxbld) it is not, in which

Просмотреть файл

@ -162,7 +162,7 @@ class Parameters(ReadOnlyDict):
'tasks_for': 'hg-push',
'try_mode': None,
'try_options': None,
'try_task_config': None,
'try_task_config': {},
'version': get_version(),
}

Просмотреть файл

@ -77,7 +77,7 @@ class TestGetDecisionParameters(unittest.TestCase):
self.assertEqual(params['moz_build_date'], '20170825200511')
self.assertEqual(params['try_mode'], None)
self.assertEqual(params['try_options'], None)
self.assertEqual(params['try_task_config'], None)
self.assertEqual(params['try_task_config'], {})
@patch('taskgraph.decision.get_hg_revision_branch')
def test_no_email_owner(self, mock_get_hg_revision_branch):
@ -98,7 +98,7 @@ class TestGetDecisionParameters(unittest.TestCase):
self.assertEqual(params['try_mode'], 'try_option_syntax')
self.assertEqual(params['try_options']['build_types'], 'do')
self.assertEqual(params['try_options']['unittests'], 'all')
self.assertEqual(params['try_task_config'], None)
self.assertEqual(params['try_task_config'], {})
@patch('taskgraph.decision.get_hg_revision_branch')
@patch('taskgraph.decision.get_hg_commit_message')

Просмотреть файл

@ -104,7 +104,8 @@ def mozconfig(config, jobs):
def use_profile_data(config, jobs):
for job in jobs:
use_pgo = job.pop('use-pgo', False)
if not use_pgo:
disable_pgo = config.params['try_task_config'].get('disable-pgo', False)
if not use_pgo or disable_pgo:
yield job
continue

Просмотреть файл

@ -19,7 +19,7 @@ class ChooserParser(BaseTryParser):
name = 'chooser'
arguments = []
common_groups = ['push', 'task']
templates = ['artifact', 'env', 'rebuild', 'chemspill-prio', 'gecko-profile']
templates = ['artifact', 'env', 'rebuild', 'chemspill-prio', 'gecko-profile', 'disable-pgo']
def run(update=False, query=None, try_config=None, full=False, parameters=None,

Просмотреть файл

@ -57,7 +57,7 @@ class CoverageParser(BaseTryParser):
name = 'coverage'
arguments = []
common_groups = ['push', 'task']
templates = ['artifact', 'env', 'rebuild', 'chemspill-prio']
templates = ['artifact', 'env', 'rebuild', 'chemspill-prio', 'disable-pgo']
def read_test_manifests():

Просмотреть файл

@ -121,7 +121,9 @@ class FuzzyParser(BaseTryParser):
}],
]
common_groups = ['push', 'task', 'preset']
templates = ['artifact', 'path', 'env', 'rebuild', 'chemspill-prio', 'gecko-profile']
templates = [
'artifact', 'path', 'env', 'rebuild', 'chemspill-prio', 'gecko-profile', 'disable-pgo',
]
def run_cmd(cmd, cwd=None):

Просмотреть файл

@ -58,13 +58,17 @@ class ReleaseParser(BaseTryParser):
]
common_groups = ['push']
templates = ['disable-pgo']
def __init__(self, *args, **kwargs):
super(ReleaseParser, self).__init__(*args, **kwargs)
self.set_defaults(migrations=[])
def run(version, migrations, limit_locales, tasks, push=True, message='{msg}', closed_tree=False):
def run(
version, migrations, limit_locales, tasks,
try_config=None, push=True, message='{msg}', closed_tree=False
):
app_version = attr.evolve(version, beta_number=None, is_esr=False)
files_to_change = {
@ -88,6 +92,8 @@ def run(version, migrations, limit_locales, tasks, push=True, message='{msg}', c
'release_type': release_type,
},
}
if try_config:
task_config['parameters']['try_task_config'] = try_config
for migration in migrations:
migration_path = os.path.join(

Просмотреть файл

@ -220,6 +220,22 @@ class GeckoProfile(Template):
return {'gecko-profile': profile}
class DisablePgo(TryConfig):
arguments = [
[['--disable-pgo'],
{'action': 'store_true',
'help': 'Don\'t run PGO builds',
}],
]
def try_config(self, disable_pgo, **kwargs):
if disable_pgo:
return {
'disable-pgo': True,
}
all_templates = {
'artifact': Artifact,
'path': Path,
@ -227,4 +243,5 @@ all_templates = {
'rebuild': Rebuild,
'chemspill-prio': ChemspillPrio,
'gecko-profile': GeckoProfile,
'disable-pgo': DisablePgo,
}