mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-11 14:28:42 +00:00
Bug 1355969 - Migrate post_build (upload_symbols) to use single_dep loader. r=dustin
MozReview-Commit-ID: FEugQ5eZxTI --HG-- extra : rebase_source : f303f97c81df4d78193ffba63b4715f2aa51a4d8
This commit is contained in:
parent
b8a15853be
commit
9d5b5dc245
@ -1,20 +0,0 @@
|
||||
label: # see transforms
|
||||
description: Upload Symbols
|
||||
dependencies: # see transforms
|
||||
expires-after: 7 days
|
||||
deadline-after: 24 hours
|
||||
run-on-projects:
|
||||
- try
|
||||
- release
|
||||
worker-type: aws-provisioner-v1/gecko-symbol-upload
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 600
|
||||
command: ["/bin/bash", "bin/upload.sh"]
|
||||
docker-image: taskclusterprivate/upload_symbols:0.0.4
|
||||
env:
|
||||
GECKO_HEAD_REPOSITORY: # see transforms
|
||||
GECKO_HEAD_REV: # see transforms
|
||||
ARTIFACT_TASKID: {"task-reference": "<build>"}
|
||||
scopes:
|
||||
- docker-worker:image:taskclusterprivate/upload_symbols:0.0.4
|
@ -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/.
|
||||
|
||||
loader: taskgraph.loader.post_build:loader
|
||||
loader: taskgraph.loader.single_dep:loader
|
||||
|
||||
transforms:
|
||||
- taskgraph.transforms.upload_symbols:transforms
|
||||
@ -11,8 +11,6 @@ transforms:
|
||||
kind-dependencies:
|
||||
- build
|
||||
|
||||
job-template: job-template.yml
|
||||
|
||||
only-for-build-platforms:
|
||||
- linux64/opt
|
||||
- linux64/debug
|
||||
@ -21,3 +19,25 @@ only-for-build-platforms:
|
||||
- android-api-15/opt
|
||||
- android-api-15-nightly/opt
|
||||
- android-x86-nightly/opt
|
||||
|
||||
job-template:
|
||||
label: # see transforms
|
||||
description: Upload Symbols
|
||||
dependencies: # see transforms
|
||||
expires-after: 7 days
|
||||
deadline-after: 24 hours
|
||||
run-on-projects:
|
||||
- try
|
||||
- release
|
||||
worker-type: aws-provisioner-v1/gecko-symbol-upload
|
||||
worker:
|
||||
implementation: docker-worker
|
||||
max-run-time: 600
|
||||
command: ["/bin/bash", "bin/upload.sh"]
|
||||
docker-image: taskclusterprivate/upload_symbols:0.0.4
|
||||
env:
|
||||
GECKO_HEAD_REPOSITORY: # see transforms
|
||||
GECKO_HEAD_REV: # see transforms
|
||||
ARTIFACT_TASKID: {"task-reference": "<build>"}
|
||||
scopes:
|
||||
- docker-worker:image:taskclusterprivate/upload_symbols:0.0.4
|
||||
|
@ -1,50 +0,0 @@
|
||||
# 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/.
|
||||
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
import copy
|
||||
import logging
|
||||
|
||||
from ..util.yaml import load_yaml
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def loader(kind, path, config, params, loaded_tasks):
|
||||
"""
|
||||
Generate tasks implementing post-build jobs. These depend on builds and perform
|
||||
various followup tasks after a that build has completed.
|
||||
|
||||
The `only-for-build-platforms` kind configuration, if specified, will limit
|
||||
the build platforms for which a post-build task will be created.
|
||||
|
||||
The `job-template' kind configuration points to a yaml file which will
|
||||
be used to create the input to the transforms. It will have added to it
|
||||
keys `build-label`, the label for the build task, and `build-platform`, its
|
||||
platform.
|
||||
"""
|
||||
if config.get('kind-dependencies', []) != ["build"]:
|
||||
raise Exception("PostBuildTask kinds must depend on builds")
|
||||
|
||||
only_platforms = config.get('only-for-build-platforms')
|
||||
prototype = load_yaml(path, config.get('job-template'))
|
||||
|
||||
for task in loaded_tasks:
|
||||
if task.kind != 'build':
|
||||
continue
|
||||
|
||||
build_platform = task.attributes.get('build_platform')
|
||||
build_type = task.attributes.get('build_type')
|
||||
if not build_platform or not build_type:
|
||||
continue
|
||||
platform = "{}/{}".format(build_platform, build_type)
|
||||
if only_platforms and platform not in only_platforms:
|
||||
continue
|
||||
|
||||
post_task = copy.deepcopy(prototype)
|
||||
post_task['build-label'] = task.label
|
||||
post_task['build-platform'] = platform
|
||||
post_task['build-task'] = task
|
||||
yield post_task
|
@ -18,13 +18,16 @@ transforms = TransformSequence()
|
||||
@transforms.add
|
||||
def fill_template(config, tasks):
|
||||
for task in tasks:
|
||||
dep = task['dependent-task']
|
||||
|
||||
# Fill out the dynamic fields in the task description
|
||||
task['label'] = task['build-label'] + '-upload-symbols'
|
||||
task['dependencies'] = {'build': task['build-label']}
|
||||
task['label'] = dep.label + '-upload-symbols'
|
||||
task['dependencies'] = {'build': dep.label}
|
||||
task['worker']['env']['GECKO_HEAD_REPOSITORY'] = config.params['head_repository']
|
||||
task['worker']['env']['GECKO_HEAD_REV'] = config.params['head_rev']
|
||||
|
||||
build_platform, build_type = task['build-platform'].split('/')
|
||||
build_platform = dep.attributes.get('build_platform')
|
||||
build_type = dep.attributes.get('build_type')
|
||||
attributes = task.setdefault('attributes', {})
|
||||
attributes['build_platform'] = build_platform
|
||||
attributes['build_type'] = build_type
|
||||
@ -32,21 +35,19 @@ def fill_template(config, tasks):
|
||||
attributes['nightly'] = True
|
||||
|
||||
treeherder = task.get('treeherder', {})
|
||||
th = task['build-task'].task.get('extra')['treeherder']
|
||||
th = dep.task.get('extra')['treeherder']
|
||||
treeherder.setdefault('platform',
|
||||
"{}/{}".format(th['machine']['platform'],
|
||||
build_type))
|
||||
treeherder.setdefault('tier', th['tier'])
|
||||
treeherder.setdefault('kind', th['jobKind'])
|
||||
if 'nightly' in task['build-label']:
|
||||
if dep.attributes.get('nightly'):
|
||||
treeherder.setdefault('symbol', 'tc(SymN)')
|
||||
else:
|
||||
treeherder.setdefault('symbol', 'tc(Sym)')
|
||||
task['treeherder'] = treeherder
|
||||
|
||||
# clear out the stuff that's not part of a task description
|
||||
del task['build-label']
|
||||
del task['build-platform']
|
||||
del task['build-task']
|
||||
del task['dependent-task']
|
||||
|
||||
yield task
|
||||
|
Loading…
x
Reference in New Issue
Block a user