Airflow学习笔记 --- job配置文件说明
2017-05-08 17:03
477 查看
""" Code that goes along with the Airflow tutorial located at: https://github.com/airbnb/airflow/blob/master/airflow/example_dags/tutorial.py """ # The DAG object; we'll need this to instantiate a DAG from airflow import DAG # Operator; we need this operate; from airflow.operators.bash_operator import BashOperator from datetime import datetime, timedelta # Default Arguments default_args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime(2015, 6, 1), 'email': ['812716131@qq.com'], 'email_on_failure': False, 'email_on_retry': False, 'retries': 1, 'retry_delay': timedelta(minutes=5), # 'queue': 'bash_queue', # 'pool': 'backfill', # 'priority_weight': 10, # 'end_date': datetime(2016, 1, 1), } # Instantiate a DAG dag = DAG('tutorial', default_args=default_args) # t1, t2 and t3 are examples of tasks created by instantiating operators t1 = BashOperator( task_id='print_date', bash_command='date', dag=dag) t2 = BashOperator( task_id='sleep', bash_command='sleep 5', retries=3, dag=dag) templated_command = """ {% for i in range(5) %} echo "{{ ds }}" echo "{{ macros.ds_add(ds, 7)}}" echo "{{ params.my_param }}" {% endfor %} """ t3 = BashOperator( task_id='templated', bash_command=templated_command, params={'my_param': 'Parameter I passed in'}, dag=dag) t2.set_upstream(t1)t3.set_upstream(t1)
相关文章推荐
- cocos2d-x 学习笔记(1)关于cocos2d-x(环境配置,项目结构,文件说明)
- 【Puppet in action】 学习笔记之Puppet目录结构及配置文件说明
- 【学习笔记】redis配置文件redis.conf参数说明
- 树莓派学习笔记——webiopi配置文件说明
- 1. Laravel5学习笔记:Composer.json配置文件说明
- Tapestry学习笔记,3个配置文件
- [WCF 学习笔记] 11. 配置文件
- Autofac学习笔记之-配置文件实现组件注册
- 黑马程序员_学习笔记8用类加载器的方式管理资源和配置文件及类加载器的总结
- hibernate3 学习笔记(二) hibernate 的配置文件 hibernate.cfg.xml
- wcf学习笔记_2(修改wcf配置文件)
- java反射学习笔记三(改进笔记二放到配置文件中)
- Redis 学习(二) 配置文件说明
- [原]spring学习笔记9.3-Spring对Aop的支持-配置文件的方式
- Unity学习笔记1-以配置文件方式注册组件
- hibernate3 学习笔记(三) hibernate 日志配置文件 log4j.properties
- Unity 学习笔记(2) -- 配置文件的使用
- C++Builder学习笔记5.1(连接数据库,读写配置文件,加载DLL)
- debian学习笔记7, mplayer smplayer详细配置说明.解决播放视频没有画面只有声音,w32codecs.w74codecs插件配置.