Skip to content

Commit

Permalink
Bug 1501878 - add mar-signing{,-l10n} kinds. r=tomprince
Browse files Browse the repository at this point in the history
also rename the partials_signing transform to mar_signing.

Differential Revision: https://phabricator.services.mozilla.com/D11731

--HG--
rename : taskcluster/taskgraph/transforms/partials_signing.py => taskcluster/taskgraph/transforms/mar_signing.py
extra : moz-landing-system : lando
  • Loading branch information
escapewindow committed Nov 16, 2018
1 parent 78d5fe5 commit 34f6a8c
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 15 deletions.
1 change: 1 addition & 0 deletions taskcluster/ci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ treeherder:
'pub': 'APK publishing'
'p': 'Partial generation'
'ps': 'Partials signing'
'ms': 'Complete MAR signing'
'Rel': 'Release promotion'
'Snap': 'Snap image generation'
'langpack': 'Langpack sigatures and uploads'
Expand Down
31 changes: 31 additions & 0 deletions taskcluster/ci/mar-signing-l10n/kind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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/.

loader: taskgraph.loader.single_dep:loader

transforms:
- taskgraph.transforms.name_sanity:transforms
- taskgraph.transforms.mar_signing:transforms
- taskgraph.transforms.task:transforms

kind-dependencies:
- repackage-l10n

only-for-build-platforms:
- linux-nightly/opt
- linux-devedition-nightly/opt
- linux64-nightly/opt
- linux64-devedition-nightly/opt
- linux64-asan-reporter-nightly/opt
- macosx64-nightly/opt
- macosx64-devedition-nightly/opt
- win32-nightly/opt
- win32-devedition-nightly/opt
- win64-nightly/opt
- win64-devedition-nightly/opt

job-template:
shipping-phase: promote
treeherder-group: ms
description-suffix: 'mar signing'
33 changes: 33 additions & 0 deletions taskcluster/ci/mar-signing/kind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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/.

loader: taskgraph.loader.single_dep:loader

transforms:
- taskgraph.transforms.name_sanity:transforms
- taskgraph.transforms.mar_signing:transforms
- taskgraph.transforms.task:transforms

kind-dependencies:
- repackage

only-for-build-platforms:
- linux-nightly/opt
- linux-devedition-nightly/opt
- linux64-nightly/opt
- linux64-devedition-nightly/opt
- linux64-asan-reporter-nightly/opt
- macosx64-nightly/opt
- macosx64-devedition-nightly/opt
- win32-nightly/opt
- win32-devedition-nightly/opt
- win64-nightly/opt
- win64-devedition-nightly/opt
- linux64-asan-reporter-nightly/opt
- win64-asan-reporter-nightly/opt

job-template:
shipping-phase: promote
treeherder-group: ms
description-suffix: 'mar signing'
4 changes: 3 additions & 1 deletion taskcluster/ci/partials-signing/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ loader: taskgraph.loader.single_dep:loader

transforms:
- taskgraph.transforms.name_sanity:transforms
- taskgraph.transforms.partials_signing:transforms
- taskgraph.transforms.mar_signing:transforms
- taskgraph.transforms.task:transforms

kind-dependencies:
- partials

job-template:
shipping-phase: promote
treeherder-group: ps
description-suffix: 'partial signing'
14 changes: 10 additions & 4 deletions taskcluster/docs/kinds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,19 @@ Repackage-L10n is a ```Repackage``` task split up to be suitable for use after l

repackage-signing
-----------------
Repackage-signing take the repackaged installers (windows) and update packaging (with
the signed internal bits) and signs them.
Repackage-signing take the repackaged installers (windows) and signs them.

repackage-signing-l10n
----------------------
Repackage-signing take the repackaged installers (windows) and update packaging (with
the signed internal bits) and signs them for localized versions.
Repackage-signing-l10n take the repackaged installers (windows) and signs them for localized versions.

