# make folder and cd
mkdir airflow
cd airflow
# create python virtual environment & activate
python3 -m venv venv
source venv/bin/activate
# install python module used by airflow
pip3 install wheel
# install airflow
AIRFLOW_HOME=$(pwd)
AIRFLOW_VERSION=2.1.4
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"
pip3 install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
# set airflow_home path($(pwd)) on .zshrc
export AIRFLOW_HOME=/Users/jisu/Dropbox_Carl/Dropbox/JISU/DE/airflow
# initialize meta store meta database needed by airflow
airflow db init
# check airflow webserver
airflow webserver
# start airflow scheduler
airflow scheduler