Mike B
02/28/2025, 3:58 AMMarvin
02/28/2025, 3:59 AMmy_prefect_workflow.deploy(...config here...)
, the settings are primarily those explicitly defined within the .deploy()
call. However, the prefect.yaml
file in your project can define base settings for deployments, procedural steps, and execution environment configurations. This file can influence deployments if your setup references it.
The prefect.yaml
file typically resides in your project's root directory, but with Prefect 3.x, it can be located elsewhere as long as it's referenced correctly. If you want to use a different configuration file, you can specify it with the --prefect-file
argument in CLI commands.
For more details on how prefect.yaml
affects deployments, see the Prefect documentation on YAML deployments.
In summary, while the .deploy()
call is explicit, the prefect.yaml
file can provide default configurations unless overridden in your deployment call.Mike B
02/28/2025, 4:03 AMname: elt
prefect-version: 3.2.0
# build section allows you to manage and build docker images
build: null
# push section allows you to manage if and how this project is uploaded to remote locations
push: null
# pull section allows you to provide instructions for cloning this project in remote locations
pull:
- prefect.deployments.steps.set_working_directory:
directory: /opt/prefect/elt
# the deployments section allows you to provide configuration for deploying flows
deployments:
Marvin
02/28/2025, 4:03 AMprefect.yaml
, you'll need to manage Docker images manually. Here's a concise breakdown of what you would do:
1. Create Docker Image: Use DockerImage
to define your Docker image configuration.
python
from prefect.infrastructure.docker import DockerImage
docker_image = DockerImage(...)
2. Build the Image: Execute the build method on your DockerImage instance.
python
docker_image.build()
3. Push the Image: Push the built image to your desired registry.
python
docker_image.push()
4. Deploy Workflow: Reference the Docker image in your deployment call.
python
my_workflow.deploy(infrastructure=docker_image, ...)
By doing this, you are explicitly managing your Docker infrastructure outside of Prefect's automatic configurations. The prefect.yaml
file you provided focuses on setting the working directory and doesn't handle Docker image management, so manual steps are necessary.
For more detailed instructions, you might want to review the Prefect Docker documentation.