commit e6b94ac6d400a933d1d7b7edc9dc8f38e0df4045
parent d3fb68bc558e03de6394b7db762da67e54327bb6
Author: KS <kshampur@mozilla.com>
Date: Thu, 8 Jan 2026 18:30:07 +0000
Bug 1976131 - Re-use mozilla-central CaR artifacts when pushing CaR perftests to TRY. r=perftest-reviewers,taskgraph-reviewers,afinder,ahal
Chromium-as-Release builds take a long time. If an engineer is pushing
perftests to Try and happens to have selected CaR tasks, in most cases,
using an existing artifact from mozilla-central should suffice. And this
artifact will usually be an up to date build give or take a day.
This will ensure faster turnaround in perf testing and not needlessly
use up CI resources.
This patch adds a transform which will let Try pushes take the latest
artifact from mozilla-central.
If engineers require a latest pull in their Try push, an optional
`--build-car` flag can be passed into `mach try fuzzy` or `mach try
perf`
Differential Revision: https://phabricator.services.mozilla.com/D274858
Diffstat:
5 files changed, 92 insertions(+), 0 deletions(-)
diff --git a/taskcluster/gecko_taskgraph/transforms/custom_car.py b/taskcluster/gecko_taskgraph/transforms/custom_car.py
@@ -0,0 +1,42 @@
+# 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 taskgraph.transforms.base import TransformSequence
+
+transforms = TransformSequence()
+
+CUSTOM_CAR_TASKS = [
+ "linux64-custom-car",
+ "win64-custom-car",
+ "macosx-custom-car",
+ "macosx-arm64-custom-car",
+ "android-custom-car",
+]
+
+
+@transforms.add
+def add_custom_car_optimization(config, tasks):
+ for task in tasks:
+ if task.get("name") not in CUSTOM_CAR_TASKS:
+ yield task
+ continue
+
+ task_name = task["name"]
+ trust_domain = config.graph_config["trust-domain"]
+ level = config.params["level"]
+
+ index_route = f"{trust_domain}.cache.level-{level}.toolchain.{task_name}.latest"
+ full_index_route = f"index.{index_route}"
+
+ task.setdefault("routes", []).append(full_index_route)
+
+ if config.params["project"] == "try":
+ index_paths = []
+ for search_level in reversed(range(int(level), 4)):
+ search_route = f"{trust_domain}.cache.level-{search_level}.toolchain.{task_name}.latest"
+ index_paths.append(search_route)
+
+ task["optimization"] = {"index-search": index_paths}
+
+ yield task
diff --git a/taskcluster/kinds/toolchain/kind.yml b/taskcluster/kinds/toolchain/kind.yml
@@ -11,6 +11,7 @@ kind-dependencies:
transforms:
- gecko_taskgraph.transforms.try_job:transforms
- gecko_taskgraph.transforms.job:transforms
+ - gecko_taskgraph.transforms.custom_car:transforms
- gecko_taskgraph.transforms.cached_tasks:transforms
- gecko_taskgraph.transforms.task:transforms
diff --git a/tools/tryselect/selectors/fuzzy.py b/tools/tryselect/selectors/fuzzy.py
@@ -102,6 +102,7 @@ class FuzzyParser(BaseTryParser):
"browsertime",
"chemspill-prio",
"disable-pgo",
+ "do-not-optimize",
"env",
"existing-tasks",
"gecko-profile",
diff --git a/tools/tryselect/selectors/perf.py b/tools/tryselect/selectors/perf.py
@@ -102,6 +102,7 @@ class PerfParser(CompareParser):
task_configs = [
"artifact",
"browsertime",
+ "build-car",
"disable-pgo",
"env",
"gecko-profile",
diff --git a/tools/tryselect/task_config.py b/tools/tryselect/task_config.py
@@ -612,6 +612,51 @@ class NewConfig(TryConfig):
}
+class DoNotOptimize(ParameterConfig):
+ arguments = [
+ [
+ ["--do-not-optimize"],
+ {
+ "action": "append",
+ "dest": "do_not_optimize",
+ "default": None,
+ "help": (
+ "Task labels to not optimize. These tasks will always be built "
+ "instead of being replaced by indexed tasks. Can be specified multiple times."
+ ),
+ },
+ ],
+ ]
+
+ def get_parameters(self, do_not_optimize, **kwargs):
+ if do_not_optimize:
+ return {"do_not_optimize": do_not_optimize}
+
+
+class BuildCar(ParameterConfig):
+ arguments = [
+ [
+ ["--build-car"],
+ {
+ "action": "store_true",
+ "help": "Force rebuild of custom-car toolchains instead of reusing mozilla-central artifacts.",
+ },
+ ],
+ ]
+
+ CUSTOM_CAR_LABELS = [
+ "toolchain-linux64-custom-car",
+ "toolchain-win64-custom-car",
+ "toolchain-macosx-custom-car",
+ "toolchain-macosx-arm64-custom-car",
+ "toolchain-android-custom-car",
+ ]
+
+ def get_parameters(self, build_car, **kwargs):
+ if build_car:
+ return {"do_not_optimize": self.CUSTOM_CAR_LABELS}
+
+
class WorkerOverrides(TryConfig):
arguments = [
[
@@ -726,8 +771,10 @@ class WorkerOverrides(TryConfig):
all_task_configs = {
"artifact": Artifact,
"browsertime": Browsertime,
+ "build-car": BuildCar,
"chemspill-prio": ChemspillPrio,
"disable-pgo": DisablePgo,
+ "do-not-optimize": DoNotOptimize,
"env": Environment,
"existing-tasks": ExistingTasks,
"gecko-profile": GeckoProfile,