Adam Gold
07/18/2024, 2:19 PMprefect.yaml
.
I want to create multiple deployments with the same image. I don’t want the image to be built each time, so I am looking for a way to pull a specific image from GCR for each deployment. Here I don’t see any option to specify pull
to pull a specific image - am I missing something?Kevin Grismore
07/18/2024, 2:22 PMwork_pool:
job_variables:
image: your/image:tag
Kevin Grismore
07/18/2024, 2:24 PMwork_pool:
job_variables:
image: {{ $MY_IMAGE }}
Adam Gold
07/18/2024, 2:39 PMKevin Grismore
07/18/2024, 2:40 PMAdam Gold
07/18/2024, 2:41 PMprefect deploy
?Kevin Grismore
07/18/2024, 2:42 PMKevin Grismore
07/18/2024, 2:43 PMAdam Gold
07/18/2024, 2:43 PMprefect deploy
Adam Gold
07/18/2024, 2:43 PMAdam Gold
07/18/2024, 2:55 PMprefect deploy --all
, I get asked:
Would you like your workers to pull your flow code from a remote storage
location when running this flow? [y/n] (y)
I am not sure why - I want the worker to pull the image like I mentioned. This is my `prefect.yaml`:
build: null
push: null
pull: null
# the definitions section allows you to define reusable components for your deployments
definitions:
work_pool: &common_work_pool
name: "correlation-engine"
job_variables:
image: "europe-west1-docker.pkg.dev/.../.../app:..."
# the deployments section allows you to provide configuration for deploying flows
deployments:
- name: "prod_test_run_all_tenant_spaces"
schedule: "0 * * * *" # every hour
entrypoint: "test.py:run_all_tenants_spaces"
work_pool: *common_work_pool
Kevin Grismore
07/18/2024, 3:44 PMKevin Grismore
07/18/2024, 3:44 PMprefect deploy --no-prompt --all
Adam Gold
07/18/2024, 4:35 PMAdam Gold
07/19/2024, 6:15 AMNormal Created 46s kubelet Created container prefect-job
Warning Failed 42s kubelet Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "prefect": executable file not found in $PATH: unknown
Brian
07/19/2024, 6:43 AMtest.py
is contained inside your image at /opt/prefect
? Something like:
@flow
def run_all_tenants_spaces(...):
...
I'm curious how `parameter`s are passed into the flow run if you're using a custom docker image - doesn't seem documented anywhere.
@Kevin Grismore Separately, on prefect==2.19.8
, I'm getting No such option: --no-prompt
Adam Gold
07/19/2024, 6:44 AMprefect --no-prompt deploy
should fix itAdam Gold
07/19/2024, 6:46 AMentrypoint
works and how the prefect worker calls the flow run_all_tenants_spaces
Brian
07/19/2024, 6:53 AMentrypoint
is tripping me up. it's a mandatory field in prefect.yaml
, but when you run prefect deploy
, prefect seems to be looking into the local working directory for the filepath:func
to deploy. when instead, i expected it to be using entrypoint of the image's filesystem only at runtime?Adam Gold
07/19/2024, 7:33 AMpoetry
. Is there any way to change the command to poetry run …
so it can run with all the dependencies? @Kevin GrismoreKevin Grismore
07/19/2024, 4:06 PMentrypoint
or command
in your dockerfile because prefect will set the command for you default is prefect flow-run execute
which runs some python that imports and executes the flow function described in your deployment's entrypoint
.Kevin Grismore
07/19/2024, 4:07 PM&& prefect flow-run execute
Adam Gold
07/19/2024, 4:08 PMKevin Grismore
07/19/2024, 4:09 PMKevin Grismore
07/19/2024, 4:10 PMAdam Gold
07/19/2024, 4:12 PMAdam Gold
07/19/2024, 4:12 PMKevin Grismore
07/19/2024, 4:13 PMKevin Grismore
07/19/2024, 4:14 PMAdam Gold
07/19/2024, 4:24 PMAdam Gold
07/19/2024, 4:25 PMdefinitions:
work_pool: &common_work_pool
name: "correlation-engine"
job_variables:
image: "europe-west1-docker.pkg.dev/{{ $$GOOGLE_PROJECT_ID }}/{{ $CIRCLE_PROJECT_REPONAME }}/app:{{ $$CIRCLE_SHA1 }}"
config_map_ref: "{{ $CIRCLE_PROJECT_REPONAME }}-configmap"
secret_ref: "{{ $CIRCLE_PROJECT_REPONAME }}-secret"
env:
CORE_URL: <http://core>
How can I have different values for local/prod?Kevin Grismore
07/19/2024, 4:26 PMAdam Gold
07/19/2024, 4:26 PMhelm
so different values.yaml filesAdam Gold
07/19/2024, 4:27 PMKevin Grismore
07/19/2024, 4:27 PMKevin Grismore
07/19/2024, 4:28 PM