diff --git a/metaflow/cmd/configure_cmd.py b/metaflow/cmd/configure_cmd.py index 587fc5a36f5..e4f326f2c4a 100644 --- a/metaflow/cmd/configure_cmd.py +++ b/metaflow/cmd/configure_cmd.py @@ -582,6 +582,50 @@ def check_kubernetes_config(ctx): ) +def configure_argo_events(existing_env): + env = {} + + # Argo events service account + env["METAFLOW_ARGO_EVENTS_SERVICE_ACCOUNT"] = click.prompt( + cyan("[METAFLOW_ARGO_EVENTS_SERVICE_ACCOUNT]") + + " Argo events service account ", + default=existing_env.get("METAFLOW_ARGO_EVENTS_SERVICE_ACCOUNT", ""), + show_default=True, + ) + + # Argo events event bus + env["METAFLOW_ARGO_EVENTS_EVENT_BUS"] = click.prompt( + cyan("[METAFLOW_ARGO_EVENTS_EVENT_BUS]") + + yellow(" (optional)") + + " Argo events event bus ", + default=existing_env.get("METAFLOW_ARGO_EVENTS_EVENT_BUS", "default"), + show_default=True, + ) + + # Argo events event source + env["METAFLOW_ARGO_EVENTS_EVENT_SOURCE"] = click.prompt( + cyan("[METAFLOW_ARGO_EVENTS_EVENT_SOURCE]") + " Argo events event source ", + default=existing_env.get("METAFLOW_ARGO_EVENTS_EVENT_SOURCE", ""), + show_default=True, + ) + + # Argo events event name + env["METAFLOW_ARGO_EVENTS_EVENT"] = click.prompt( + cyan("[METAFLOW_ARGO_EVENTS_EVENT]") + " Argo events event ", + default=existing_env.get("METAFLOW_ARGO_EVENTS_EVENT", ""), + show_default=True, + ) + + # Argo events webhook url + env["METAFLOW_ARGO_EVENTS_WEBHOOK_URL"] = click.prompt( + cyan("[METAFLOW_ARGO_EVENTS_WEBHOOK_URL]") + " Argo events webhook url ", + default=existing_env.get("METAFLOW_ARGO_EVENTS_WEBHOOK_URL", ""), + show_default=True, + ) + + return env + + def configure_kubernetes(existing_env): empty_profile = False if not existing_env: @@ -908,4 +952,8 @@ def kubernetes(ctx, profile): # Configure Kubernetes for compute. env.update(configure_kubernetes(existing_env)) + # Configure Argo Workflows Events + if click.confirm("\nConfigure support for Argo Workflow Events?"): + env.update(configure_argo_events(existing_env)) + persist_env({k: v for k, v in env.items() if v}, profile)