Bug 1513000 - expose revision as an attribute on the openh264 jobs. r=tomprince
authorJustin Wood <Callek@gmail.com>
Fri, 01 Mar 2019 02:18:17 +0000
changeset 519728 9ce8f26f311b014e4a5c2c140b52859fd1ffdb2b
parent 519727 51e72b19a61750014dd634b87aeec3b25e049af7
child 519729 81a50b35b482f6a24a3231ffcd7766381012035a
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince
bugs1513000
milestone67.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 1513000 - expose revision as an attribute on the openh264 jobs. r=tomprince Differential Revision: https://phabricator.services.mozilla.com/D21606
taskcluster/ci/openh264-plugin/kind.yml
taskcluster/docs/attributes.rst
taskcluster/taskgraph/transforms/openh264.py
--- a/taskcluster/ci/openh264-plugin/kind.yml
+++ b/taskcluster/ci/openh264-plugin/kind.yml
@@ -3,30 +3,30 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 loader: taskgraph.loader.transform:loader
 
 kind-dependencies:
     - toolchain
 
 transforms:
+    - taskgraph.transforms.openh264:transforms
     - taskgraph.transforms.use_toolchains:transforms
     - taskgraph.transforms.job:transforms
     - taskgraph.transforms.task:transforms
 
 job-defaults:
     description: "Build OpenH264 plugin"
     treeherder:
         kind: build
         symbol: h264
         tier: 2
     run-on-projects: []
-    run:
-        options: ['repo=https://github.com/cisco/openh264.git',
-                  'rev=2e1774ab6dc6c43debb0b5b628bdf122a391d521']
+    repo: 'https://github.com/cisco/openh264.git'
+    revision: '2e1774ab6dc6c43debb0b5b628bdf122a391d521'
 
 jobs:
     linux32/opt:
         attributes:
             build_platform: linux32
             build_type: opt
         treeherder:
             platform: linux32/opt
@@ -136,25 +136,25 @@ jobs:
             platform: android-api-16/opt
         worker-type: aws-provisioner-v1/gecko-{level}-b-android
         worker:
             max-run-time: 1800
             artifacts:
                 - name: private/openh264
                   path: /builds/worker/workspace/build/openh264/artifacts
                   type: directory
+        # This rev includes Android Makefile fixes from after
+        # the 1.8.1 release
+        repo: https://github.com/dminor/openh264.git
+        revision: 42954cf0fe8a2bdc97fdc180462a3eaefceb035f
         run:
             using: mozharness
             script: mozharness/scripts/openh264_build.py
             config:
                 - openh264/android-arm.py
-            # This rev includes Android Makefile fixes from after
-            # the 1.8.1 release
-            options: ['repo=https://github.com/dminor/openh264.git',
-                      'rev=42954cf0fe8a2bdc97fdc180462a3eaefceb035f']
             tooltool-downloads: internal
         toolchains:
             - android-ndk-linux
             - android-sdk-linux
             - linux64-clang
     android-aarch64/opt:
         attributes:
             build_platform: android
@@ -163,25 +163,25 @@ jobs:
             platform: android-5-0-aarch64/opt
         worker-type: aws-provisioner-v1/gecko-{level}-b-android
         worker:
             max-run-time: 1800
             artifacts:
                 - name: private/openh264
                   path: /builds/worker/workspace/build/openh264/artifacts
                   type: directory
+        # This rev includes Android Makefile fixes from after
+        # the 1.8.1 release
+        repo: https://github.com/dminor/openh264.git
+        revision: 42954cf0fe8a2bdc97fdc180462a3eaefceb035f
         run:
             using: mozharness
             script: mozharness/scripts/openh264_build.py
             config:
                 - openh264/android-aarch64.py
-            # This rev includes Android Makefile fixes from after
-            # the 1.8.1 release
-            options: ['repo=https://github.com/dminor/openh264.git',
-                      'rev=42954cf0fe8a2bdc97fdc180462a3eaefceb035f']
             tooltool-downloads: internal
         toolchains:
             - android-ndk-linux
             - android-sdk-linux
             - linux64-clang
     android-x86/opt:
         attributes:
             build_platform: android
