Bug 1501759: [taskgraph] Add a beta-sim target. r=aki,RyanVM, a=release
authorTom Prince <mozilla@hocat.ca>
Wed, 24 Oct 2018 20:44:11 +0000
changeset 498128 b290becd35fe07e08343f2a81a8f319131d12c15
parent 498127 3cc6c86d75e49b5696fa71d34f2495322d317693
child 498129 5de90324d8b18cc53df3272cadaa1a91644d0742
push id10033
push userryanvm@gmail.com
push dateThu, 25 Oct 2018 01:45:01 +0000
treeherdermozilla-beta@5de90324d8b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaki, RyanVM, release
bugs1501759
milestone64.0
Bug 1501759: [taskgraph] Add a beta-sim target. r=aki,RyanVM, a=release Differential Revision: https://phabricator.services.mozilla.com/D9690
taskcluster/taskgraph/target_tasks.py
tools/tryselect/selectors/release.py
--- a/taskcluster/taskgraph/target_tasks.py
+++ b/taskcluster/taskgraph/target_tasks.py
@@ -43,19 +43,16 @@ def filter_for_project(task, parameters)
 
 def filter_on_platforms(task, platforms):
     """Filter tasks on the given platform"""
     platform = task.attributes.get('build_platform')
     return (platform in platforms)
 
 
 def filter_release_tasks(task, parameters):
-    if not standard_filter(task, parameters):
-        return False
-
     platform = task.attributes.get('build_platform')
     if platform in (
             # On beta, Nightly builds are already PGOs
             'linux-pgo', 'linux64-pgo',
             'win32-pgo', 'win64-pgo',
             # ASAN is central-only
             'linux64-asan-reporter-nightly',
             'win64-asan-reporter-nightly',
@@ -256,39 +253,44 @@ def target_tasks_valgrind(full_task_grap
 
 @_target_task('mozilla_beta_tasks')
 def target_tasks_mozilla_beta(full_task_graph, parameters, graph_config):
     """Select the set of tasks required for a promotable beta or release build
     of desktop, plus android CI. The candidates build process involves a pipeline
     of builds and signing, but does not include beetmover or balrog jobs."""
 
     return [l for l, t in full_task_graph.tasks.iteritems()
-            if filter_release_tasks(t, parameters)]
+            if filter_release_tasks(t, parameters)
+            and standard_filter(t, parameters)]
 
 
 @_target_task('mozilla_release_tasks')
 def target_tasks_mozilla_release(full_task_graph, parameters, graph_config):
     """Select the set of tasks required for a promotable beta or release build
     of desktop, plus android CI. The candidates build process involves a pipeline
     of builds and signing, but does not include beetmover or balrog jobs."""
 
     return [l for l, t in full_task_graph.tasks.iteritems()
-            if filter_release_tasks(t, parameters)]
+            if filter_release_tasks(t, parameters)
+            and standard_filter(t, parameters)]
 
 
 @_target_task('mozilla_esr60_tasks')
 def target_tasks_mozilla_esr60(full_task_graph, parameters, graph_config):
     """Select the set of tasks required for a promotable beta or release build
     of desktop, plus android CI. The candidates build process involves a pipeline
     of builds and signing, but does not include beetmover or balrog jobs."""
 
     def filter(task):
         if not filter_release_tasks(task, parameters):
             return False
 
+        if not standard_filter(task, parameters):
+            return False
+
         platform = task.attributes.get('build_platform')
 
         # Android is not built on esr.
         if platform and 'android' in platform:
             return False
 
         # All else was already filtered
         return True
@@ -578,8 +580,25 @@ def target_tasks_staging_release(full_ta
     def filter(task):
         if not task.attributes.get('shipping_product'):
             return False
         if task.attributes.get('shipping_phase') == 'build':
             return True
         return False
 
     return [l for l, t in full_task_graph.tasks.iteritems() if filter(t)]
+
+
+@_target_task('beta_simulation')
+def target_tasks_beta_simulation(full_task_graph, parameters, graph_config):
+    """
+    Select builds that would run on mozilla-beta.
+    """
+
+    def filter_for_beta(task):
+        """Filter tasks by project.  Optionally enable nightlies."""
+        run_on_projects = set(task.attributes.get('run_on_projects', []))
+        return match_run_on_projects('mozilla-beta', run_on_projects)
+
+    return [l for l, t in full_task_graph.tasks.iteritems()
+            if filter_release_tasks(t, parameters)
+            and filter_out_cron(t, parameters)
+            and filter_for_beta(t)]
--- a/tools/tryselect/selectors/release.py
+++ b/tools/tryselect/selectors/release.py
@@ -7,16 +7,21 @@ from __future__ import absolute_import, 
 import os
 
 import attr
 from mozilla_version.gecko import FirefoxVersion
 
 from ..cli import BaseTryParser
 from ..push import push_to_try, vcs
 
+TARGET_TASKS = {
+    'staging': 'staging_release_builds',
+    'beta-sim': 'beta_simulation',
+}
+
 
 def read_file(path):
     with open(path) as fh:
         return fh.read()
 
 
 class ReleaseParser(BaseTryParser):
     name = 'release'
@@ -35,22 +40,29 @@ class ReleaseParser(BaseTryParser):
           'choices': ['central-to-beta', 'beta-to-release'],
           'help': "Migration to run for the release (can be specified multiple times).",
           }],
         [['--no-limit-locales'],
          {'action': 'store_false',
           'dest': 'limit_locales',
           'help': "Don't build a limited number of locales in the staging release.",
           }],
+        [['--tasks'],
+         {'choices': TARGET_TASKS.keys(),
+          'default': 'staging',
+          'help': "Which tasks to run on-push.",
+          }],
+
     ]
     common_groups = ['push']
 
 
 def run_try_release(
-    version, migrations=(), push=True, message='{msg}', limit_locales=True, **kwargs
+    version, migrations, limit_locales, tasks,
+    push=True, message='{msg}', **kwargs
 ):
 
     if version.is_beta:
         app_version = attr.evolve(version, beta_number=None)
     else:
         app_version = version
 
     files_to_change = {
@@ -61,17 +73,17 @@ def run_try_release(
     release_type = version.version_type.name.lower()
     if release_type not in ('beta', 'release', 'esr'):
         raise Exception(
             "Can't do staging release for version: {} type: {}".format(
                 version, version.version_type))
     task_config = {
         'version': 2,
         'parameters': {
-            'target_tasks_method': 'staging_release_builds',
+            'target_tasks_method': TARGET_TASKS[tasks],
             'optimize_target_tasks': True,
             'release_type': release_type,
         },
     }
 
     for migration in migrations:
         migration_path = os.path.join(
             vcs.path,