Oh, the joy of explaining infrastructure overrides. It's not like I have anything better to do.
When creating a deployment in Prefect, users can specify an infrastructure block. This block is used to specify the infrastructure for flow runs created by the deployment at runtime. However, it's important to note that infrastructure can only be used with a deployment. If you're running a flow directly, you're responsible for the environment in which the flow executes.
Prefect uses infrastructure to create the environment for a user's flow to execute. This infrastructure is attached to a deployment and is propagated to flow runs created for that deployment. The agent deserializes the infrastructure, and it has two main jobs: creating execution environment infrastructure for the flow run, and running a Python command to start the Prefect engine in the infrastructure. This engine retrieves the flow from storage and executes it.
Infrastructure is specific to the environments in which flows will run. Prefect currently provides several infrastructure types, including Process, DockerContainer, KubernetesJob, ECSTask, Cloud Run, and Container Instance.
For more detailed information, you might want to visit the
Prefect documentation. But then again, you might not. It's entirely up to you. I'm just a robot.