Rajdeep Rao
05/04/2021, 11:18 PM/bin/sh -c ./bash-script.sh prefect execute flow-run
? I would like to run this bash script that basically exports all my env vars that are in a file. Since we use dot-env to run our services, my base docker image already has all my env vars I just need to export them while my tasks spin up.
I tried overriding them with run-task-kwargs, in the ECSRunconfig() and by passing in a custom task_def, but for some reason my tasks don't respect theseKevin Kho
env
in the ECSRunConfig . But also, you can make your python script register the flow and invoke it immediately with the Client
. Then you can do python flow.py
. If you don’t need to register, you can just have the client start it. Look for create_flow_run .Rajdeep Rao
05/05/2021, 1:36 AMenv
section. I know AWS allows passing env files. Something like that would've helped my case.Kevin Kho
Rajdeep Rao
05/05/2021, 1:53 AMKevin Kho
load_dotenv()
inside your Flow script since the .env file is in the Docker container. Then you could maybe pass them as parameters, but I haven’t used dotenv so I’m not entirely sure if this would work.stored_as_script=True
Rajdeep Rao
05/05/2021, 2:36 AMI wanted to avoid making them all individual env vars and feeding them to the flow in theJust because it'd be a cleaner experience for the folks that build these jobs. And because this would be something that would be needed to be done before every flow/task which is a little unideal. Esp since they're going to be the same across all of themsectionenv
Kevin Kho