https://prefect.io logo
Title
a

Andrew Lawlor

05/13/2022, 3:10 PM
how do i set/access environment variables with a dask executor? i had been setting them with my runconfig, but when i switched to a dask executor they arent showing up anymore
k

Kevin Kho

05/13/2022, 3:13 PM
It’s the worker that doesn’t have the environment variable. I think the Flow has them right? You can add them to DaskExecutor on startup normally using the kwargs of your cluster type. You can also add it to the worker image or use the KV store/Prefect secret (but I think you’re on server)
a

Andrew Lawlor

05/13/2022, 3:14 PM
im on cloud
i think putting them in daskexecutor on startup makes the most sense for me tho
k

Kevin Kho

05/13/2022, 3:15 PM
Ah ok, using the KV Store potentially might be less work to get that to the workers (but really it should be added on cluster creation). What type of Dask cluster are you using?
a

Andrew Lawlor

05/13/2022, 3:16 PM
k

Kevin Kho

05/13/2022, 3:17 PM
KubeCluster
takes in an
env
argument. You can try passing the environment variable to that.
a

Andrew Lawlor

05/13/2022, 6:34 PM
ok that worked thx