I just started using apache airflow. I am trying to run the test.sh file from the air stream, however this does not work.
Below is my code, the file name is test.py
import os from airflow import DAG from airflow.operators.bash_operator import BashOperator from datetime import datetime, timedelta default_args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime(2015, 6, 1), 'email': [' airflow@airflow.com '], 'email_on_failure': False, 'email_on_retry': False, 'retries': 1, 'retry_delay': timedelta(minutes=5),
when I run python ~ / airflow / dags / test.py it does not cause any errors.
However, when I run airflow list_dag, it throws the following error:
[2017-02-15 20:20:02,741] {__init__.py:36} INFO - Using executor SequentialExecutor [2017-02-15 20:20:03,070] {models.py:154} INFO - Filling up the DagBag from /home/ubuntu/airflow/dags [2017-02-15 20:20:03,135] {models.py:2040} ERROR - sh home/ubuntu/test/inst/scripts/test.sh Traceback (most recent call last): File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/airflow/models.py", line 2038, in resolve_template_files setattr(self, attr, env.loader.get_source(env, content)[0]) File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/jinja2/loaders.py", line 187, in get_source raise TemplateNotFound(template) TemplateNotFound: sh home/ubuntu/test/inst/scripts/test.sh
I tried using How to run a bash script file in Airflow for an answer, it does not work
Where am I mistaken?