-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
Environment
- KFP 2.14.3
- KFP SDK 2.14.5
Steps to reproduce
Use kubernetes.CreatePVC inside a pipeline function with a long name
Example pipeline:
from kfp import dsl
from kfp import kubernetes
from kfp import compiler
@dsl.component
def producer() -> str:
with open('/data/file.txt', 'w') as file:
file.write('Hello world')
with open('/data/file.txt', 'r') as file:
content = file.read()
print(content)
return content
@dsl.component
def consumer() -> str:
with open('/data/file.txt', 'r') as file:
content = file.read()
print(content)
return content
@dsl.pipeline
def my_pipeline_test_super_long_name_to_check_for_any_possible_errors_maybe():
pvc1 = kubernetes.CreatePVC(
# can also use pvc_name instead of pvc_name_suffix to use a pre-existing PVC
pvc_name_suffix='-my-pvc',
access_modes=['ReadWriteMany'],
size='5Gi',
storage_class_name='standard',
)
# write to the PVC
task1 = producer()
kubernetes.mount_pvc(
task1,
pvc_name=pvc1.outputs['name'],
mount_path='/data',
)
# read to the PVC
task2 = consumer()
kubernetes.mount_pvc(
task2,
pvc_name=pvc1.outputs['name'],
mount_path='/reused_data',
)
task2.after(task1)
delete_pvc1 = kubernetes.DeletePVC(
pvc_name=pvc1.outputs['name']
).after(task2)
# Compile the pipeline
if __name__ == "__main__":
compiler.Compiler().compile(pipeline_func=my_pipeline_test_super_long_name_to_check_for_any_possible_errors_maybe, package_path="kubeflow_pipeline.yaml")
Error found:
KFP driver: driver.Container(pipelineName=my-pipeline-test-super-long-name-to-check-for-any-possible-errors-maybe, runID=430b3c taskDisplayName="createpvc", taskName="createpvc", component="comp-createpvc", dagExecutionID=5,
componentSpec) failed: failed to create PVC an
-to-check-for-any-possiblecxn5k: pods "my-pipeline-test-super-long-name-to-check-for-any-possiblecxn5k" not found

Expected result
The pvc should be able to be created, regardless of the pipeline name length
Impacted by this bug? Give it a 👍.
vvarala1