From f34029afd83334d547c38b1cfe72cddcf588f0fe Mon Sep 17 00:00:00 2001 From: Kaxil Naik Date: Wed, 21 Jul 2021 21:12:28 +0100 Subject: [PATCH] Warn on Webserver when using ``SQLite`` or ``SequentialExecutor`` (#17133) Context: https://lists.apache.org/thread.html/r07e83f2462f08c4a52f6428b771a07e067ce9272b6256dca470a87fc%40%3Cdev.airflow.apache.org%3E Note: Red flashes are for errors, we shouldn't use that. GitOrigin-RevId: cb6fdd7495c3888fff3a4553af75aaf22bf95fa7 --- airflow/www/views.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/airflow/www/views.py b/airflow/www/views.py index a330ae8e98b..296b07e2974 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -512,6 +512,30 @@ def health(self): ) def index(self): """Home view.""" + unit_test_mode: bool = conf.getboolean('core', 'UNIT_TEST_MODE') + + if not unit_test_mode and "sqlite" in conf.get("core", "sql_alchemy_conn"): + db_doc_page = get_docs_url("howto/set-up-database.html") + flash( + Markup( + "Usage of SQLite detected. It should only be used for dev/testing. " + "Do not use SQLite as metadata DB in production. " + "We recommend using Postgres or MySQL. " + f"Click here for more information." + ), + category="warning", + ) + + if not unit_test_mode and conf.get("core", "executor") == "SequentialExecutor": + exec_doc_page = get_docs_url("executor/index.html") + flash( + Markup( + "Usage of SequentialExecutor detected. " + "Do not use SequentialExecutor in production. " + f"Click here for more information." + ), + category="warning", + ) hide_paused_dags_by_default = conf.getboolean('webserver', 'hide_paused_dags_by_default') default_dag_run = conf.getint('webserver', 'default_dag_run_display_number')