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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions metaflow/plugins/argo/argo_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,18 @@ 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 = {
"steps": steps_info,
"graph_structure": graph_structure,
"doc": self.graph.doc,
}
except Exception:
graph_info = None

dag_annotation = {"metaflow/dag": json.dumps(graph_info)}

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