Ah. What's going on here is that, for some reason,...
# ask-community
j
Ah. What's going on here is that, for some reason, Prefect stopped respecting the
job_variables: image
parameter and is just using the default image
b
Can you share the relevant snippets of the
prefect.yaml
file? What version of Prefect CLI are you using?
prefect version
j
@Brendan Dalpe 🫡
Copy code
pull:
- prefect.deployments.steps.set_working_directory:
    directory: /opt/prefect/salad

deployments:
- name: Binana
  requires: prefect-gcp prefect-docker prefect-ray
  version: null
  tags: []
  description: null
  schedule: null
  entrypoint: ./src/binanaflow.py:binanaflow
  parameters: {}
  work_pool:
    name: "GCP Cloud Run, Prod."
  work_queue_name: null
  job_variables:
    image: "{{ PREFECT_IMAGE }}"
This is the relevant part of my
prefect.yaml
(PREFECT_IMAGE is set to an image stored on our artifact repo).
Copy code
root@cf9d2ee6c5c3:/opt/prefect# prefect --version
3.4.8
I'm using a Cloud Run workpool. Despite this
job_variable
being set, it's deploying w/ the default prefect image
b
Ah, move
job_variables
under
work_pool
like this:
Copy code
pull:
- prefect.deployments.steps.set_working_directory:
    directory: /opt/prefect/salad

deployments:
- name: Binana
  requires: prefect-gcp prefect-docker prefect-ray
  entrypoint: ./src/binanaflow.py:binanaflow
  work_pool:
    name: "GCP Cloud Run, Prod."
    job_variables:
      image: "{{ PREFECT_IMAGE }}"
j
... 😂 No way. Let me try that now
b
Are you also trying to install the
prefect-gcp prefect-docker prefect-ray
packages at runtime? The
requires
field won't do anything in your deployment definition.
j
We're installing them @ runtime, yeah. If this works, it'd frustratingly explain why a couple of our other deployments are working fine, and why this one suddenly stopped working
b
Try this:
Copy code
pull:
- prefect.deployments.steps.set_working_directory:
    directory: /opt/prefect/salad

deployments:
- name: Binana
  requires: prefect-gcp prefect-docker prefect-ray
  entrypoint: ./src/binanaflow.py:binanaflow
  work_pool:
    name: "GCP Cloud Run, Prod."
    job_variables:
      image: "{{ PREFECT_IMAGE }}"
      env:
        EXTRA_PIP_PACKAGES: "prefect-gcp prefect-docker prefect-ray"
EXTRA_PIP_PACKAGES
gets used in the container entrypoint.sh file to install the packages.
j
Oh! Good call that'll serve to make the container a lot smaller (there are a couple of different deployments that use the same base image)
Also, that worked. Thank you ❤️ Glad it was just a stupid indentation problem 😄
🙌 1
b
Happy to help 🙂