Quentin Chenevier
01/12/2024, 10:21 AMn1 -> n2
ā¢ Cache is created for n1
and n2
. Great š
ā¢ I add a task to the workflow: n1 -> n2 -> n3
ā¢ I expected n1
and n2
to be cached, but they are actually run again. š¤
Is it the expected behaviour (i.e. cache is managed "per task per workflow version", and not only "per task")? Or am I doing something wrong with my code ?Ketan (kumare3)
Ketan (kumare3)
Quentin Chenevier
01/12/2024, 2:47 PMKetan (kumare3)
Quentin Chenevier
01/12/2024, 3:02 PMQuentin Chenevier
01/12/2024, 3:04 PMKetan (kumare3)
Quentin Chenevier
01/12/2024, 7:29 PMpycg
, then try to import them and get their source with inspect.getsource
to compute a hash. But when instanciated by flytekit, my code is not able to import the task. (e.g: if my task my_task
is located in the my_workflow.py
file, the code will try import <http://my_workflow.my|my_workflow.my>_task
, get the source and hash it, but somehow, inside the flytekit import system it doesn't work anymore. As a fallback, my code was taking the source of the whole file (i.e. import my_workflow
), that's the workflow version was indeed included in the cache key of every task.
The solution I found is to call this "import and hash" function as a subprocess, outside of any flytekit interference.Quentin Chenevier
01/12/2024, 7:32 PMQuentin Chenevier
01/12/2024, 7:33 PM