-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Feat/make auto emit events configurable from argo UI #2782
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
base: master
Are you sure you want to change the base?
Changes from 7 commits
313ddd5
95cc494
7b4ee51
cca651e
d3c00b9
5ea7c67
ffd2a8e
86ad07c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -965,6 +965,13 @@ def _compile_workflow_template(self): | |||||||||||||
| .description("auto-set by metaflow. safe to ignore.") | ||||||||||||||
| for event in self.triggers | ||||||||||||||
| ] | ||||||||||||||
| + [ | ||||||||||||||
| Parameter("auto_emit_argo_events") | ||||||||||||||
| .value(1 if self.auto_emit_argo_events else 0) | ||||||||||||||
| .description( | ||||||||||||||
| "Toggle used to control emission of events to Argo Events." | ||||||||||||||
| ) | ||||||||||||||
|
Comment on lines
+971
to
+973
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The description Updating the description to explicitly state the accepted values would prevent this confusion:
Suggested change
|
||||||||||||||
| ] | ||||||||||||||
|
Comment on lines
+968
to
+974
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parameter always added, regardless of Argo Events usage The This is the same root issue that caused the previous incarnation of this change (PR #2770) to be reverted: it "introduc[es] a new always-present parameter to flows on Argo that will be confusing to users". If the intent is to expose the toggle only for flows that actually use Argo Events (or that were deployed with # Only expose the toggle when the workflow was deployed with Argo Events awareness
+ ([
+ Parameter("auto_emit_argo_events")
+ .value(1 if self.auto_emit_argo_events else 0)
+ .description(
+ "Toggle used to control emission of events to Argo Events."
+ )
+ ] if self.triggers or self.auto_emit_argo_events else [])Without this guard, every Metaflow user running on Argo will see an unfamiliar |
||||||||||||||
| ) | ||||||||||||||
| ) | ||||||||||||||
| # Set common pod metadata. | ||||||||||||||
|
|
@@ -2151,8 +2158,7 @@ def _container_templates(self): | |||||||||||||
| "--event-logger=%s" % self.event_logger.TYPE, | ||||||||||||||
| "--monitor=%s" % self.monitor.TYPE, | ||||||||||||||
| "--no-pylint", | ||||||||||||||
| "--with=argo_workflows_internal:auto-emit-argo-events=%i" | ||||||||||||||
| % self.auto_emit_argo_events, | ||||||||||||||
| "--with=argo_workflows_internal:auto-emit-argo-events={{workflow.parameters.auto_emit_argo_events}}", | ||||||||||||||
| ] | ||||||||||||||
|
|
||||||||||||||
| if node.name == "start": | ||||||||||||||
|
|
@@ -3605,8 +3611,7 @@ def _heartbeat_daemon_template(self): | |||||||||||||
| "--event-logger=%s" % self.event_logger.TYPE, | ||||||||||||||
| "--monitor=%s" % self.monitor.TYPE, | ||||||||||||||
| "--no-pylint", | ||||||||||||||
| "--with=argo_workflows_internal:auto-emit-argo-events=%i" | ||||||||||||||
| % self.auto_emit_argo_events, | ||||||||||||||
| "--with=argo_workflows_internal:auto-emit-argo-events={{workflow.parameters.auto_emit_argo_events}}", | ||||||||||||||
| ] | ||||||||||||||
| heartbeat_cmds = "{entrypoint} {top_level} argo-workflows heartbeat --run_id {run_id} {tags}".format( | ||||||||||||||
| entrypoint=" ".join(entrypoint), | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argo-specific reserved name leaks into general
parameters.pyAdding
"auto-emit-argo-events"(and implicitly"auto_emit_argo_events"via the hyphen-to-underscore conversion on line 417) to the global reserved parameter list inparameters.pycouples a general-purpose Metaflow module to an Argo Workflows-specific concept.This was one of the two explicit reasons cited for reverting PR #2770: "adding argo-specific references to parameters.py is undesirable".
Consider keeping this reservation within the Argo plugin itself — for example, by overriding a
_reserved_parameter_nameshook inArgoWorkflows(or its CLI) rather than hard-coding Argo-specific names in the sharedparameters.py.