Airflow 任务调度

Apache Airflow https://airflow.apache.org/ 

Airflow™ is a platform created by the community to programmatically author, schedule and monitor workflows.

 

from datetime import datetime

from airflow import DAG
from airflow.decorators import task
from airflow.operators.bash import BashOperator

# A DAG represents a workflow, a collection of tasks
with DAG(dag_id="demo", start_date=datetime(2022, 1, 1), schedule="0 0 * * *") as dag:
# Tasks are represented as operators
hello = BashOperator(task_id="hello", bash_command="echo hello")

@task()
def airflow():
print("airflow")

# Set dependencies between tasks
hello >> airflow()

 

 

posted @ 2024-04-24 18:08  papering  阅读(13)  评论(0编辑  收藏  举报