https://flyte.org logo
#ask-the-community
Title
# ask-the-community
v

Victor Churikov

08/15/2023, 10:58 AM
Hey all, I have been using
Pod
with my
task_config
in the
@task
decorator to configure pods for executions according to this guide It is working well, but I saw that there is also the option to achieve the same result using
pod_template=PodTemplate(…)
in the task decorator according to this guide Both pass a kubernetes python V1PodSpec to the task, so I wanted to ask what is the difference, and if there is a case where one is preferable over the other. Thanks
d

Dan Rammer (hamersaw)

08/15/2023, 8:24 PM
Hey Victor! Great question, so
Pod
in the
task_config
is the initial implementation which it sounds like you have explored in some depth. The extension of enabling
pod_template
extends from the default PodTemplate work. The initial idea was to allow users to create PodTemplates in k8s namespaces and use them as the base layer for all k8s Pods that Flyte launches. That extended to allow users to specifcy a PodTemplate name and an actual PodTemplate definition in the task decorator. The important different is that
pod_template
in the task decorator can apply to more than just k8s tasks, so it can serve as the basis for Ray, Dask, PyTorch, Tensorlfow, and MPI jobs as well. So it's much more powerful that the previous
task_config=Pod
appoach. It's also worth noting that we have discussed updating the
task_config=Pod
approach to just use the
pod_template
API in the backend, there is nothing stopping us from doing that and at some point deprecating the original API.
v

Victor Churikov

08/16/2023, 10:28 AM
Thanks Dan, very helpful response. I will use pod_templates then
4 Views