😊

Airflow CLIについて

2022/09/09に公開約1,100字

AirflowのCLIについて纏めるだけの記事

Airflow CLIからDAGを実行する方法

コマンド
sudo docker-compose run airflow-worker airflow dags trigger object_storage_cost_dag
実行結果
[opc@airflow5 dags]$ sudo docker-compose run airflow-worker airflow dags trigger object_storage_cost_dag
Creating opc_airflow-worker_run ... done

WARNING! You should run the image with GID (Group ID) set to 0
         even if you use 'airflow' user (UID=50000)

 You started the image with UID=50000 and GID=50000

 This is to make sure you can run the image with an arbitrary UID in the future.

 See more about it in the Airflow's docker image documentation
     http://airflow.apache.org/docs/docker-stack/entrypoint


[2022-09-08 00:38:21,358] {__init__.py:38} INFO - Loaded API auth backend: <module 'airflow.api.auth.backend.basic_auth' from '/home/airflow/.local/lib/python3.6/site-packages/airflow/api/auth/backend/basic_auth.py'>
Created <DagRun object_storage_cost_dag @ 2022-09-08 00:38:21+00:00: manual__2022-09-08T00:38:21+00:00, externally triggered: True>
[opc@airflow5 dags]$

ちなみにDockerにログインして実行する場合は下記コマンドです。

コマンド
airflow dags trigger object_storage_cost_dag

Discussion

ログインするとコメントできます