Wondering if it is possible to cache exec modules? For my stack I first run a build (not a task, so I can run tests on the build) to generate my executables that I copy into my containers. Currently using exec reruns this every time. I understand that for the other modules the caching behavior is baked in and there is no simple way to cache exec calls. Maybe I have to wait for the plugin SDK?
Hey @orange-ability-1812 first of all, welcome to our community! When you say that currently your exec reruns it everytime, you mean that it’s building a new container everytime you execute the task? By any chance have you tried the alpha community release of Garden Bonsai? In this version we introduced a way to do buildless executions, basically what it does is that the tasks/tests are executed in the already running service! Is pretty good. Reference: https://discord.com/channels/817392104711651328/1078632412457734264/1090298050725040248
Not a container build. I'm running Pants for Python to build the package and executable. Which is why I'm using the exec module
Hi @orange-ability-1812 just curious: what's your larger graph look like? Are you only using Garden for exec modules? Or is the Pants build part of a larger pipeline that leverages other Garden features?
To answer your question: I don't believe we have a method for caching exec calls
I ended up figuring out that the setup I described isn't what I need, because ultimately I need a different build that implements hot-reloading of my application. Its a Python server using
which has a
option. So I can't use my production packaging pipeline for hot-reload anyhow.
To answer the question directly is that I basically had an exec module do the build, then pass that to a container build which I would set up as a server for the dev environment.
Yep you'll want to pair this with Dev Mode which I explain in this video using Flask but it should be easily transferable to uvicorn