https://flyte.org logo
Title
n

Nada Saiyed

10/17/2022, 3:23 PM
Hello, I am writing a custom flytekit plugin and I was wondering how can I retrieve the rendered image uri in
execute()
of a custom plugin, if i pass a templated value to
container_image
. E.g. is my task definition
@task(task_config=my_task_config, container_image="{{.image.img1.fqn }}:{{.image.img1.version}}"
I can see that the
container_image
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?
t

Tyler Su

10/17/2022, 10:50 PM
Hi Nada Saiyed, thanks for asking your question, and we will get you an answer soon! Thanks for being patient!
y

Yee

10/18/2022, 12:03 AM
what kind of a plugin are you writing? this is a flytekit plugin right? nothing on the backend?
n

Nada Saiyed

10/18/2022, 12:04 AM
Yes. A flytekit plugin
y

Yee

10/18/2022, 12:11 AM
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)
n

Nada Saiyed

10/18/2022, 2:43 AM
@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?
y

Yee

10/18/2022, 6:50 PM
@Ketan (kumare3) could you take a look at this please?
and @Eduardo Apolinario (eapolinario)
k

Ketan (kumare3)

10/18/2022, 7:02 PM
@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
rest
api and make it available locally as well as when running in remote. This would make your life to extend really easy
n

Nada Saiyed

10/18/2022, 9:53 PM
@Ketan (kumare3) even if I use
PythonCustomizedContainerTask
and I pass a templated string to
container_image
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.?
k

Ketan (kumare3)

10/18/2022, 10:55 PM
no it will be rendered string
you will have to get it from the task_template.container.image
n

Nada Saiyed

10/20/2022, 7:19 PM
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
k

Ketan (kumare3)

10/20/2022, 8:37 PM
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