Airflow Local setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export AIRFLOW_HOME="$(pwd)/airflow-local" | |
# -p ignores if file already exists | |
mkdir -p "$(pwd)/airflow-local" | |
# Install Airflow using the constraints file | |
AIRFLOW_VERSION=2.4.3 | |
PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)" | |
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt" | |
cd $AIRFLOW_HOME | |
python -m venv venv | |
source venv/bin/activate | |
pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}" | |
pip install "apache-airflow[postgres]==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}" | |
`mkdir -p "${AIRFLOW_HOME}/dags"` | |
# The Standalone command will initialise the database, make a user, | |
# and start all components for you. | |
airflow standalone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment