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

Gaurav Kumar

08/04/2023, 12:32 PM
Is there any way to cache the ContainerTask ?
k

Ketan (kumare3)

08/04/2023, 2:43 PM
Cache=True
g

Gaurav Kumar

08/04/2023, 2:46 PM
I also tried putting
Cache=True
in the ContainerTask. The wf ran, but task was not cached.
k

Ketan (kumare3)

08/04/2023, 3:29 PM
also cache_version="1.0", you have to sadly use both
Sorry i was wrong
when you are constructing raw tasks - they are always of type Task - check the heirarchy - https://docs.flyte.org/projects/flytekit/en/latest/_modules/flytekit/core/base_task.html#PythonTask
and then you need to create TaskMetadata and pass that - I was wrong sorry
ContainerTask(metadata=TaskMetadata(cache=True, cache_version="1.0")
g

Gaurav Kumar

08/04/2023, 3:42 PM
Ok. I will try that
Thanks
It worked 🚀. Thanks
5 Views