From the tutorial this is OK:
t2 = BashOperator(
task_id='sleep',
bash_command='sleep 5',
retries=3,
dag=dag)
But you're passing a multi-line command to it
create_command = """
./scripts/create_file.sh
"""
should be
create_command = "./scripts/create_file.sh "
Moreover, you also have to make sure that you are in the correct directory to avoid cryptic errors. Do it like this for example:
create_command = "./scripts/create_file.sh "
if os.path.exists(create_command):
t1 = BashOperator(
task_id= 'create_file',
bash_command=create_command,
dag=dag
)
else:
raise Exception("Cannot locate {}".format(create_command))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…