Bug 1286075: add a (temporary) android-stuff kind; r=nalexander
authorDustin J. Mitchell <dustin@mozilla.com>
Thu, 08 Sep 2016 00:25:48 +0000
changeset 313719 e612e0d4d0f17bfd1a75ecc4f3f3aff847a53245
parent 313718 1f902d2cb8aea3362ef62ad1d4d875a9d31fb58f
child 313720 e96a7223e0d0032ac9d17c477393d5f596349317
push id20528
push userryanvm@gmail.com
push dateWed, 14 Sep 2016 00:48:16 +0000
treeherderfx-team@8a996d7c71a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1286075
milestone51.0a1
Bug 1286075: add a (temporary) android-stuff kind; r=nalexander This leaves a lot of room for improvement, but gets the job done for now. MozReview-Commit-ID: HmeTxZjOfOb
taskcluster/ci/android-stuff/kind.yml
taskcluster/taskgraph/transforms/android_stuff.py
taskcluster/taskgraph/try_option_syntax.py
new file mode 100644
--- /dev/null
+++ b/taskcluster/ci/android-stuff/kind.yml
@@ -0,0 +1,242 @@
+# 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/.
+
+# The name of this kind should suggest it's not meant to be permanent.  This is
+# a temporary place to generate these tasks in Bug 1286075 until they are
+# rewritten in a better way.
+
+implementation: taskgraph.task.transform:TransformTask
+
+transforms:
+   - taskgraph.transforms.android_stuff:transforms
+   - taskgraph.transforms.task:transforms
+
+jobs:
+    android-api-15-gradle-dependencies:
+        description: "Android armv7 API 15+ gradle dependencies"
+        attributes:
+            build_platform: android-api-15-gradle-dependencies
+            build_type: opt
+        index:
+            product: mobile
+            job-name: android-api-15-gradle-dependencies-opt
+        treeherder:
+            platform: android-4-0-armv7-api15/opt
+            kind: build
+            tier: 2
+            symbol: tc(Deps)
+        worker-type: aws-provisioner-v1/android-api-15
+        worker:
+            implementation: docker-worker
+            docker-image: {in-tree: android-gradle-build}
+            env:
+                GRADLE_USER_HOME: "/home/worker/workspace/build/src/dotgradle-online"
+                MH_BUILD_POOL: "taskcluster"
+                MH_CUSTOM_BUILD_VARIANT_CFG: "api-15-gradle-dependencies"
+                MOZHARNESS_ACTIONS: "get-secrets build multi-l10n update"
+                MOZHARNESS_CONFIG: >
+                    builds/releng_base_android_64_builds.py
+                    disable_signing.py
+                    platform_supports_post_upload_to_latest.py
+                MOZHARNESS_SCRIPT: "mozharness/scripts/fx_desktop_build.py"
+                TOOLTOOL_CACHE: "/home/worker/tooltool-cache"
+                TOOLTOOL_REPO: "https://github.com/mozilla/build-tooltool"
+                TOOLTOOL_REV: "master"
+            artifacts:
+              - name: public/build
+                path: /home/worker/artifacts/
+                type: directory
+            caches:
+              - name: tooltool-cache
+                mount-point: /home/worker/tooltool-cache
+                type: persistent
+            relengapi-proxy: true
+            command:
+              - "/bin/bash"
+              - "-c"
+              - "/home/worker/bin/before.sh && /home/worker/bin/build.sh && /home/worker/bin/after.sh && true\n"
+            max-run-time: 36000
+        scopes:
+          - docker-worker:relengapi-proxy:tooltool.download.internal
+          - docker-worker:relengapi-proxy:tooltool.download.public
+        when:
+            files-changed:
+              - "mobile/android/config/**"
+              - "testing/docker/android-gradle-build/**"
+              - "testing/mozharness/configs/builds/releng_sub_android_configs/*gradle_dependencies.py"
+              - "**/*.gradle"
+
+    android-test:
+        description: "Android armv7 unit tests"
+        attributes:
+            build_platform: android-test
+            build_type: opt
+        index:
+            product: mobile
+            job-name: android-test-opt
+        treeherder:
+            platform: android-4-0-armv7-api15/opt
+            kind: build
+            tier: 2
+            symbol: tc(test)
+        worker-type: aws-provisioner-v1/android-api-15
+        worker:
+            implementation: docker-worker
+            docker-image: {in-tree: desktop-build}
+            env:
+                GRADLE_USER_HOME: "/home/worker/workspace/build/src/dotgradle"
+                MH_BUILD_POOL: "taskcluster"
+                MH_CUSTOM_BUILD_VARIANT_CFG: "android-test"
+                MOZHARNESS_ACTIONS: "get-secrets build multi-l10n update"
+                MOZHARNESS_CONFIG: >
+                    builds/releng_base_android_64_builds.py
+                    disable_signing.py
+                    platform_supports_post_upload_to_latest.py
+                MOZHARNESS_SCRIPT: "mozharness/scripts/fx_desktop_build.py"
+                TOOLTOOL_REPO: "https://github.com/mozilla/build-tooltool"
+                TOOLTOOL_REV: "master"
+            artifacts:
+              - name: public/android/unittest
+                path: /home/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/app/reports/tests
+                type: directory
+              - name: public/build
+                path: /home/worker/artifacts/
+                type: directory
+            caches:
+              - name: tooltool-cache
+                mount-point: /home/worker/tooltool-cache
+                type: persistent
+            relengapi-proxy: true
+            command:
+              # NOTE: this could probably be a job description with run.using = 'mozharness'
+              - "/bin/bash"
+              - "bin/build.sh"
+            max-run-time: 36000
+        scopes:
+          - docker-worker:relengapi-proxy:tooltool.download.internal
+          - docker-worker:relengapi-proxy:tooltool.download.public
+        when:
+            files-changed:
+              - "mobile/android/base/**"
+              - "mobile/android/tests/background/junit4/**"
+
+    android-lint:
+        description: "Android lint"
+        attributes:
+            build_platform: android-lint
+            build_type: opt
+        index:
+            product: mobile
+            job-name: android-lint-opt
+        treeherder:
+            platform: android-4-0-armv7-api15/opt
+            kind: build
+            tier: 2
+            symbol: tc(lint)
+        worker-type: aws-provisioner-v1/android-api-15
+        worker:
+            implementation: docker-worker
+            docker-image: {in-tree: desktop-build}
+            env:
+                GRADLE_USER_HOME: "/home/worker/workspace/build/src/dotgradle"
+                MH_BUILD_POOL: "taskcluster"
+                MH_CUSTOM_BUILD_VARIANT_CFG: "android-lint"
+                MOZHARNESS_ACTIONS: "get-secrets build multi-l10n update"
+                MOZHARNESS_CONFIG: >
+                    builds/releng_base_android_64_builds.py
+                    disable_signing.py
+                    platform_supports_post_upload_to_latest.py
+                MOZHARNESS_SCRIPT: "mozharness/scripts/fx_desktop_build.py"
+                TOOLTOOL_REPO: "https://github.com/mozilla/build-tooltool"
+                TOOLTOOL_REV: "master"
+            artifacts:
+              - name: public/android/lint/lint-results-automationDebug.html
+                path: /home/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/app/outputs/lint-results-automationDebug.html
+                type: file
+              - name: public/android/lint/lint-results-automationDebug.xml
+                path: /home/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/app/outputs/lint-results-automationDebug.xml
+                type: file
+              - name: public/android/lint/lint-results-automationDebug_files
+                path: /home/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/app/outputs/lint-results-automationDebug_files
+                type: directory
+              - name: public/build
+                path: /home/worker/artifacts/
+                type: directory
+            caches:
+              - name: tooltool-cache
+                mount-point: /home/worker/tooltool-cache
+                type: persistent
+            relengapi-proxy: true
+            command:
+              # NOTE: this could probably be a job description with run.using = 'mozharness'
+              - "/bin/bash"
+              - "bin/build.sh"
+            max-run-time: 36000
+        scopes:
+          - docker-worker:relengapi-proxy:tooltool.download.internal
+          - docker-worker:relengapi-proxy:tooltool.download.public
+        when:
+            files-changed:
+              - "mobile/android/**/*.java"
+              - "mobile/android/**/*.jpeg"
+              - "mobile/android/**/*.jpg"
+              - "mobile/android/**/*.png"
+              - "mobile/android/**/*.svg"
+              - "mobile/android/**/*.xml" # Manifest & android resources
+              - "mobile/android/**/build.gradle"
+
+    android-checkstyle:
+        description: "Android checkstyle"
+        attributes:
+            build_platform: android-checkstyle
+            build_type: opt
+        index:
+            product: mobile
+            job-name: android-checkstyle-opt
+        treeherder:
+            platform: android-4-0-armv7-api15/opt
+            kind: build
+            tier: 2
+            symbol: tc(checkstyle)
+        worker-type: aws-provisioner-v1/android-api-15
+        worker:
+            implementation: docker-worker
+            docker-image: {in-tree: desktop-build}
+            env:
+                GRADLE_USER_HOME: "/home/worker/workspace/build/src/dotgradle"
+                MH_BUILD_POOL: "taskcluster"
+                MH_CUSTOM_BUILD_VARIANT_CFG: "android-checkstyle"
+                MOZHARNESS_ACTIONS: "get-secrets build multi-l10n update"
+                MOZHARNESS_CONFIG: >
+                    builds/releng_base_android_64_builds.py
+                    disable_signing.py
+                    platform_supports_post_upload_to_latest.py
+                MOZHARNESS_SCRIPT: "mozharness/scripts/fx_desktop_build.py"
+                TOOLTOOL_REPO: "https://github.com/mozilla/build-tooltool"
+                TOOLTOOL_REV: "master"
+            artifacts:
+              - name: public/android/checkstyle/checkstyle.xml
+                path: /home/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/app/reports/checkstyle/checkstyle.xml
+                type: file
+              - name: public/build
+                path: /home/worker/artifacts/
+                type: directory
+            caches:
+              - name: tooltool-cache
+                mount-point: /home/worker/tooltool-cache
+                type: persistent
+            relengapi-proxy: true
+            command:
+              # NOTE: this could probably be a job description with run.using = 'mozharness'
+              - "/bin/bash"
+              - "bin/build.sh"
+            max-run-time: 36000
+        scopes:
+          - docker-worker:relengapi-proxy:tooltool.download.internal
+          - docker-worker:relengapi-proxy:tooltool.download.public
+        when:
+            files-changed:
+              - "mobile/android/**/checkstyle.xml"
+              - "mobile/android/**/*.gradle"
+              - "mobile/android/**/*.java"
new file mode 100644
--- /dev/null
+++ b/taskcluster/taskgraph/transforms/android_stuff.py
@@ -0,0 +1,48 @@
+# 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/.
+"""
+Set dynamic task description properties of the android stuff.  Temporary!
+"""
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+import time
+from taskgraph.transforms.base import TransformSequence
+
+transforms = TransformSequence()
+
+
+@transforms.add
+def setup_task(config, tasks):
+    for task in tasks:
+        task['label'] = task['name']
+        env = task['worker'].setdefault('env', {})
+        env.update({
+            'GECKO_BASE_REPOSITORY': config.params['base_repository'],
+            'GECKO_HEAD_REF': config.params['head_rev'],
+            'GECKO_HEAD_REPOSITORY': config.params['head_repository'],
+            'GECKO_HEAD_REV': config.params['head_rev'],
+            'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S",
+                                            time.gmtime(config.params['pushdate'])),
+            'MOZ_SCM_LEVEL': config.params['level'],
+            'MH_BRANCH': config.params['project'],
+        })
+
+        task['worker'].setdefault('caches', []).append({
+            'type': 'persistent',
+            'name': 'level-{}-{}-tc-vcs'.format(
+                config.params['level'], config.params['project']),
+            'mount-point': "/home/worker/.tc-vcs",
+        })
+
+        if int(config.params['level']) > 1:
+            task['worker'].setdefault('caches', []).append({
+                'type': 'persistent',
+                'name': 'level-{}-{}-build-{}-workspace'.format(
+                    config.params['level'], config.params['project'], task['name']),
+                'mount-point': "/home/worker/workspace",
+            })
+
+        del task['name']
+        yield task
--- a/taskcluster/taskgraph/try_option_syntax.py
+++ b/taskcluster/taskgraph/try_option_syntax.py
@@ -34,16 +34,17 @@ BUILD_KINDS = set([
     'b2g-device',
 ])
 
 # anything in this list is governed by -j
 JOB_KINDS = set([
     'source-check',
     'toolchain',
     'marionette-harness',
+    'android-stuff',
 ])
 
 
 # mapping from shortcut name (usable with -u) to a boolean function identifying
 # matching test names
 def alias_prefix(prefix):
     return lambda name: name.startswith(prefix)