BashOperator doen't run bash file apache airflow

后端 未结 3 789
猫巷女王i
猫巷女王i 2020-12-16 23:40

I just started using apache airflow. I am trying to run test.sh file from airflow, however it is not work.

Following is my code, file name is test.py



        
相关标签:
3条回答
  • 2020-12-16 23:55

    Try without the "sh" just set the command to "home/ubuntu/test/inst/scripts/test.sh"

    0 讨论(0)
  • 2020-12-17 00:16

    use just the script path, without "sh": create_command = "/home/ubuntu/test/inst/scripts/test.sh"

    also make sure that "airflow" user has permissions to execute "test.sh" script.

    0 讨论(0)
  • 2020-12-17 00:21

    Add a space after .sh it should work this is mentioned in the confluence page of airflow

    t2 = BashOperator(
    task_id='sleep',
    bash_command="/home/batcher/test.sh", // This fails with `Jinja template not found` error
    #bash_command="/home/batcher/test.sh ", // This works (has a space after)
    dag=dag) 
    
    0 讨论(0)
提交回复
热议问题