Bruno Nirello
07/22/2024, 6:12 PMMarvin
07/22/2024, 6:13 PMprefect.yaml
file, you should use the job_variables
parameter to override the environment variables for a specific deployment. Below is an example of how to set this up:
yaml
# Welcome to your prefect.yaml file! This file stores and manages
# configuration for deploying your flows. We recommend committing
# this file to source control along with your flow code.
# Generic metadata about this project
name: <WORKING-DIRECTORY>
prefect-version: 2.13.4
# build section allows you to manage and build docker image
build:
- prefect_docker.deployments.steps.build_docker_image:
id: build_image
requires: prefect-docker>=0.3.1
image_name: <PATH-TO-ARTIFACT-REGISTRY>/gcp-weather-image
tag: latest
dockerfile: auto
platform: linux/amd64
# job_variables section to override environment variables
deployments:
- name: my-deployment
work_pool_name: my_pool
job_variables:
env:
EXTRA_PIP_PACKAGES: "boto3"
image: "my_registry/my_image:my_image_tag"
In this configuration:
- The job_variables
parameter has a dictionary key env
with the special environment variable key EXTRA_PIP_PACKAGES
.
- This environment variable will instruct Prefect to install additional Python packages (like boto3
in this example) at runtime.
For further reference, you can visit the Prefect Deployment Guide.
Feel free to ask more questions if you need additional information!