Skip to content

Instantly share code, notes, and snippets.

@bhavaniravi
Created January 17, 2023 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhavaniravi/bca59c263fff1e9e2924326c0139c421 to your computer and use it in GitHub Desktop.
Save bhavaniravi/bca59c263fff1e9e2924326c0139c421 to your computer and use it in GitHub Desktop.
Airflow Local setup
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