You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a weird one that had me scratching my head for a long time. Two identical pipelines where the only change is the name of the function of the first component results in the labels/annotations not getting added to the pod. I tested with several function name variants.
Working Names:
comp
component
component1
Names that failed:
scomp
scomponent
s3_writer
dataset_writer
The following two pipelines can be used for replication. The first shows the labels are successfully added, the second shows when the pod is created without the labels.
Pipeline where labels successfully get added to the pod.
from kfp import dsl, kubernetes
from kfp.client import Client
@dsl.component()
def comp(dataset: dsl.Output[dsl.Dataset]):
with open(dataset.path, 'w') as fh:
fh.write("hello world.")
@dsl.component()
def comp2(dataset: dsl.Input[dsl.Dataset]):
with open(dataset.path, 'r') as fh:
print(fh.read())
@dsl.pipeline
def my_pipeline():
task = comp()
task2 = comp2(dataset=task.output)
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',
)
Pipeline where the labels fail to get added to the pod. (only difference is function name comp -> scomp).
from kfp import dsl, kubernetes
from kfp.client import Client
@dsl.component()
def scomp(dataset: dsl.Output[dsl.Dataset]):
with open(dataset.path, 'w') as fh:
fh.write("hello world.")
@dsl.component()
def comp2(dataset: dsl.Input[dsl.Dataset]):
with open(dataset.path, 'r') as fh:
print(fh.read())
@dsl.pipeline
def my_pipeline():
task = scomp()
task2 = comp2(dataset=task.output)
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',
)
Expected result
Labels should be added regardless of component function name.
Materials and Reference
Note the following pipelines use a custom image repository which has a python 3.11 image with kfp sdk 2.8.0 installed. This is due to organization policies for our environment. The sample above uses the default 3.7 image and should exhibit the same behavior.
Environment
Kubeflow/manifests tag 1.9.0
https://github.com/kubeflow/manifests/tree/master/apps/pipeline/upstream/env/platform-agnostic-multi-user
2.2.0
2.8.0
Steps to reproduce
This is a weird one that had me scratching my head for a long time. Two identical pipelines where the only change is the name of the function of the first component results in the labels/annotations not getting added to the pod. I tested with several function name variants.
Working Names:
Names that failed:
The following two pipelines can be used for replication. The first shows the labels are successfully added, the second shows when the pod is created without the labels.
Pipeline where labels successfully get added to the pod.
Pipeline where the labels fail to get added to the pod. (only difference is function name comp -> scomp).
Expected result
Labels should be added regardless of component function name.
Materials and Reference
Note the following pipelines use a custom image repository which has a python 3.11 image with kfp sdk 2.8.0 installed. This is due to organization policies for our environment. The sample above uses the default 3.7 image and should exhibit the same behavior.
Pipeline 1 Spec
Pipeline 2 Spec
Pod from pipeline 1 truncated to relevant information:
Pod from pipeline 2 truncated to relevant information:
Impacted by this bug? Give it a 👍.
The text was updated successfully, but these errors were encountered: