Zach Hodowanec
03/18/2021, 3:33 PMrun_config
parameters on a Kubernetes Agent for subsequent flows to consume rather than duplicating similar run_configs
across various flows. We currently make use of the PREFECT__CLOUD__AGENT__ENV_VARS
to pass along storage
configurations, but not having much success attempting to update the execution environment to use an internal custom image. I have tried passing the IMAGE
and the PREFECT__CONTEXT__IMAGE
environment variables to my job spec thus far to no avail.PREFECT__CONTEXT__IMAGE
environment variable I am seeing the value set correctly in my configmap, however when the job kicks off the env variable is using the prefecthq/prefect:0.14.6
as it's value. What's interesting about this use case is that if don't pass in a PREFECT__CONTEXT__IMAGE
value at all the k8s job does not assign a value for it.Jenny
03/18/2021, 4:46 PMZach Hodowanec
03/18/2021, 5:05 PMflow.run_config = KubernetesRun(image=os.getenv("MY_CUSTOM_IMAGE")
on every flow I was hoping to set something on the agent config itself to override the default execution environment image. Since we know each flow is going to execute on a Kubernetes agent it seems redundant to also define the flow.run_config
as such.
Potentially this issue is more in line with what I'm trying to accomplish?Jenny
03/18/2021, 5:58 PMMarvin
03/18/2021, 5:58 PMJenny
03/18/2021, 6:15 PMJim Crist-Harif
03/18/2021, 6:29 PMimage
(fixing that now).Zach Hodowanec
03/18/2021, 6:43 PMflow.run_config = KubernetesRun(image=os.getenv("MY_CUSTOM_IMAGE")
set on each flow the best/recommended way to go about it for now?Jim Crist-Harif
03/18/2021, 6:46 PMZach Hodowanec
03/18/2021, 6:48 PMimage
more configurable?Jim Crist-Harif
03/18/2021, 6:49 PMZach Hodowanec
03/18/2021, 9:56 PMimage
for Prefect's default job spec, correct?Jim Crist-Harif
03/18/2021, 10:11 PM--image
flag on the agent, you'd write your own job template and pass it to the agent as --job-template your-template.yaml
.apiVersion: batch/v1
kind: Job
spec:
template:
spec:
containers:
- name: flow
image: your-image-here
Zach Hodowanec
03/18/2021, 10:58 PM