Skip to content

Enhancement: Allow Argo Label customization #2780

@Capiru

Description

@Capiru

If we could add labels to argo workflows, we could more easily group workflows in the Argo UI.

Current state:
I see that here the labels are only being built using _base_labels:

.labels(self._base_labels)

However, _base_labels is only being built from _base_kubernetes_labels: https://github.com/Netflix/metaflow/blob/13a7cad8081aff1f34db8d4e663d8940e65ebbdc/metaflow/plugins/argo/argo_workflows.py#L189C34-L189C57
Since _base_kubernetes_labels is effectively hardcoded, there's no customization possible in the labels, i see also that there's a TODO exactly what i would suggest here, that there is an environment variable to use here:
def _base_kubernetes_labels(self):
"""
Get shared Kubernetes labels for Argo resources.
"""
# TODO: Add configuration through an environment variable or Metaflow config in the future if required.
labels = {"app.kubernetes.io/part-of": "metaflow"}
return labels

Proposed Solution:
Add METAFLOW_ARGO_WORKFLOWS_LABELS. Then use it to set the labels.

Example PR: #2781

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions