Bug 1839891 - [ci] Convert upload-symbols tasks to 'from_deps' transforms, r=releng-reviewers,taskgraph-reviewers,bhearsum

Differential Revision: https://phabricator.services.mozilla.com/D184850
This commit is contained in:
Andrew Halberstadt 2023-08-01 19:42:29 +00:00
Родитель 912d8e93c8
Коммит 4d5b4f1200
3 изменённых файлов: 60 добавлений и 58 удалений

Просмотреть файл

@ -2,18 +2,21 @@
# 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: gecko_taskgraph.loader.single_dep:loader
loader: gecko_taskgraph.loader.transform:loader
transforms:
- gecko_taskgraph.transforms.upload_symbols:transforms
- gecko_taskgraph.transforms.job:transforms
- gecko_taskgraph.transforms.task:transforms
- taskgraph.transforms.from_deps
- gecko_taskgraph.transforms.upload_symbols
- gecko_taskgraph.transforms.job
- gecko_taskgraph.transforms.task
kind-dependencies:
- system-symbols
job-template:
jobs:
system-symbols-upload:
description: Upload Symbols
from-deps: {}
attributes:
cron: true
worker-type: b-linux-gcp

Просмотреть файл

@ -2,21 +2,18 @@
# 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: gecko_taskgraph.loader.multi_dep:loader
group-by: platform
loader: gecko_taskgraph.loader.transform:loader
transforms:
- gecko_taskgraph.transforms.upload_symbols:transforms
- gecko_taskgraph.transforms.job:transforms
- gecko_taskgraph.transforms.task:transforms
- taskgraph.transforms.from_deps
- gecko_taskgraph.transforms.upload_symbols
- gecko_taskgraph.transforms.job
- gecko_taskgraph.transforms.task
kind-dependencies:
- build
- toolchain
primary-dependency: build
not-for-build-platforms:
# Address Sanitizer builds don't have symbols to upload.
- linux64-asan-reporter-shippable/opt
@ -30,8 +27,11 @@ not-for-build-platforms:
- win64-geckodriver/opt
- win64-aarch64-geckodriver/opt
job-template:
jobs:
upload-symbols:
description: Upload Symbols
from-deps:
group-by: platform
worker-type: b-linux-gcp
use-system-python: false
worker:

Просмотреть файл

@ -10,6 +10,7 @@ taskcluster/ci/upload-symbols/job-template.yml into an actual task description.
import logging
from taskgraph.transforms.base import TransformSequence
from taskgraph.util.dependencies import get_primary_dependency
from taskgraph.util.treeherder import inherit_treeherder_from_dep, join_symbol
from gecko_taskgraph.util.attributes import (
@ -30,7 +31,9 @@ def check_nightlies(config, tasks):
Putting this check here (instead of the transforms for the build kind) lets us
leverage the any not-for-build-platforms set in the update-symbols kind."""
for task in tasks:
dep = task["primary-dependency"]
dep = get_primary_dependency(config, task)
assert dep
if (
config.params["project"] in RELEASE_PROJECTS
and dep.attributes.get("shippable")
@ -47,8 +50,8 @@ def check_nightlies(config, tasks):
@transforms.add
def fill_template(config, tasks):
for task in tasks:
dep = task["primary-dependency"]
task.pop("dependent-tasks", None)
dep = get_primary_dependency(config, task)
assert dep
# Fill out the dynamic fields in the task description
task["label"] = dep.label + "-upload-symbols"
@ -60,7 +63,6 @@ def fill_template(config, tasks):
logger.debug("Skipping upload symbols task for %s", task["label"])
continue
task["dependencies"] = {"build": dep.label}
task["worker"]["env"]["GECKO_HEAD_REPOSITORY"] = config.params[
"head_repository"
]
@ -87,9 +89,6 @@ def fill_template(config, tasks):
# XXX Better to run this on promote phase instead?
task["run-on-projects"] = dep.attributes.get("run_on_projects")
task["optimization"] = {"upload-symbols": None}
task["if-dependencies"] = ["build"]
# clear out the stuff that's not part of a task description
del task["primary-dependency"]
task["if-dependencies"] = [task["attributes"]["primary-kind-dependency"]]
yield task