Bug 1286075: add a b2g-device kind; r=gerard-majax draft
authorDustin J. Mitchell <dustin@mozilla.com>
Mon, 12 Sep 2016 18:04:18 +0000
changeset 412754 81f48fbd380d79773319781c5db84a0056c9341f
parent 412753 ec4070eab92f63694fadf070856aafdc5689efb5
child 412755 bf1b9c76da7d39d46672a130b031081999e97ed2
push id29252
push userdmitchell@mozilla.com
push dateMon, 12 Sep 2016 19:16:39 +0000
reviewersgerard-majax
bugs1286075
milestone51.0a1
Bug 1286075: add a b2g-device kind; r=gerard-majax MozReview-Commit-ID: GaP2xGF3WzJ
taskcluster/ci/b2g-device/kind.yml
taskcluster/docs/kinds.rst
taskcluster/taskgraph/transforms/job/phone_builder.py
taskcluster/taskgraph/transforms/task.py
taskcluster/taskgraph/try_option_syntax.py
new file mode 100644
--- /dev/null
+++ b/taskcluster/ci/b2g-device/kind.yml
@@ -0,0 +1,98 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+implementation: taskgraph.task.transform:TransformTask
+
+transforms:
+   - taskgraph.transforms.build_attrs:transforms
+   - taskgraph.transforms.job:transforms
+   - taskgraph.transforms.task:transforms
+
+job-defaults:
+    worker-type: aws-provisioner-v1/flame-kk
+    worker:
+        implementation: docker-worker
+        docker-image: {in-tree: phone-builder}
+        max-run-time: 14400
+        env:
+            MOZILLA_OFFICIAL: '1'
+            ENABLE_DEFAULT_BOOTANIMATION: 'true'
+            B2G_UPDATER: '1'
+            REPO_TRACE: '1'
+            DEBUG: '0' 
+            VARIANT: eng
+            GAIA_OPTIMIZE: '1'
+            B2G_SYSTEM_APPS: '1'
+            MOZ_TELEMETRY_REPORTING: '1'
+            MOZ_CRASHREPORTER_NO_REPORT: '1'
+            GAIA_KEYBOARD_LAYOUTS: 'en,pt-BR,es,de,fr,pl,zh-Hans-Pinyin,zh-Hant-Zhuyin,en-Dvorak'
+            B2G_UPDATE_CHANNEL: 'default'
+    treeherder:
+        kind: build
+        tier: 3
+    run-on-projects:
+      - try
+      - mozilla-central
+      - integration
+      - pine
+
+
+jobs:
+    aries-eng/opt:
+        description: "B2G Aries Opt"
+        index:
+            product: b2g
+            job-name:
+                gecko-v1: aries-eng.opt
+                gecko-v2: aries-eng-opt
+        treeherder:
+            platform: b2g-device-image/opt
+            symbol: Aries(Be)
+        run:
+            using: phone-builder
+            target: aries
+
+    aries-eng/debug:
+        description: "B2G Aries Debug"
+        index:
+            product: b2g
+            job-name:
+                gecko-v1: aries.debug
+                gecko-v2: aries-debug
+        treeherder:
+            platform: b2g-device-image/debug
+            symbol: Aries(Bd)
+        run:
+            using: phone-builder
+            target: aries
+            debug: true
+
+    nexus-5l-eng/opt:
+        description: "B2G Nexus 5-L Opt"
+        index:
+            product: b2g
+            job-name:
+                gecko-v1: nexus-5-l-eng.opt
+                gecko-v2: nexus-5-l-eng-opt
+        treeherder:
+            platform: b2g-device-image/opt
+            symbol: Nexus 5-L(Be)
+        run:
+            using: phone-builder
+            target: nexus-5-l
+
+    nexus-5l-eng/debug:
+        description: "B2G Nexus 5-L Debug"
+        index:
+            product: b2g
+            job-name:
+                gecko-v1: nexus-5-l-eng.debug
+                gecko-v2: nexus-5-l-eng-debug
+        treeherder:
+            platform: b2g-device-image/debug
+            symbol: Nexus 5-L(Bd)
+        run:
+            using: phone-builder
+            target: nexus-5-l
+            debug: true
--- a/taskcluster/docs/kinds.rst
+++ b/taskcluster/docs/kinds.rst
@@ -65,16 +65,23 @@ will eventually be dependencies of the b
 are run manually via try pushes and the results uploaded to tooltool.
 
 spidermonkey
 ------------
 
 Spidermonkey tasks check out the full gecko source tree, then compile only the
 spidermonkey portion.  Each task runs specific tests after the build.
 
+b2g-device
+----------
+
+B2G device builds produce binaries targetted to specific devices.  These
+involve some device-specific binaries which are not redistributable, so the
+inputs to and outputs from these tasks are restricted.
+
 Tests
 -----
 
 Test tasks for Gecko products are divided into several kinds, but share a
 common implementation.  The process goes like this, based on a set of YAML
 files named in ``kind.yml``:
 
  * For each build task, determine the related test platforms based on the build
