[Question] How to add port on kubeflow pipeline in kfpv2?
Discussed in https://github.com/kubeflow/pipelines/discussions/11027
Originally posted by sefgsefg July 23, 2024 kfp == 2.8.0
kfp-kubernetes == 1.2.0
@dsl.component()
def server():
....
@dsl.pipeline()
def my_pipeline():
server_task=server()
server_task.add_port(V1ContainerPort(name='my-port', container_port=8080))
---> server_task.add_port(V1ContainerPort(name='my-port', container_port=8080))
AttributeError: 'PipelineTask' object has no attribute 'add_port'
In kfpv1 the code can work, but in kfpv2 'add_port' had been removed. Is there any method to add port on task ?
For argoworkflow backend I am using something like this
mainContainer: |
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 0.1
memory: 64Mi
limits:
cpu: 0.5
memory: 512Mi
ports:
- containerPort: 8080
but it will be port for all mainContainer
@sanchesoon THX for your answer. But I'm a way that can edit port directly in python and compile into yaml file. I think kfpv2 should have a method to add it.
@rimolive Sorry, do you know the relevant solutions?
@sefgsefg Unfortunately there's no support yet in SDK v2 but you can contribute with implementing it. Let me know if you need any help.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
/lifecycle stale
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
/lifecycle frozen