I have huge python object, that I want to use between dagster jobs without reloading. How can i do that? That looks like resource, but as i understand it doesn't cache target object.
07/05/2022, 4:17 PM
Each python job run is executed in isolation in its own process, so I’m not sure it’s possible to achieve what you want.
If you are trying to minimize the loads of that object within a job run, then I would recommend using a resource. By default, jobs are executed using the multiprocess executor (executing each op in its own process), but you can override that to use the in-process executor. Using the in-process executor, each resource will only be instantiated once, so you can load that large python object and then each op will use that in-memory object.