Set up airflow local dev env in 5 minutes - This is not an official instruction. This is only for Chinese mainland developers who have network issues when installing python and js dependencies.
- main (dev branch)
- 2.9.0
- Airflow uses
hatch
to manage local dev env since 2.8.1
- go to the airflow project root path
- run
hatch python install 3.10
, from the error output, find the path of hatch venv. source <hatch-venv-path>/bin/activate
pip install httpx[socks]
- open vpn and set network proxy in terminal
export http_proxy=<your-proxy-address>
export https_proxy=<your-proxy-address>
hatch env show
- find a env and run hatch env create airflow-310
- close vpn and unset proxy in terminal
hatch env find airflow-310
- run
hatch -e airflow-310 shell
orsource the airflow-310 venv
- run
pip install -e ".[devel]"
- before running pip install, runpip config list -v
and make sure the registry is set to domestic registry - (optional) set the alias in ~/.zshrc a="xxxxx/bin/airflow" (default airflow is not the one installed), if path contains blank, use '' outside "", e.g. - alias a='"/Users/alibaba/Library/Application Support/hatch/env/virtual/apache-airflow/Hq9asqcX/airflow-310/bin/airflow"' and
source ~/.zshrc
- run
hatch -e airflow-310 shell
or source the airflow-310 venv to get into venv, and runa standalone
, runa db reset
if there is existing standalone db file
- run
yarn config set registry https://registry.npmmirror.com
, change the registry to domestic registry - delete
yarn.lock
, otherwise the registry will not take effect - delete all yarn / npm proxies -
yarn config delete proxy
yarn config delete https-proxy
npm config delete proxy
npm config delete https-proxy
- run
yarn config list
to make sure all proxies deleted - run
pre-commit run --hook-stage manual compile-www-assets --all-files
to compile front-end assets
- If worker crashes with
SIGSEGV
when you try to view logs, runexport no_proxy=*
before starting airflow.