Add --backend=custom option for external databases in Breeze#61615
Add --backend=custom option for external databases in Breeze#61615andreahlert wants to merge 7 commits intoapache:mainfrom
Conversation
Allow users to run Breeze with a custom database backend by providing their own connection string via AIRFLOW__DATABASE__SQL_ALCHEMY_CONN. This avoids spinning up an unnecessary database container when using an external database. Closes: apache#55886
f5fae51 to
3e77325
Compare
Update inlined scripts in Dockerfile.ci to include custom backend display logic. Regenerate breeze command SVG images and hash files for all commands affected by the new --backend=custom option.
|
I think if we do that, then there should be a parameter defined to provide the sqlalchemy URL to connect to - rather than relying on the env variable setting (and this new paraemeter should have an env fallback) |
|
Good point! I'll add a I went with |
Add a --custom-db-url parameter that provides the SQLAlchemy connection URL when using --backend=custom. Falls back to the AIRFLOW__DATABASE__SQL_ALCHEMY_CONN environment variable if not provided. This addresses the review feedback requesting an explicit CLI parameter instead of relying solely on environment variable configuration.
jscheffl
left a comment
There was a problem hiding this comment.
I Like the idea very much.
Due to a parallel PR the generated docs need to be re-generated. Then it is OK to be merged in my view
Just one thought before fixing all: Have you considered to add the DB URL directly in the place where --backend is defined? Then we would save passing an additional parameter. Only tradeoff would be that click can not validate the parameters from a fixed enum.
|
Thanks, glad you like it! I thought about putting the URL directly in Keeping Will regenerate the docs and address your inline comment too. |
That makes totally sense! So let's go with the current proposal in the PR. That is also OK. |
Resolve conflicts in auto-generated Breeze doc images by accepting main's version. CI will regenerate them with the updated custom backend parameters.
Show the connection URL with password masked (***) in the CI environment initialization output for the custom backend option.
Summary
Adds a
--backend=customoption to Breeze, allowing users to connect to an externaldatabase without spinning up an unnecessary database container.
When
customis selected:AIRFLOW__DATABASE__SQL_ALCHEMY_CONNstart-airflowworks normally (unlike--backend=none)Use case
Users running database benchmarks or connecting to remote databases with custom
monitoring setups can now use Breeze without creating a dummy container or
working around the
--backend=nonelimitation.Changes
global_constants.py- AddedCUSTOM_BACKENDconstant and included it inALLOWED_BACKENDScommon_options.py- Updated--backendhelp text to document the custom optionshell_params.py- Addedcustomto the list of backends that skip port forwardingcheck_environment.sh- Addedcustombackend validation (requiresAIRFLOW__DATABASE__SQL_ALCHEMY_CONN)entrypoint_ci.sh- Addedcustombackend display in initialization infobackend-custom.yml- New docker-compose file that setsBACKEND=customwithout overriding the DB connectionCloses: #55886