@Marvin With multiple Prefect flows, do I create one Docker image per flow with an entrypoint that runs that python script, or can I create one docker image for everyone and call individual flows that way?
m
Marvin
03/20/2024, 9:09 PM
It's possible to have a shared Docker image for multiple Prefect flows. The recommended approach is to build a custom image that includes all necessary dependencies and shared task definitions. Your flows can rely on the same image but have their source code stored externally, which can facilitate development because the shared image only needs to be rebuilt when dependencies change, not when the flow source changes.
For detailed instructions on how to set up a Docker environment for Prefect flow deployments, please refer to the Prefect documentation: Docker image multiple Prefect flows.
Remember, though, that if different flows have wildly different dependencies or system-level requirements, maintaining separate images could be beneficial to avoid potential conflicts. However, if the flows share common dependencies and environment, a single Docker image could be more manageable and efficient.
e
Eric Albanese
03/20/2024, 9:10 PM
do you have an example on how to configure the docker entrypoint in this situation?
k
Kevin Grismore
03/20/2024, 9:21 PM
you don't have to rely on docker's
ENTRYPOINT
at all. the
entrypoint
field on a deployment definition pretty much replaces that, since prefect's engine will import your flow function and execute it there using the
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.