docker-airflow
docker-airflow copied to clipboard
Add optional importing of Airflow variables in entrypoint.sh
Hello,
I stumbled across this repo recently and I want to thank you for setting it up. I need to import Airflow variables from my prod env. and I couldn't find a way to do this reading the docs or source code so i added it, its a small change but adds a lot of value for me (and hopefully others).
If there is a better way of doing this or you have any comments regarding my approach please share.
Hi @bdvll We use a separate service in my docker-compose-*.yml. Which does exactly what you describe, without having to patch readme, and allowing multiple variable files ( ie parametrized by env).
A service name variables. Your mountpoint in the 'volumes' section
command: >
wait-for-it.sh webserver:8080 -t 300 --
bash -c " airflow variables -i varfile.json"
We also do the same for user creation.
This allows us to not run this at every startup for example.
Hi @enys
Thank you for taking the time to explain how you do it. If this is the consensus on how variable import should be done, I'm fine with that, even though I suggest adding an example to the docs would not hurt.
No idea if this is the consensus however. Completely agree on docs.
command: > wait-for-it.sh webserver:8080 -t 300 -- bash -c " airflow variables -i varfile.json"
@enys Could you give a little more detail on that, and post an example?
Is this available in puckel::master ? @bdvll
Hi @bdvll We use a separate service in my docker-compose-*.yml. Which does exactly what you describe, without having to patch readme, and allowing multiple variable files ( ie parametrized by env).
A service name variables. Your mountpoint in the 'volumes' section
command: > wait-for-it.sh webserver:8080 -t 300 -- bash -c " airflow variables -i varfile.json"
We also do the same for user creation.
This allows us to not run this at every startup for example.
Could you provide a detailed example with docker compose file if possible?