Hi all! In Prefect 2.0, what is the recommended wa...
# prefect-community
h
Hi all! In Prefect 2.0, what is the recommended way to have a task/flow call an existing docker image? The flow I'm writing takes some data, handles it with some tasks, feeds it to an external docker image, and then does something more with the output from the image. Been digging through the docs for a while, but I'm not really sure how to approach this. It's all running on my local machine. Thanks!
1
I can always use the docker python library, though curious to if there is a more prefect way of doing this
a
calling it via subprocess is likely the most straightforward way you can also have a separate dockerized deployment i.e. deployment with docker-container infra block and call it this way https://discourse.prefect.io/t/how-to-create-a-flow-run-from-deployment-orchestrator-pattern/803
h
thanks, @Anna Geller! That sounds like the easiest solution. I'm trying to understand deployments though, and so far it doesn't look like I could call a deployment as if it was a subflow.
a
your profile image is 💯 You can call Subflows from other flows like any other function and as long as those Subflows and parent flow are packaged together within the same deployment, it will just work
h
thanks, it's a photo from when I was still in high school! I'll dive more into subflows and deployments 👍
🙌 1