【发布时间】:2017-06-14 21:50:45
【问题描述】:
在顺序执行器下,我有一个 DAG 文件,我在其中指定了三个需要顺序运行的任务(t1-->t2-->t3):
default_args = {
'owner': 'airflow',
'start_date': datetime(2017, 6, 14, 23 , 20),
'email_on_failure': False,
'email_on_retry': False,
}
dag = DAG('test_dag', default_args=default_args, schedule_interval="*/5 * * * *")
t1 = BashOperator(
task_id='form_dataset',
bash_command='python 1.py',
dag=dag)
t2 = BashOperator(
task_id='form_features',
bash_command='python 2.py',
depends_on_past=True,
dag=dag)
t3 = BashOperator(
task_id='train',
bash_command='python 3.py',
depends_on_past=True,
dag=dag)
t2.set_upstream(t1)
t3.set_upstream(t2)
t4.set_upstream(t3)
我假设顺序行为 t1-->t2-->t3 是默认行为,但认为在我的情况下并非如此(顺序几乎是随机的,例如 t1-->t2-->t2- ->t1-->t3)。我缺少什么样的论点可以纠正这种行为?
【问题讨论】:
标签: airflow apache-airflow airflow-scheduler