No bug: [taskgraph] Use trust-domain to determine what index routes to verify; r=dustin
Differential Revision: https://phabricator.services.mozilla.com/D14477
This commit is contained in:
@@ -252,7 +252,7 @@ class TaskGraphGenerator(object):
|
|||||||
logger.info(
|
logger.info(
|
||||||
"Limiting kinds to {target_kind} and dependencies".format(
|
"Limiting kinds to {target_kind} and dependencies".format(
|
||||||
target_kind=self._target_kind))
|
target_kind=self._target_kind))
|
||||||
kind_graph = kind_graph.transitive_closure({self._target_kind})
|
kind_graph = kind_graph.transitive_closure({self._target_kind, 'docker-image'})
|
||||||
|
|
||||||
logger.info("Generating full task set")
|
logger.info("Generating full task set")
|
||||||
all_tasks = {}
|
all_tasks = {}
|
||||||
@@ -272,7 +272,7 @@ class TaskGraphGenerator(object):
|
|||||||
full_task_set = TaskGraph(all_tasks, Graph(set(all_tasks), set()))
|
full_task_set = TaskGraph(all_tasks, Graph(set(all_tasks), set()))
|
||||||
self.verify_attributes(all_tasks)
|
self.verify_attributes(all_tasks)
|
||||||
self.verify_run_using()
|
self.verify_run_using()
|
||||||
yield verifications('full_task_set', full_task_set)
|
yield verifications('full_task_set', full_task_set, graph_config)
|
||||||
|
|
||||||
logger.info("Generating full task graph")
|
logger.info("Generating full task graph")
|
||||||
edges = set()
|
edges = set()
|
||||||
@@ -284,7 +284,7 @@ class TaskGraphGenerator(object):
|
|||||||
Graph(full_task_set.graph.nodes, edges))
|
Graph(full_task_set.graph.nodes, edges))
|
||||||
logger.info("Full task graph contains %d tasks and %d dependencies" % (
|
logger.info("Full task graph contains %d tasks and %d dependencies" % (
|
||||||
len(full_task_set.graph.nodes), len(edges)))
|
len(full_task_set.graph.nodes), len(edges)))
|
||||||
yield verifications('full_task_graph', full_task_graph)
|
yield verifications('full_task_graph', full_task_graph, graph_config)
|
||||||
|
|
||||||
logger.info("Generating target task set")
|
logger.info("Generating target task set")
|
||||||
target_task_set = TaskGraph(dict(all_tasks),
|
target_task_set = TaskGraph(dict(all_tasks),
|
||||||
@@ -300,7 +300,7 @@ class TaskGraphGenerator(object):
|
|||||||
old_len - len(target_tasks),
|
old_len - len(target_tasks),
|
||||||
len(target_tasks)))
|
len(target_tasks)))
|
||||||
|
|
||||||
yield verifications('target_task_set', target_task_set)
|
yield verifications('target_task_set', target_task_set, graph_config)
|
||||||
|
|
||||||
logger.info("Generating target task graph")
|
logger.info("Generating target task graph")
|
||||||
# include all docker-image build tasks here, in case they are needed for a graph morph
|
# include all docker-image build tasks here, in case they are needed for a graph morph
|
||||||
@@ -316,7 +316,7 @@ class TaskGraphGenerator(object):
|
|||||||
target_task_graph = TaskGraph(
|
target_task_graph = TaskGraph(
|
||||||
{l: all_tasks[l] for l in target_graph.nodes},
|
{l: all_tasks[l] for l in target_graph.nodes},
|
||||||
target_graph)
|
target_graph)
|
||||||
yield verifications('target_task_graph', target_task_graph)
|
yield verifications('target_task_graph', target_task_graph, graph_config)
|
||||||
|
|
||||||
logger.info("Generating optimized task graph")
|
logger.info("Generating optimized task graph")
|
||||||
existing_tasks = parameters.get('existing_tasks')
|
existing_tasks = parameters.get('existing_tasks')
|
||||||
@@ -328,13 +328,13 @@ class TaskGraphGenerator(object):
|
|||||||
do_not_optimize,
|
do_not_optimize,
|
||||||
existing_tasks=existing_tasks)
|
existing_tasks=existing_tasks)
|
||||||
|
|
||||||
yield verifications('optimized_task_graph', optimized_task_graph)
|
yield verifications('optimized_task_graph', optimized_task_graph, graph_config)
|
||||||
|
|
||||||
morphed_task_graph, label_to_taskid = morph(
|
morphed_task_graph, label_to_taskid = morph(
|
||||||
optimized_task_graph, label_to_taskid, parameters)
|
optimized_task_graph, label_to_taskid, parameters)
|
||||||
|
|
||||||
yield 'label_to_taskid', label_to_taskid
|
yield 'label_to_taskid', label_to_taskid
|
||||||
yield verifications('morphed_task_graph', morphed_task_graph)
|
yield verifications('morphed_task_graph', morphed_task_graph, graph_config)
|
||||||
|
|
||||||
def _run_until(self, name):
|
def _run_until(self, name):
|
||||||
while name not in self._run_results:
|
while name not in self._run_results:
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class WithFakeKind(TaskGraphGenerator):
|
|||||||
|
|
||||||
|
|
||||||
def fake_load_graph_config(root_dir):
|
def fake_load_graph_config(root_dir):
|
||||||
return {}
|
return {'trust-domain': 'test-domain'}
|
||||||
|
|
||||||
|
|
||||||
class FakeParameters(dict):
|
class FakeParameters(dict):
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ class VerificationSequence(object):
|
|||||||
"""
|
"""
|
||||||
_verifications = attr.ib(factory=dict)
|
_verifications = attr.ib(factory=dict)
|
||||||
|
|
||||||
def __call__(self, graph_name, graph):
|
def __call__(self, graph_name, graph, graph_config):
|
||||||
for verification in self._verifications.get(graph_name, []):
|
for verification in self._verifications.get(graph_name, []):
|
||||||
scratch_pad = {}
|
scratch_pad = {}
|
||||||
graph.for_each_task(verification, scratch_pad=scratch_pad)
|
graph.for_each_task(verification, scratch_pad=scratch_pad, graph_config=graph_config)
|
||||||
verification(None, graph, scratch_pad=scratch_pad)
|
verification(None, graph, scratch_pad=scratch_pad, graph_config=graph_config)
|
||||||
return graph_name, graph
|
return graph_name, graph
|
||||||
|
|
||||||
def add(self, graph_name):
|
def add(self, graph_name):
|
||||||
@@ -78,7 +78,7 @@ def verify_docs(filename, identifiers, appearing_as):
|
|||||||
|
|
||||||
|
|
||||||
@verifications.add('full_task_graph')
|
@verifications.add('full_task_graph')
|
||||||
def verify_task_graph_symbol(task, taskgraph, scratch_pad):
|
def verify_task_graph_symbol(task, taskgraph, scratch_pad, graph_config):
|
||||||
"""
|
"""
|
||||||
This function verifies that tuple
|
This function verifies that tuple
|
||||||
(collection.keys(), machine.platform, groupSymbol, symbol) is unique
|
(collection.keys(), machine.platform, groupSymbol, symbol) is unique
|
||||||
@@ -108,14 +108,13 @@ def verify_task_graph_symbol(task, taskgraph, scratch_pad):
|
|||||||
|
|
||||||
|
|
||||||
@verifications.add('full_task_graph')
|
@verifications.add('full_task_graph')
|
||||||
def verify_gecko_v2_routes(task, taskgraph, scratch_pad):
|
def verify_trust_domain_v2_routes(task, taskgraph, scratch_pad, graph_config):
|
||||||
"""
|
"""
|
||||||
This function ensures that any two
|
This function ensures that any two tasks have distinct ``index.{trust-domain}.v2`` routes.
|
||||||
tasks have distinct index.v2.routes
|
|
||||||
"""
|
"""
|
||||||
if task is None:
|
if task is None:
|
||||||
return
|
return
|
||||||
route_prefix = "index.gecko.v2"
|
route_prefix = "index.{}.v2".format(graph_config['trust-domain'])
|
||||||
task_dict = task.task
|
task_dict = task.task
|
||||||
routes = task_dict.get('routes', [])
|
routes = task_dict.get('routes', [])
|
||||||
|
|
||||||
@@ -131,7 +130,7 @@ def verify_gecko_v2_routes(task, taskgraph, scratch_pad):
|
|||||||
|
|
||||||
|
|
||||||
@verifications.add('full_task_graph')
|
@verifications.add('full_task_graph')
|
||||||
def verify_routes_notification_filters(task, taskgraph, scratch_pad):
|
def verify_routes_notification_filters(task, taskgraph, scratch_pad, graph_config):
|
||||||
"""
|
"""
|
||||||
This function ensures that only understood filters for notifications are
|
This function ensures that only understood filters for notifications are
|
||||||
specified.
|
specified.
|
||||||
@@ -157,7 +156,7 @@ def verify_routes_notification_filters(task, taskgraph, scratch_pad):
|
|||||||
|
|
||||||
|
|
||||||
@verifications.add('full_task_graph')
|
@verifications.add('full_task_graph')
|
||||||
def verify_dependency_tiers(task, taskgraph, scratch_pad):
|
def verify_dependency_tiers(task, taskgraph, scratch_pad, graph_config):
|
||||||
tiers = scratch_pad
|
tiers = scratch_pad
|
||||||
if task is not None:
|
if task is not None:
|
||||||
tiers[task.label] = task.task.get('extra', {}) \
|
tiers[task.label] = task.task.get('extra', {}) \
|
||||||
@@ -184,7 +183,7 @@ def verify_dependency_tiers(task, taskgraph, scratch_pad):
|
|||||||
|
|
||||||
|
|
||||||
@verifications.add('full_task_graph')
|
@verifications.add('full_task_graph')
|
||||||
def verify_required_signoffs(task, taskgraph, scratch_pad):
|
def verify_required_signoffs(task, taskgraph, scratch_pad, graph_config):
|
||||||
"""
|
"""
|
||||||
Task with required signoffs can't be dependencies of tasks with less
|
Task with required signoffs can't be dependencies of tasks with less
|
||||||
required signoffs.
|
required signoffs.
|
||||||
@@ -211,7 +210,7 @@ def verify_required_signoffs(task, taskgraph, scratch_pad):
|
|||||||
|
|
||||||
|
|
||||||
@verifications.add('optimized_task_graph')
|
@verifications.add('optimized_task_graph')
|
||||||
def verify_always_optimized(task, taskgraph, scratch_pad):
|
def verify_always_optimized(task, taskgraph, scratch_pad, graph_config):
|
||||||
"""
|
"""
|
||||||
This function ensures that always-optimized tasks have been optimized.
|
This function ensures that always-optimized tasks have been optimized.
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user