new file mode 100644
--- /dev/null
+++ b/taskcluster/taskgraph/transforms/job/phone_builder.py
@@ -0,0 +1,88 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+"""
+Support for running phone-builder tasks via the phone-builder script.
+"""
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+import time
+from voluptuous import Schema, Required
+
+from taskgraph.transforms.job import run_job_using
+from taskgraph.transforms.job.common import (
+    docker_worker_add_gecko_vcs_env_vars,
+    docker_worker_add_tc_vcs_cache
+)
+
+phone_builder_linux_schema = Schema({
+    Required('using'): 'phone-builder',
+
+    # if true, this is a debug run
+    Required('debug', default=False): bool,
+
+    # the TARGET to run
+    Required('target'): basestring,
+})
+
+
+@run_job_using("docker-worker", "phone-builder", schema=phone_builder_linux_schema)
+def docker_worker_phone_builder(config, job, taskdesc):
+    run = job['run']
+    worker = taskdesc.get('worker')
+
+    worker['artifacts'] = [{
+        'name': 'private/build',
+        'path': '/home/worker/artifacts/',
+        'type': 'directory',
+    }, {
+        'name': 'public/build',
+        'path': '/home/worker/artifacts-public/',
+        'type': 'directory',
+    }]
+
+    docker_worker_add_tc_vcs_cache(config, job, taskdesc)
+    docker_worker_add_gecko_vcs_env_vars(config, job, taskdesc)
+
+    if config.params['project'] != 'try':
+        taskdesc['worker']['caches'].append({
+            'type': 'persistent',
+            'name': 'level-{}-{}-build-{}-{}'.format(
+                config.params['level'], config.params['project'],
+                taskdesc['attributes']['build_platform'],
+                taskdesc['attributes']['build_type'],),
+            'mount-point': "/home/worker/workspace",
+        })
+        taskdesc['worker']['caches'].append({
+            'type': 'persistent', 'name':
+            'level-{}-{}-build-{}-{}-objdir-gecko'.format(
+                config.params['level'], config.params['project'],
+                taskdesc['attributes']['build_platform'],
+                taskdesc['attributes']['build_type'],),
+            'mount-point': "/home/worker/objdir-gecko",
+        })
+
+    env = worker.setdefault('env', {})
+    env.update({
+        'MOZHARNESS_CONFIG': 'b2g/taskcluster-phone-eng.py',
+        'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
+        'TARGET': run['target'],
+    })
+    if run['debug']:
+        env['B2G_DEBUG'] = '1'
+
+    # tooltool downloads
+    worker['relengapi-proxy'] = True
+    taskdesc['scopes'].extend([
+        'docker-worker:relengapi-proxy:tooltool.download.internal',
+        'docker-worker:relengapi-proxy:tooltool.download.public',
+    ])
+
+    worker['command'] = [
+        "/bin/bash",
+        "-c",
+        "checkout-gecko workspace"
+        " && cd ./workspace/gecko/taskcluster/scripts/phone-builder"
+        " && buildbot_step 'Build' ./build-phone.sh $HOME/workspace",
+    ]
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -237,16 +237,18 @@ GROUP_NAMES = {
     'tc-R': 'Reftests executed by TaskCluster',
     'tc-R-e10s': 'Reftests executed by TaskCluster with e10s',
     'tc-VP': 'VideoPuppeteer tests executed by TaskCluster',
     'tc-W': 'Web platform tests executed by TaskCluster',
     'tc-W-e10s': 'Web platform tests executed by TaskCluster with e10s',
     'tc-X': 'Xpcshell tests executed by TaskCluster',
     'tc-X-e10s': 'Xpcshell tests executed by TaskCluster with e10s',
     'tc-Sim': 'Mulet simulator runs',
+    'Aries': 'Aries Device Image',
+    'Nexus 5-L': 'Nexus 5-L Device Image',
     'Cc': 'Toolchain builds',
     'SM-tc': 'Spidermonkey builds',
 }
 UNKNOWN_GROUP_NAME = "Treeherder group {} has no name; add it to " + __file__
 
 BUILDBOT_ROUTE_TEMPLATES = [
     "index.buildbot.branches.{project}.{job-name-buildbot}",
     "index.buildbot.revisions.{head_rev}.{project}.{job-name-buildbot}",
--- a/taskcluster/taskgraph/try_option_syntax.py
+++ b/taskcluster/taskgraph/try_option_syntax.py
@@ -26,16 +26,17 @@ BUILD_KINDS = set([
     'build',
     'artifact-build',
     'hazard',
     'l10n',
     'upload-symbols',
     'valgrind',
     'static-analysis',
     'spidermonkey',
+    'b2g-device',
 ])
 
 # anything in this list is governed by -j
 JOB_KINDS = set([
     'source-check',
     'toolchain',
 ])