Toby Drane
04/18/2023, 4:46 PMRyan Peden
04/18/2023, 4:57 PMToby Drane
04/18/2023, 5:32 PMRyan Peden
04/18/2023, 5:42 PM/opt/prefect/flows
inside the image. That's where Prefect will look for it by default when running on infrastructure that uses Docker images.
â—¦ You can set a different path using the path
attribute of your deployment.
â—¦ If you're curious, here's how Prefect decides where to look for your flow code in this case: https://github.com/PrefectHQ/prefect/blob/2f65d50cbeb66f91c7375b6a55c9e0d9f62bd011/src/prefect/deployments.py#L786
• Push the image to ECR
• Build your Prefect deployment without storage; since you've already baked the flow code into the Docker image, you don't need external storage
• When you set up your infrastructure, add a DockerRegistry
block with credentials for your ECR registry. As mentioned above, all the flow run infrastructure types that run Docker images should have a registry field that lets you add a private registry
â—¦ When you're using a private registry, you'll need to specify the full URL of the image you use, e.g. my-registry.ecr.aws/abcdefg/my-flow:latest