Andrew McIntosh
01/12/2024, 4:20 AMimage:
coming through?
definitions:
tags: &common_tags
- eks
work_pool: &common_work_pool
name: local-test
job_variables:
image: "{{ build_image.image }}"
image_ref: "{{ build_image.image }}"
environment: "{{ prefect.variables.environment }}"
test_var: "test"
deployments:
- name: sample
tags: *common_tags
schedule:
entrypoint: flows/sample/pipeline.py:sample
work_pool: *common_work_pool
version: "{{ get_commit_hash.stdout }}"
description:
parameters:
Marvin
01/12/2024, 4:21 AMimage:
might not be coming through in your deployment:
1. Configuring the Base Job Template:
Ensure that the Kubernetes base job template is configured properly with default values that can be overridden by individual deployments. You can manage this in the Prefect Cloud UI or with the Prefect CLI. Ensure that your custom image name and tag are allowed to be configured here. More details are available in the official Prefect Kubernetes Deployment documentation.
2. Using YAML Anchors and Aliases:
Check to confirm that you are using YAML anchors and aliases correctly. The syntax &<alias_name>
is used to declare a YAML alias, and *<alias_name>
is used to reference it. Verify that your &common_work_pool
anchor is correctly defined and that *common_work_pool
effectively references it in the deployment. There might be a misuse or mishandling in how the alias is being used, which prevents the image from being correctly set. Read more about reusing configuration in the Prefect Deployment documentation.
3. Setting Custom Image:
When initializing a deployment, you can set fields such as image_name
and tag
using the --field
flag when using the CLI. Make sure that when you define the image
and image_ref
in the job variables, they correspond properly to the fields in your steps that build and push the Docker image. If these variables are not substituting the values as expected, your custom image may not be used. This information is also part of the document on Prefect Docker Deployments.
Remember that for any settings or configurations to take effect, they might require a deployment process to be executed. Check Prefect documentation or support channels for more targeted assistance if this general advice does not resolve the issue.