Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: embed dag info into Argo Workflow Template annotations #2174

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions metaflow/plugins/argo/argo_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,17 @@ def _compile_workflow_template(self):
)
}
)
try:
# Build the DAG based on the DAGNodes given by the FlowGraph for the found FlowSpec class.
_steps_info, graph_structure = self.graph.output_steps()
graph_info = {
# for the time being, we only need the graph_structure. Being mindful of annotation size limits we do not include anything extra.
"graph_structure": graph_structure
}
except Exception:
graph_info = None

dag_annotation = {"metaflow/dag": json.dumps(graph_info)}
saikonen marked this conversation as resolved.
Show resolved Hide resolved

return (
WorkflowTemplate()
Expand All @@ -758,6 +769,7 @@ def _compile_workflow_template(self):
.annotations(self._base_annotations)
.labels(self._base_labels)
.label("app.kubernetes.io/name", "metaflow-flow")
.annotations(dag_annotation)
)
.spec(
WorkflowSpec()
Expand Down
Loading