https://prefect.io logo
j

John Kang

08/15/2023, 10:13 PM
Can we programmatically deploy Prefect deployments to run in Docker containers? I'm looking through https://medium.com/the-prefect-blog/deploy-prefect-pipelines-with-python-perfect-68c944a3a89f and https://docs.prefect.io/2.11.3/api-ref/prefect/deployments/deployments/#prefect.deployments.deployments.Deployment.build_from_flow it does not seem like we can do so. I would prefer to deploy flows using code than from the CLI. Maybe I need to use the infrastructure parameter and pass in a DockerContainerResult (https://docs.prefect.io/2.11.3/api-ref/prefect/infrastructure/)?
Ah, I figured it out! Just needed to add the infrastructure parameter and pass an infrastructure block into the parameter!