def taskgraph_decision(options): """ Run the decision task. This function implements `mach taskgraph decision`, and is responsible for * processing decision task command-line options into parameters * running task-graph generation exactly the same way the other `mach taskgraph` commands do * generating a set of artifacts to memorialize the graph * calling TaskCluster APIs to create the graph """ parameters = get_decision_parameters(options) # create a TaskGraphGenerator instance tgg = TaskGraphGenerator( root_dir=options['root'], parameters=parameters) # write out the parameters used to generate this graph write_artifact('parameters.yml', dict(**parameters)) # write out the yml file for action tasks write_artifact('action.yml', get_action_yml(parameters)) # write out the public/actions.json file write_artifact('actions.json', render_actions_json(parameters)) # write out the full graph for reference full_task_json = tgg.full_task_graph.to_json() write_artifact('full-task-graph.json', full_task_json) # this is just a test to check whether the from_json() function is working _, _ = TaskGraph.from_json(full_task_json) # write out the target task set to allow reproducing this as input write_artifact('target-tasks.json', tgg.target_task_set.tasks.keys()) # write out the optimized task graph to describe what will actually happen, # and the map of labels to taskids write_artifact('task-graph.json', tgg.optimized_task_graph.to_json()) write_artifact('label-to-taskid.json', tgg.label_to_taskid) # actually create the graph create_tasks(tgg.optimized_task_graph, tgg.label_to_taskid, parameters)
def taskgraph_decision(options): """ Run the decision task. This function implements `mach taskgraph decision`, and is responsible for * processing decision task command-line options into parameters * running task-graph generation exactly the same way the other `mach taskgraph` commands do * generating a set of artifacts to memorialize the graph * calling TaskCluster APIs to create the graph """ parameters = get_decision_parameters(options) # create a TaskGraphGenerator instance tgg = TaskGraphGenerator( root_dir=options['root'], parameters=parameters) # write out the parameters used to generate this graph write_artifact('parameters.yml', dict(**parameters)) # write out the yml file for action tasks write_artifact('action.yml', get_action_yml(parameters)) # write out the public/actions.json file write_artifact('actions.json', render_actions_json(parameters)) # write out the full graph for reference full_task_json = tgg.full_task_graph.to_json() write_artifact('full-task-graph.json', full_task_json) # this is just a test to check whether the from_json() function is working _, _ = TaskGraph.from_json(full_task_json) # write out the target task set to allow reproducing this as input write_artifact('target-tasks.json', tgg.target_task_set.tasks.keys()) # write out the optimized task graph to describe what will actually happen, # and the map of labels to taskids write_artifact('task-graph.json', tgg.morphed_task_graph.to_json()) write_artifact('label-to-taskid.json', tgg.label_to_taskid) # actually create the graph create_tasks(tgg.morphed_task_graph, tgg.label_to_taskid, parameters)