0
次のようにdagファイルがあります。ここでは再試行はありません。しかし、特定のファイル(bash1、bash2)が再試行1.を持つべきであることを確認したいが、他のファイルは再試行しないようにしたい。bashoperatorが1つだけ再試行され、他のエアフローはないことを確認する方法
以下はデフォルトの引数です。
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2017, 3, 24, 19, 00),
'email': ['[email protected]'],
'email_on_failure': True,
'email_on_retry': True,
'retries': 0,
'retry_delay': timedelta(minutes=5),
'backfill': False,
}
Iは、以下のようにDAGを定義: DAG = DAG( 'X'、default_args = default_args、schedule_interval =「15 0,1,2,3,13,14,15,16,17,18、
bash1 = BashOperator(
task_id= 'bash1',
bash_command="cd /home/ubuntu/run_scripts/Test/inst/scripts && /usr/bin/Rscript bash1.R ",
dag=dag
)
私の第二のオペレータは次のように定義している:19,20,21,22,23 * * * ")
私の最初の演算子は、次のように定義している
bash2 = BashOperator(
task_id= 'bash2',
bash_command="cd /home/ubuntu/run_scripts/Test/inst/scripts && /usr/bin/Rscript bash2.R ",
dag=dag
)
Test_join = BashOperator(
task_id= 'Test_join',
bash_command="cd /home/ubuntu/run_scripts/Test/inst/scripts && /usr/bin/Rscript Test_join.R ",
dag=dag
)
Test_joinは、私がbash1とbash2が2ではなくTest_joinを引退したことを確認するためにしなければならないはずです何bash1とbashの2
Test_join.set_upstream(bash1)
Test_join.set_upstream(bash2)
によって異なります。私の最後の演算子は、次のように定義しています