一个 Python 编写的调度工具,在此记录它的部署过程。
部署
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| From vultr
ssh-keygen cat | Users/YourUserName/.ssh/id_rsa.pub | set-clibboard
使用 Docker 配置 Airflow
docker pull puckel/docker-airflow
docker run -d -p 8080:8080 puckel/docker-airflow webserver
docker exec -i -t 1291e03f bash
vim set_password.py
import airflow from airflow import models, settings from airflow.contrib.auth.backends.password_auth import PasswordUser
user = PasswordUser(models.User()) user.username = 'new_user_name' user.email = 'new_user_email@example.com' user.password = 'set_the_password' session = settings.Session() session.add(user) session.commit() session.close()
sudo docker cp a3a3dc6b79fe:/usr/local/airflow/airflow.cfg . vim airflow.cfg . sudo docker cp airflow.cfg dc8b159da311:/usr/local/airflow/
sudo docker cp set_password.py 1291e03f85fc:/usr/local/airflow/
docker exec -i -t 1291e03f85fc bash
python set_password.py
pip intall flask_bcrypt
python set_password.py docker container restart 1291e03f85fc docker container ls
使用
airflow list_dags
Filling up the DagBag from /home/repl/workspace/dags , 加粗部分为 dags 所在文件夹
cat ~/airflow/airflow.cfg
其他
sudo docker logs ${container_id}
|
参考