Hello, I am writing a custom flytekit plugin and I...
# ask-the-community
Hello, I am writing a custom flytekit plugin and I was wondering how can I retrieve the rendered image uri in
of a custom plugin, if i pass a templated value to
. E.g. is my task definition
Copy code
@task(task_config=my_task_config, container_image="{{.image.img1.fqn }}:{{.image.img1.version}}"
I can see that the
is set as a property and if I retrieve it, I see it’s value is still a templated string. How can I get the actual rendered image uri for that task? (i.e. basically I want what this function returns)
@Yee any suggestions?
Hi Nada Saiyed, thanks for asking your question, and we will get you an answer soon! Thanks for being patient!
what kind of a plugin are you writing? this is a flytekit plugin right? nothing on the backend?
Yes. A flytekit plugin
i see.
would you mind describing why it’s needed a bit more?
just want to understand more
i’m wondering if it falls to the responsibility of flyte to inform the image what you are basically. like certainly you can embed the tag of the image into the image itself (it’s not the cleanest thing to do and we don’t advocate doing this but it’s at least possible)
@Yee I need this rendered image uri to in-turn launch another aws service which would use this image. And, Yes, currently embedding the tag of the image into itself is how I am retrieving the image_uri, but it would be a useful feature if flyte exposes this information via an api call or in some metadata.config, essentially all the task-details that are shown in the Flyte UI
Is there anything which I could use to get this information?
@Ketan (kumare3) could you take a look at this please?
and @Eduardo Apolinario (eapolinario)
@Nada Saiyed i think you will have to use the TaskTemplate plugin today. We are working on a whole new improved plugin system that will make this easy. If you are interested we would love to share the ideas with you (Spotify and Union are working on it together). But until then it has to be a TaskTemplate plugin. This is an exmple - https://github.com/flyteorg/flytekit/blob/ab9aa65c420afed1ec3b80e0d650fcee3d63852a[…]/plugins/flytekit-sqlalchemy/flytekitplugins/sqlalchemy/task.py
@Nada Saiyed So what we are working on is - Flyte backend plugins in python. Our goal is to simply write a backend plugin in python like a
api and make it available locally as well as when running in remote. This would make your life to extend really easy
@Ketan (kumare3) even if I use
and I pass a templated string to
in the task definition of the plug-in, while initialization, the value will still be a templated string. Not a rendered image-uri if I am not wrong.?
no it will be rendered string
you will have to get it from the task_template.container.image
i see.. thanks a lot. i think for now i will keep fetching this image-uri from the embedded tag of the image into itself
Ok, ya expect q4 that we will have the out of core Plugins. Also I will have an rfc soon. This will make extensibility even better
Thank you for the patience