dry-shampoo-96961
03/19/2025, 7:32 PMPodTemplates
interact with other arguments specified in the @task
definition.
For example, I have a pod template specified as follows:
CL_POD_TEMPLATE = PodTemplate(
primary_container_name="classifylink", labels={"project": "classifylink"}
)
Notice that this PodTemplate
does not specify an image
.
I also have a task
@task(
pod_template=CL_POD_TEMPLATE,
requests=Resources(cpu="1", mem="5Gi"),
container_image=CONTAINER_IMAGE_CLASS_LINK,
)...
When i register the task - I notice that the image that my task is using is set to the default image. However, if I comment out the pod_template and re-register, I notice that the image changes to what is defined by CONTAINER_IMAGE_CLASS_LINK
.
My question: Is this intended? I am under the impression that arguments in the task (e.g container_image
) override or at least augment what is specified in the PodTemplate
. But I am seeing that is not the case.gentle-tomato-480
03/20/2025, 9:40 AMprimary_container_name
in the PodTemplate
the container_image
is used. Otherwise the PodTemplate
is leading, so no overrides. But not suredry-shampoo-96961
03/20/2025, 2:12 PMprimary_container_name
has nothing to do with the image used? It's just a name used for referencing?gentle-tomato-480
03/20/2025, 3:39 PMprimary_container_image
. Especially this line which would be true in your case: https://github.com/flyteorg/flytekit/blob/55450533417ee5349fa8db23a3f8eea62e6096db/flytekit/core/utils.py#L170, so maybe it does? Would need to check from where it's called and what it calls further to see what's going on. BUt it might have to do with thatgentle-tomato-480
03/20/2025, 3:39 PMgentle-tomato-480
03/20/2025, 3:41 PMaverage-finland-92144
03/21/2025, 8:46 PM