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

[Question] How to add port on kubeflow pipeline in kfpv2? #11184

Open
sefgsefg opened this issue Sep 7, 2024 Discussed in #11027 · 2 comments
Open

[Question] How to add port on kubeflow pipeline in kfpv2? #11184

sefgsefg opened this issue Sep 7, 2024 Discussed in #11027 · 2 comments

Comments

@sefgsefg
Copy link

sefgsefg commented Sep 7, 2024

Discussed in #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 ?

@sanchesoon
Copy link

sanchesoon commented Sep 10, 2024

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

@sefgsefg
Copy link
Author

@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.

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

No branches or pull requests

2 participants