Bug 1368484 - Release Fennec Nightly (only) AArch64 APK to Google Play r=mtabara
authorJohan Lorenzo <jlorenzo@mozilla.com>
Mon, 14 Jan 2019 15:55:33 +0000
changeset 513736 5306b81a94f76fc9d867435ff304dbdec9bab203
parent 513735 a7034ada9fb35dffe4e0729987cb00b2e37d46ac
child 513737 b1522f31ad7d8084dcdaddbcb582e2411522a766
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtabara
bugs1368484
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1368484 - Release Fennec Nightly (only) AArch64 APK to Google Play r=mtabara Release Fennec Nightly (only) AArch64 APK to Google Play Differential Revision: https://phabricator.services.mozilla.com/D16464
taskcluster/taskgraph/loader/push_apk.py
taskcluster/taskgraph/transforms/push_apk.py
--- a/taskcluster/taskgraph/loader/push_apk.py
+++ b/taskcluster/taskgraph/loader/push_apk.py
@@ -9,41 +9,47 @@ from .transform import loader as base_lo
 
 def loader(kind, path, config, params, loaded_tasks):
     """
     Generate inputs implementing PushApk jobs. These depend on signed multi-locales nightly builds.
     """
     jobs = base_loader(kind, path, config, params, loaded_tasks)
 
     for job in jobs:
-        dependent_tasks = get_dependent_loaded_tasks(config, loaded_tasks)
+        dependent_tasks = get_dependent_loaded_tasks(config, params, loaded_tasks)
         if not dependent_tasks:
             # PushApk must depend on signed APK. If no dependent task was found,
             # this means another plaform (like windows) is being processed
             continue
 
         job['dependent-tasks'] = dependent_tasks
         job['label'] = job['name']
 
         yield job
 
 
-def get_dependent_loaded_tasks(config, loaded_tasks):
+def get_dependent_loaded_tasks(config, params, loaded_tasks):
     nightly_tasks = (
         task for task in loaded_tasks if task.attributes.get('nightly')
     )
     tasks_with_matching_kind = (
         task for task in nightly_tasks if task.kind in config.get('kind-dependencies')
     )
-    android_tasks = [
+    android_tasks = (
         task for task in tasks_with_matching_kind
         if task.attributes.get('build_platform', '').startswith('android')
-    ]
+    )
 
-    # TODO Bug 1368484: Activate aarch64 once ready
+    # TODO Bug 1368484: Aarch64 is not planned to ride the trains regularly. It may stay on nightly
+    # for a few cycles. Then, we should activate it on beta then release, once ready.
+    aarch64_tasks_only_on_central = (
+        task for task in android_tasks
+        if params['project'] == 'mozilla-central' or
+        'aarch64' not in task.attributes.get('build_platform', '')
+    )
+
     # TODO Bug 1490502: Activate x86-64 once ready
     non_shipping_tasks = [
-        task for task in android_tasks
-        if 'aarch64' not in task.attributes.get('build_platform', '') and
-           'x86_64' not in task.attributes.get('build_platform', '')
+        task for task in aarch64_tasks_only_on_central
+        if 'x86_64' not in task.attributes.get('build_platform', '')
     ]
 
     return non_shipping_tasks
--- a/taskcluster/taskgraph/transforms/push_apk.py
+++ b/taskcluster/taskgraph/transforms/push_apk.py
@@ -37,45 +37,55 @@ push_apk_description_schema = Schema({
     Required('requires'): task_description_schema['requires'],
     Required('deadline-after'): basestring,
     Required('shipping-phase'): task_description_schema['shipping-phase'],
     Required('shipping-product'): task_description_schema['shipping-product'],
     Optional('extra'): task_description_schema['extra'],
 })
 
 
-REQUIRED_ARCHITECTURES = {
-    'android-x86-nightly',
-    'android-api-16-nightly',
-}
 PLATFORM_REGEX = re.compile(r'build-signing-android-(\S+)-nightly')
 
 transforms = TransformSequence()
 transforms.add_validate(push_apk_description_schema)
 
 
 @transforms.add
-def validate_dependent_tasks(_, jobs):
+def validate_dependent_tasks(config, jobs):
     for job in jobs:
-        check_every_architecture_is_present_in_dependent_tasks(job['dependent-tasks'])
+        check_every_architecture_is_present_in_dependent_tasks(
+            config.params['project'], job['dependent-tasks']
+        )
         yield job
 
 
-def check_every_architecture_is_present_in_dependent_tasks(dependent_tasks):
+def check_every_architecture_is_present_in_dependent_tasks(project, dependent_tasks):
     dep_platforms = set(t.attributes.get('build_platform') for t in dependent_tasks)
-    missed_architectures = REQUIRED_ARCHITECTURES - dep_platforms
+    required_architectures = _get_required_architectures(project)
+    missed_architectures = required_architectures - dep_platforms
     if missed_architectures:
         raise Exception('''One or many required architectures are missing.
 
 Required architectures: {}.
 Given dependencies: {}.
-'''.format(REQUIRED_ARCHITECTURES, dependent_tasks)
+'''.format(required_architectures, dependent_tasks)
         )
 
 
+def _get_required_architectures(project):
+    architectures = {
+        'android-api-16-nightly',
+        'android-x86-nightly',
+    }
+    if project == 'mozilla-central':
+        architectures.add('android-aarch64-nightly')
+
+    return architectures
+
+
 @transforms.add
 def make_task_description(config, jobs):
     for job in jobs:
         job['dependencies'] = generate_dependencies(job['dependent-tasks'])
         job['worker']['upstream-artifacts'] = generate_upstream_artifacts(
             job, job['dependencies']
         )