@@ -190,25 +190,25 @@ jobs:
             platform: android-4-2-x86/opt
         worker-type: aws-provisioner-v1/gecko-{level}-b-android
         worker:
             max-run-time: 1800
             artifacts:
                 - name: private/openh264
                   path: /builds/worker/workspace/build/openh264/artifacts
                   type: directory
+        # This rev includes Android Makefile fixes from after
+        # the 1.8.1 release
+        repo: https://github.com/dminor/openh264.git
+        revision: 42954cf0fe8a2bdc97fdc180462a3eaefceb035f
         run:
             using: mozharness
             script: mozharness/scripts/openh264_build.py
             config:
                 - openh264/android-x86.py
-            # This rev includes Android Makefile fixes from after
-            # the 1.8.1 release
-            options: ['repo=https://github.com/dminor/openh264.git',
-                      'rev=42954cf0fe8a2bdc97fdc180462a3eaefceb035f']
             tooltool-downloads: internal
         toolchains:
             - android-ndk-linux
             - android-sdk-linux
             - linux64-clang
     android-x86_64/opt:
         attributes:
             build_platform: android
@@ -217,22 +217,22 @@ jobs:
             platform: android-5-0-x86_64/opt
         worker-type: aws-provisioner-v1/gecko-{level}-b-android
         worker:
             max-run-time: 1800
             artifacts:
                 - name: private/openh264
                   path: /builds/worker/workspace/build/openh264/artifacts
                   type: directory
+        # This rev includes Android Makefile fixes from after
+        # the 1.8.1 release
+        repo: https://github.com/dminor/openh264.git
+        revision: 42954cf0fe8a2bdc97fdc180462a3eaefceb035f
         run:
             using: mozharness
             script: mozharness/scripts/openh264_build.py
             config:
                 - openh264/android-x86_64.py
-            # This rev includes Android Makefile fixes from after
-            # the 1.8.1 release
-            options: ['repo=https://github.com/dminor/openh264.git',
-                      'rev=42954cf0fe8a2bdc97fdc180462a3eaefceb035f']
             tooltool-downloads: internal
         toolchains:
             - android-ndk-linux
             - android-sdk-linux
             - linux64-clang
--- a/taskcluster/docs/attributes.rst
+++ b/taskcluster/docs/attributes.rst
@@ -286,8 +286,12 @@ A list of release signoffs that this kin
 require these signoffs. For example, ``mar-signing`` signoffs may be required
 by some releases in the future; for any releases that require ``mar-signing``
 signoffs, the kinds that also require that signoff are marked with this
 attribute.
 
 update-channel
 ==============
 The update channel the build is configured to use.
+
+openh264_rev
+============
+Only used for openh264 plugin builds, used to signify the revision (and thus inform artifact name) of the given build.
new file mode 100644
--- /dev/null
+++ b/taskcluster/taskgraph/transforms/openh264.py
@@ -0,0 +1,35 @@
+# 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/.
+"""
+This transform is used to help populate mozharness options for openh264 jobs
+"""
+
+from __future__ import absolute_import
+
+from taskgraph.transforms.base import TransformSequence
+
+transforms = TransformSequence()
+
+
+@transforms.add
+def set_mh_options(config, jobs):
+    """
+    This transform enables coalescing for tasks with scm level > 1, setting the
+    name to be equal to the the first 20 chars of the sha256 of the task name
+    (label). The hashing is simply used to keep the name short, unique, and
+    alphanumeric, since it is used in AMQP routing keys.
+
+    Note, the coalescing keys themselves are not intended to be readable
+    strings or embed information. The tasks they represent contain all relevant
+    metadata.
+    """
+    for job in jobs:
+        repo = job.pop('repo')
+        rev = job.pop('revision')
+        attributes = job.setdefault('attributes', {})
+        attributes['openh264_rev'] = rev
+        run = job.setdefault('run', {})
+        options = run.setdefault('options', [])
+        options.extend(['repo={}'.format(repo), 'rev={}'.format(rev)])
+        yield job