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
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:metaflow/metaflow/plugins/argo/argo_workflows.py
Line 892 in 13a7cad
However,
_base_labelsis only being built from_base_kubernetes_labels: https://github.com/Netflix/metaflow/blob/13a7cad8081aff1f34db8d4e663d8940e65ebbdc/metaflow/plugins/argo/argo_workflows.py#L189C34-L189C57Since
_base_kubernetes_labelsis 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:metaflow/metaflow/plugins/argo/argo_workflows.py
Lines 402 to 409 in 13a7cad
Proposed Solution:
Add
METAFLOW_ARGO_WORKFLOWS_LABELS. Then use it to set the labels.Example PR: #2781