Alex Litvinov
12/28/2023, 5:43 AMMarvin
12/28/2023, 5:44 AMprefect.yaml
file is used by the prefect deploy
command to deploy your flows, and as a part of that process, it can also build and push your Docker image. According to the documentation, it is possible to specify a prefect-version
in your prefect.yaml
file. This version pinning is useful for specifying the version of Prefect you want to use for your project.
Here's an excerpt from a prefect.yaml
file as shown in the documentation:
yaml
# Generic metadata about this project
name: flows
prefect-version: 2.13.8 # Specify the Prefect version
# Build section allows you to manage and build Docker images
build:
- prefect_docker.deployments.steps.build_docker_image:
id: build-image
requires: prefect-docker>=0.4.0
image_name: "{{ $PREFECT_IMAGE_NAME }}"
tag: latest
dockerfile: ...
This configuration ensures that whenever you deploy your flows using this prefect.yaml
, it will use the specified Prefect version 2.13.8
. So, while you are not required to "hardcode" the version, doing so can help maintain consistency and control over the Prefect version used in different environments. If you choose not to specify the version, your deployment may use the latest available version, which could lead to unexpected changes if new versions introduce breaking changes or behavior differences.