commit 9544a394290ea399777ccc3353afaad55776ad5d
parent ceba5314bbe164360d211ed816d29b20e4294e34
Author: Bastien Orivel <borivel@mozilla.com>
Date: Fri, 28 Nov 2025 09:44:36 +0000
Bug 1999653 - Import RPM packages from mozilla archives into RPM repos. r=releng-reviewers,taskgraph-reviewers,bhearsum
This is basically the same as what we're doing with apt except slightly
simpler since we don't have to worry about having 200 dependencies since
RPMs don't fan out to being 113 tasks per architecture.
Differential Revision: https://phabricator.services.mozilla.com/D272616
Diffstat:
5 files changed, 147 insertions(+), 0 deletions(-)
diff --git a/taskcluster/config.yml b/taskcluster/config.yml
@@ -105,6 +105,7 @@ treeherder:
'BM': 'Beetmover'
'BMR': 'Beetmover repackages'
'BM-apt': 'Beetmover .deb packages'
+ 'BM-rpm': 'Beetmover .rpm packages'
'c-Up': 'Balrog submission of complete updates'
'css': 'Checksum signing for source'
'rs': 'Repackage signing'
diff --git a/taskcluster/docs/kinds.rst b/taskcluster/docs/kinds.rst
@@ -312,6 +312,10 @@ beetmover-apt
-------------------
Beetmover-apt publishes Linux .deb packages from the Mozilla archive to our APT repositories.
+beetmover-rpm
+-------------------
+Beetmover-rpm publishes Linux .rpm packages from the Mozilla archive to our RPM repositories.
+
beetmover-repackage-rpm
-----------------------
Beetmover-repackage-rpm publishes Linux .rpm packages (main package and all langpacks) to the candidates directory.
diff --git a/taskcluster/gecko_taskgraph/transforms/beetmover_rpm.py b/taskcluster/gecko_taskgraph/transforms/beetmover_rpm.py
@@ -0,0 +1,78 @@
+# 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 collections import defaultdict
+
+from taskgraph.transforms.base import TransformSequence
+from taskgraph.util.dependencies import get_primary_dependency
+
+from gecko_taskgraph.util.scriptworker import (
+ generate_artifact_registry_gcs_sources_rpm,
+ get_beetmover_repo_action_scope,
+ get_beetmover_yum_repo_scope,
+)
+
+transforms = TransformSequence()
+
+
+@transforms.add
+def beetmover_rpm(config, tasks):
+ products_tasks = defaultdict(lambda: [])
+
+ for task in tasks:
+ dep = get_primary_dependency(config, task)
+ assert dep
+
+ product = dep.attributes.get("shipping_product")
+ products_tasks[product].append(task)
+
+ for product, product_tasks in products_tasks.items():
+ dependencies = {}
+ gcs_sources = []
+
+ for task in product_tasks:
+ dep = get_primary_dependency(config, task)
+ assert dep
+
+ dependencies[dep.label] = dep.label
+ gcs_sources.extend(generate_artifact_registry_gcs_sources_rpm(dep))
+
+ description = f"Beetmover YUM submission for the {config.params['release_type']} {product} .rpm packages"
+ platform = f"{product}-release/opt"
+
+ treeherder = {
+ "platform": platform,
+ "tier": 1,
+ "kind": "other",
+ "symbol": "BM-rpm",
+ }
+
+ yum_repo_scope = get_beetmover_yum_repo_scope(config)
+ repo_action_scope = get_beetmover_repo_action_scope(config)
+
+ attributes = {
+ "required_signoffs": ["mar-signing"],
+ "shippable": True,
+ "shipping_product": product,
+ }
+
+ worker = {
+ "implementation": "beetmover-import-from-gcs-to-artifact-registry",
+ "product": product,
+ "gcs-sources": gcs_sources,
+ }
+
+ task = {
+ "label": f"{config.kind}-{platform}",
+ "description": description,
+ "worker-type": "beetmover",
+ "treeherder": treeherder,
+ "scopes": [yum_repo_scope, repo_action_scope],
+ "attributes": attributes,
+ "shipping-phase": "ship",
+ "shipping-product": product,
+ "dependencies": dependencies,
+ "worker": worker,
+ }
+
+ yield task
diff --git a/taskcluster/gecko_taskgraph/util/scriptworker.py b/taskcluster/gecko_taskgraph/util/scriptworker.py
@@ -151,6 +151,15 @@ BEETMOVER_APT_REPO_SCOPES = {
"default": "beetmover:apt-repo:dep",
}
+"""Map the beetmover scope aliases to the actual scopes.
+These are the scopes needed to import artifacts into the product delivery YUM repos.
+"""
+BEETMOVER_YUM_REPO_SCOPES = {
+ "all-release-branches": "beetmover:yum-repo:release",
+ "all-nightly-branches": "beetmover:yum-repo:nightly",
+ "default": "beetmover:yum-repo:dep",
+}
+
"""Map the beetmover tasks aliases to the actual action scopes.
"""
BEETMOVER_ACTION_SCOPES = {
@@ -398,6 +407,12 @@ get_beetmover_apt_repo_scope = functools.partial(
alias_to_scope_map=BEETMOVER_APT_REPO_SCOPES,
)
+get_beetmover_yum_repo_scope = functools.partial(
+ get_scope_from_project,
+ alias_to_project_map=BEETMOVER_SCOPE_ALIAS_TO_PROJECT,
+ alias_to_scope_map=BEETMOVER_YUM_REPO_SCOPES,
+)
+
get_beetmover_repo_action_scope = functools.partial(
get_scope_from_release_type,
release_type_to_scope_map=BEETMOVER_REPO_ACTION_SCOPES,
@@ -608,6 +623,22 @@ def generate_artifact_registry_gcs_sources(dep):
return gcs_sources
+def generate_artifact_registry_gcs_sources_rpm(dep):
+ """Generate GCS sources for RPM packages from beetmover-repackage-rpm task.
+
+ The beetmover-repackage-rpm task contains all RPM packages (firefox + langpacks)
+ for a given platform in its artifactMap. This function extracts all destinations
+ from that artifactMap to upload to the YUM repository.
+ """
+ gcs_sources = []
+ for config in dep.task["payload"]["artifactMap"]:
+ if config["taskId"]["task-reference"] == "<repackage-rpm>":
+ for path_info in config["paths"].values():
+ if "destinations" in path_info and path_info["destinations"]:
+ gcs_sources.append(path_info["destinations"][0])
+ return gcs_sources
+
+
# generate_beetmover_artifact_map {{{1
def generate_beetmover_artifact_map(config, job, **kwargs):
"""Generate the beetmover artifact map.
diff --git a/taskcluster/kinds/beetmover-rpm/kind.yml b/taskcluster/kinds/beetmover-rpm/kind.yml
@@ -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.transform:loader
+
+transforms:
+ - taskgraph.transforms.from_deps
+ - gecko_taskgraph.transforms.release:run_on_releases
+ - gecko_taskgraph.transforms.beetmover_rpm
+ - gecko_taskgraph.transforms.task
+
+kind-dependencies:
+ - beetmover-repackage-rpm
+
+task-defaults:
+ run-on-repo-type: [hg]
+
+only-for-build-platforms:
+ - linux64-shippable/opt
+ - linux64-aarch64-shippable/opt
+ - linux64-devedition/opt
+ - linux64-aarch64-devedition/opt
+
+tasks:
+ beetmover-rpm:
+ from-deps:
+ group-by: single-with-filters
+ run-on-releases:
+ - nightly
+ - beta
+ - release
+ - esr140