Skip to content
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

[feature] Apply Pod Labels and Pod Annotations for Kubeflow Pipeline Tasks #10363

Closed
revolutionisme opened this issue Jan 5, 2024 · 2 comments · Fixed by #10393
Closed

[feature] Apply Pod Labels and Pod Annotations for Kubeflow Pipeline Tasks #10363

revolutionisme opened this issue Jan 5, 2024 · 2 comments · Fixed by #10393

Comments

@revolutionisme
Copy link

Feature Area

/area backend
/area sdk

What feature would you like to see?

In KFP SDK V1, we had existing methods to easily add pod labels and add pod annotations

However when we are working with KFP V2 SDK, these methods are all missing and there's no way (not even a workaround?) to add these pod labels and annotations. I checked the open issues and there seems to be issues pertaining to adding podaffinity and tolerations which are unfortunately still open.

Is there a way to add aforementioned labels and annotations? If not I would like to see this feature parity with KFP V1.

What is the use case or pain point?

We are used to using selectors to match the labels and find relevant set of pods together, which is unfortunately not possible anymore. Also, we want to apply PodDefaults based on the labels on the component pods.

Is there a workaround currently?

Nothing I could find out so far.


Love this idea? Give it a 👍.

@zijianjoy
Copy link
Collaborator

Currently it is being worked on in #9682. Closing this for now to avoid duplication.

@OutSorcerer
Copy link

It is possible in v2 at the moment using "Kubernetes Platform-specific Features" package, kfp-kubernetes.

from kfp import dsl
from kfp import kubernetes


@dsl.component
def comp():
    pass


@dsl.pipeline
def my_pipeline():
    task = comp()
    kubernetes.add_pod_label(
        task,
        label_key='kubeflow.com/kfp',
        label_value='pipeline-node',
    )
    kubernetes.add_pod_annotation(
        task,
        annotation_key='run_id',
        annotation_value='123456',
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants