-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an action to rebuild pipeline toolchains and docker images (#798)
* Add an action to rebuild pipeline toolchains * Rename action to rebuild-docker-images-and-toolchains and include docker-image and fetch tasks * add documentation on how to manually rebuild cached tasks --------- Co-authored-by: Ben Hearsum <[email protected]>
- Loading branch information
1 parent
7b672cf
commit 68aa0a7
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
taskcluster/translations_taskgraph/actions/rebuild_docker_images_and_toolchains.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# 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.actions.registry import register_callback_action | ||
from taskgraph.actions.util import create_tasks, fetch_graph_and_labels | ||
|
||
|
||
@register_callback_action( | ||
name="rebuild-docker-images-and-toolchains", | ||
title="Rebuild Docker Images and Toolchains", | ||
symbol="images-and-toolchains", | ||
description="Create docker-image and toolchain tasks to rebuild their artifacts.", | ||
order=1000, | ||
context=[], | ||
) | ||
def rebuild_docker_images_and_toolchains_action( | ||
parameters, graph_config, input, task_group_id, task_id | ||
): | ||
decision_task_id, full_task_graph, label_to_task_id = fetch_graph_and_labels( | ||
parameters, graph_config, task_group_id=task_group_id | ||
) | ||
tasks_to_create = [ | ||
label | ||
for label, task in full_task_graph.tasks.items() | ||
if task.kind == "docker-image" or task.kind == "fetch" or task.kind == "toolchain" | ||
] | ||
if tasks_to_create: | ||
create_tasks( | ||
graph_config, | ||
tasks_to_create, | ||
full_task_graph, | ||
label_to_task_id, | ||
parameters, | ||
decision_task_id, | ||
) |