mar-signing
-----------
Mar-signing takes the complete update MARs and signs them.

mar-signing-l10n
----------------
Mar-signing-l10n takes the complete update MARs and signs them for localized versions.

repackage-msi
-------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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/.
"""
Transform the partials task into an actual task description.
Transform the {partials,mar}-signing task into an actual task description.
"""
from __future__ import absolute_import, print_function, unicode_literals

Expand All @@ -14,14 +14,15 @@
)
from taskgraph.util.partials import get_balrog_platform_name, get_partials_artifacts
from taskgraph.util.taskcluster import get_artifact_prefix
from taskgraph.util.treeherder import join_symbol

import logging
logger = logging.getLogger(__name__)

transforms = TransformSequence()


def generate_upstream_artifacts(job, release_history, platform, locale=None):
def generate_partials_artifacts(job, release_history, platform, locale=None):
artifact_prefix = get_artifact_prefix(job)
if locale:
artifact_prefix = '{}/{}'.format(artifact_prefix, locale)
Expand Down Expand Up @@ -62,17 +63,38 @@ def generate_upstream_artifacts(job, release_history, platform, locale=None):
return upstream_artifacts


def generate_complete_artifacts(job, platform, locale=None):
artifact_prefix = get_artifact_prefix(job)
if locale:
artifact_prefix = '{}/{}'.format(artifact_prefix, locale)

upstream_artifacts = [{
"taskId": {"task-reference": '<{}>'.format(job.kind)},
"taskType": 'build',
"paths": [
"{}/target.complete.mar".format(artifact_prefix)
],
"formats": ["autograph_hash_only_mar384"],
}]

return upstream_artifacts


@transforms.add
def make_task_description(config, jobs):
for job in jobs:
dep_job = job['primary-dependency']
locale = dep_job.attributes.get('locale')

treeherder = job.get('treeherder', {})
treeherder.setdefault('symbol', 'ps(N)')
treeherder['symbol'] = join_symbol(
job.get('treeherder-group', 'ms'),
locale or 'N'
)

dep_th_platform = dep_job.task.get('extra', {}).get(
'treeherder', {}).get('machine', {}).get('platform', '')
label = job.get('label', "partials-signing-{}".format(dep_job.label))
label = job.get('label', "{}-{}".format(config.kind, dep_job.label))
dep_th_platform = dep_job.task.get('extra', {}).get(
'treeherder', {}).get('machine', {}).get('platform', '')
treeherder.setdefault('platform',
Expand All @@ -88,14 +110,17 @@ def make_task_description(config, jobs):
dependencies.update(signing_dependencies)

attributes = copy_attributes_from_dependent_job(dep_job)
locale = dep_job.attributes.get('locale')
attributes['shipping_phase'] = job['shipping-phase']
if locale:
attributes['locale'] = locale
treeherder['symbol'] = 'ps({})'.format(locale)

balrog_platform = get_balrog_platform_name(dep_th_platform)
upstream_artifacts = generate_upstream_artifacts(
dep_job, config.params['release_history'], balrog_platform, locale)
if config.kind == 'partials-signing':
upstream_artifacts = generate_partials_artifacts(
dep_job, config.params['release_history'], balrog_platform, locale)
else:
upstream_artifacts = generate_complete_artifacts(
dep_job, balrog_platform, locale)

build_platform = dep_job.attributes.get('build_platform')
is_nightly = dep_job.attributes.get('nightly')
Expand All @@ -109,8 +134,8 @@ def make_task_description(config, jobs):

task = {
'label': label,
'description': "{} Partials".format(
dep_job.task["metadata"]["description"]),
'description': "{} {}".format(
dep_job.task["metadata"]["description"], job['description-suffix']),
'worker-type': get_worker_type_for_scope(config, signing_cert_scope),
'worker': {'implementation': 'scriptworker-signing',
'upstream-artifacts': upstream_artifacts,
Expand Down

0 comments on commit 34f6a8c

Please sign in to comment.