Skip to content

Commit

Permalink
add argo workflow environment variables to kubernetes configure (#1405)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikonen authored May 11, 2023
1 parent 0386164 commit 368bac3
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions metaflow/cmd/configure_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

0 comments on commit 368bac3

Please sign in to comment.