Tom Jordahl
09/03/2024, 5:54 PMMarvin
09/03/2024, 5:54 PMdeployment.yaml
):
sh
prefect deployment build -n myflow -p default-agent-pool -q test ./path-to-flow-script.py:flow_function_name
2. Override the job variable by setting the image value:
Once you have your deployment built, use this command to create the deployment with the overridden image value:
sh
prefect deployment apply --image <http://docker.com|docker.com>:my-different-image
Sounds like the equivalent of an intergalactic chore, doesn't it? Here are the sources of this treasure:
- Creating a deployment on the CLI
- Overriding job variables on a deployment
Let's hope this helps in making your flow deployment as painless as possible.Tom Jordahl
09/03/2024, 5:56 PMMarvin
09/03/2024, 5:57 PMsh
prefect deployment build -n myflow -p default-agent-pool -q test ./path-to-flow-script.py:flow_function_name
2. Override the job variable for image:
sh
prefect deployment apply --image <http://docker.com:my-different-image|docker.com:my-different-image>
These links should prove indispensable in your endeavor:
- Creating a deployment on the CLI
- Overriding job variables
Just think of it as another form of “therapy” for your artful pattern of overcoming deployment challenges.Nate
09/03/2024, 7:24 PMTom Jordahl
09/03/2024, 7:24 PMNate
09/03/2024, 7:33 PMjob_variable
flag for prefect deploy
in 2.xMarvin
09/03/2024, 7:33 PMjob_variable
flag in Prefect 2.x:
The job_variables
parameter allows you to override default values in a work pool's job template. You can specify environment variables such as image_pull_policy
and image
for a specific deployment.
### Here's how you can do it using the CLI:
1. Run the deployment with job variables:
sh
prefect deployment run \
--id "your-deployment-id" \
--job-variable image=<http://docker.com:my-different-image|docker.com:my-different-image>
This command uses the --job-variable
flag to set the image
variable. Replace "your-deployment-id"
with the actual deployment ID for your flow.
### Resources:
- Using `job_variable` in deployments
- General Deployment Guide
Well, it appears you have all the ingredients on how to make Prefect comply with your image desires. Enjoy.Tom Jordahl
09/03/2024, 7:34 PMMarvin
09/03/2024, 7:34 PMyaml
deployments:
- name: my-deployment
entrypoint: path-to-your-script.py:your_flow_function
work_pool:
name: your-work-pool
job_variables:
image: <http://docker.com:my-different-image|docker.com:my-different-image>
To deploy this definition, use:
sh
prefect deployment build -n my-deployment -p your-pool-path -q test ./path-to-script.py:your_flow_function
And then:
sh
prefect deployment apply prefect.yaml
For finer details, refer to the Overriding Job Variables. This should make your deployment as custom as you wish.
If you need more guidance on orchestrating the chaos, feel free to ask. Or, continue enjoying the simple joys of software deployment.Nate
09/03/2024, 7:37 PM» prefect deploy -n healthcheck-storage-test -jv image=repo/image:tag -p local
Marvin
09/03/2024, 7:37 PMTom Jordahl
09/03/2024, 7:48 PM