-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[sdk] can't directly use image as a parameter in ContainerSpec (need to cast to string) #10657
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
Comments
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. |
This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it. |
Experiencing the same issue |
I was trying to find the corresponding code ( |
To me this seems to be a problem with how kfp compiles the pipeline. def foo(image: str):
image2 = f"{image}"
return dsl.ContainerSpec(image=image2) which made the pipeline compile. But the pipeline did not run. I think it is not possible to use input parameters for the image. exec-foo:
container:
command:
- sh
image: '{{$.inputs.parameters[''image'']}}' |
Seems to be related to #4433 |
but casting it as string like I did didn't work?
|
Hi @glemarivero Thanks for your help! It compiles but the container wont start. If I hardcode the image, then it works. In the other issue someone wrote |
mmm strange, we've been using this in production with no issues..are you using these versions?
How does the pipeline look like in the UI? And what values do you get when you go into the job? |
Interesting. I am running
In the input parameter section I get the correct image that works when I use it hardcoded. But I dont get any logs. So I assumed that parametrized images for container components does not work |
I am alos getting logs from kiverno:
Which seems that the placeholder for the image did not get replaced |
not sure if it's relevant but I'm using this in Vertex AI Pipelines, so maybe they've fixed it in their end |
I see, maybe thats the reason, as I am running a self hosted kubeflow. Thank you nonetheless! |
@HumairAK I am happy to contribute, would just need a pointer to the code. I guess this has to do with the templating of the pipeline spec? |
@hahahannes apologies for the late reply, just saw this If you're still interested in this, the offending code looks like it's here (when it's not casted). I think container specs are handled a bit differently than regular components in how parameters are resolved. The issue is similar to #11404, except here before it gets to Anyways that should give you a lead on how to handle the compilation side. As far as how this is handled in the backend, once a pipeline is submitted this still needs to be resolved. This will largely depend on how inputs are resolved for container types, if it's no different than components than the solution will likely utilize the helpers introduced as part of #11404 and make life easy for us here. You can confirm this by looking at the driver code changes in #11404 and debug this code once you have a pipeline yaml ready to submit with the string in the format Hopefully that gives you or the future assignee some leads, feel free to reach out here or slack (I'm a bit more responsive there). |
Thank you very much @HumairAK. I have a look! |
This is correct! I was able to fix by checking the type. Now the client side compilation works! @HumairAK |
I was able to setup a development environment for the kubeflow pipelines api-server and I can upload pipeline and create runs. I hoped to reach the point where the container image get set but unfortunately, it is not clear yet how it is related to the driver ( |
Would you mind telling me how to do that to test it out on my side? Thanks! |
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. |
Environment
kfp 2.7.0
kfp-pipeline-spec 0.3.0
kfp-server-api 2.0.5
Steps to reproduce
Error:
Expected result
Pipeline compiles correctly
Materials and Reference
If I cast the image argument of ContainerSpec then it works
Impacted by this bug? Give it a 👍.
The text was updated successfully, but these errors were encountered: