Skip to content

Latest commit

 

History

History
55 lines (47 loc) · 1.23 KB

File metadata and controls

55 lines (47 loc) · 1.23 KB

Airflow

Build (Docker)

curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.2.0/docker-compose.yaml'
mkdir ./dags ./logs ./plugins
echo -e "AIRFLOW_UID=$(id -u)\nAIRFLOW_GID=0" > .env
docker-compose up airflow-init
docker-compose up -d

#to use cli command
curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.2.0/airflow.sh'
chmod +x airflow.sh
./airflow.sh bash

#set user config example
airflow users create \
    --username admin \
    --firstname Chungchoon \
    --lastname Hindi \
    --role Admin \
    --email [email protected]

Build (Virtual Env)

source .venv/bin/activate
pip install pip --upgrade
pip install 'apache-airflow==2.2.0'
export AIRFLOW_HOME=.
airflow db init

#set user config example
airflow users create \
    --username admin \
    --firstname Chungchoon \
    --lastname Hindi \
    --role Admin \
    --email [email protected]

#run webserver & scheduler
airflow webserver --port 8080
airflow scheduler

retrain.py should locate in dags directory

#first, clone this repo
cp -r ./final-project-level3-nlp-09/retrain.py opt/airflow/dags/retrain.py

Airflow Web Server

  • localhost:8080
  • default ID / PW : airflow / airflow
  • Unpause DAG:retrain on web