diff --git a/README.md b/README.md index b96989421bd0f8..141e8b5c946fb9 100644 --- a/README.md +++ b/README.md @@ -83,15 +83,14 @@ Apache Airflow is tested with: | Python | 3.6, 3.7, 3.8 | 3.6, 3.7, 3.8 | 2.7, 3.5, 3.6, 3.7, 3.8 | | PostgreSQL | 9.6, 10, 11, 12, 13 | 9.6, 10, 11, 12, 13 | 9.6, 10, 11, 12, 13 | | MySQL | 5.7, 8 | 5.7, 8 | 5.6, 5.7 | -| SQLite | latest stable | latest stable | latest stable | +| SQLite | 3.15.0+ | 3.15.0+ | 3.15.0+ | | Kubernetes | 1.16.9, 1.17.5, 1.18.6 | 1.16.9, 1.17.5, 1.18.6 | 1.16.9, 1.17.5, 1.18.6 | -**Note:** MariaDB and MySQL 5.x are unable to or have limitations with -running multiple schedulers -- please see the "Scheduler" docs. +**Note:** MySQL 5.x versions are unable to or have limitations with +running multiple schedulers -- please see the "Scheduler" docs. MariaDB is not tested/recommended. **Note:** SQLite is used in Airflow tests. Do not use it in production. We recommend -using the latest stable version of SQLite for local development. Some older versions -of SQLite might not work well, however anything at or above 3.27.2 should work fine. +using the latest stable version of SQLite for local development. ## Support for Python versions diff --git a/airflow/configuration.py b/airflow/configuration.py index 2b6d363efd539d..14b731ec1ccd8b 100644 --- a/airflow/configuration.py +++ b/airflow/configuration.py @@ -30,6 +30,7 @@ # Ignored Mypy on configparser because it thinks the configparser module has no _UNSET attribute from configparser import _UNSET, ConfigParser, NoOptionError, NoSectionError # type: ignore +from distutils.version import StrictVersion from json.decoder import JSONDecodeError from typing import Dict, List, Optional, Tuple, Union @@ -230,10 +231,15 @@ def _validate_config_dependencies(self): 'SequentialExecutor', ) is_sqlite = "sqlite" in self.get('core', 'sql_alchemy_conn') - if is_executor_without_sqlite_support and is_sqlite: - raise AirflowConfigException( - "error: cannot use sqlite with the {}".format(self.get('core', 'executor')) - ) + if is_sqlite and is_executor_without_sqlite_support: + raise AirflowConfigException(f"error: cannot use sqlite with the {self.get('core', 'executor')}") + if is_sqlite: + import sqlite3 + + # Some of the features in storing rendered fields require sqlite version >= 3.15.0 + min_sqlite_version = '3.15.0' + if StrictVersion(sqlite3.sqlite_version) < StrictVersion(min_sqlite_version): + raise AirflowConfigException(f"error: cannot use sqlite version < {min_sqlite_version}") if self.has_option('core', 'mp_start_method'): mp_start_method = self.get('core', 'mp_start_method') diff --git a/docs/apache-airflow/installation.rst b/docs/apache-airflow/installation.rst index 590d689d86fbfb..9bcb0e7846b637 100644 --- a/docs/apache-airflow/installation.rst +++ b/docs/apache-airflow/installation.rst @@ -21,6 +21,28 @@ Installation .. contents:: :local: + +Prerequisites +------------- + +Airflow is tested with: + +* Python: 3.6, 3.7, 3.8 + +* Databases: + + * PostgreSQL: 9.6, 10, 11, 12, 13 + * MySQL: 5.7, 8 + * SQLite: 3.15.0+ + +* Kubernetes: 1.16.9, 1.17.5, 1.18.6 + +**Note:** MySQL 5.x versions are unable to or have limitations with +running multiple schedulers -- please see the "Scheduler" docs. MariaDB is not tested/recommended. + +**Note:** SQLite is used in Airflow tests. Do not use it in production. We recommend +using the latest stable version of SQLite for local development. + Getting Airflow '''''''''''''''