Hi Team will with_overrides work in pod template? or is it only work for pod_spec only?
a
Hi Team will with_overrides work in pod template? or is it only work for pod_spec only?
a
You can use with_overrides to set a different pod template at the task level
c
this is a feature we plan on releasing in flyte 1.15. The changes are being tracked in https://github.com/flyteorg/flyte/issues/5683.
a
but as mentioned in the discussion, it is not possible to override the pod template? @average-finland-92144
a
you can set
@task(pod_template=str)
to use a particular runtime Pod template for a task
a
is it possible to override the pvc_name claim_name property? persistent_volume_claim=V1PersistentVolumeClaimVolumeSource( claim_name="your-claim-name"
@average-finland-92144
a
@acoustic-parrot-22802 not released yet, but look at the example here it's essentially overriding the Pod template and setting its own Pod spec at the task level. PVCs should be able also possible
a
Hi @average-finland-92144 I tried this below code, but it is not overriding and creating pod with default flytekit image @task def say_hello() -> str: return "Hello, World!" @workflow def hello_world_wf() -> str: res = say_hello().with_overrides( limits=Resources(cpu="2", mem="600Mi"), pod_template=PodTemplate( primary_container_name="primary-nelson", pod_spec=V1PodSpec( containers=[ V1Container( name="primary-nelson", image="europe-west4-docker.pkg.dev/western-augury-386815/testing/flytekit-k8s-gcloud:v2", ), V1Container( name="primary-nelson2", image="google/cloud-sdk", ), ], ) ) ) return res
I removed limits also from the code just for testing, still it is not working
from flytekit import task, workflow @task(container_image='europe-west4-docker.pkg.dev/western-augury-386815/testing/flytekit-k8s-gcloud:v6') def my_task() -> str: return "Hello from my task!" @workflow def my_workflow() -> str: # Attempt to override the container image return my_task().with_overrides(container_image='europe-west4-docker.pkg.dev/western-augury-386815/testing/flytekit-k8s-gcloud:v2') I tried this, it is working but with override the task is specifically to few field i think but how can I override claim_name of pvc will it available in 1.15 version when it is going to release?
just now I tried overriding claim_name it is not happening
a
As we discussed, K8s claim names is not part of the flytekit
Resources
API so it is not overridable on its own at the task decorator level, you need to use Pod Template
a
yeah, through pod template it is not working
a
can you share the Pod template you're using?
a
Yeah, in this thread only it is there