Hello All,
I have deployment my flow with serve method. And trigger flow runs with run_deployment method. Since flow object is imported on everytime, I am experiencing significant delay. Is there any way to import flow object at the time runner starts and just use it on every run_deployment ?
I tried creating an ImportedModuleRegistry and setting {entrypoint: import_object(import_path)} in runner. But since prefect.engine is run as a subprocess, Singleton ImportedModuleRegistry memory space is not shared. I tried shared object approach using
from multiprocessing import Manager
manager = Manager()
imported_module = manager.dict()
But imported flow object can't be pickled and hence can't be stored in imported_module dict.
Any suggestions, how to move forward ?