Created
October 9, 2018 00:56
-
-
Save ChengzhiZhao/a4f4cf7f6dd1a53c7ccf639d8111429a to your computer and use it in GitHub Desktop.
Test Kubernetes Executor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from airflow.operators.python_operator import PythonOperator | |
| from airflow.models import DAG | |
| from datetime import datetime | |
| import time | |
| import os | |
| args = { | |
| 'owner': 'airflow', | |
| "start_date": datetime(2018, 10, 4), | |
| } | |
| dag = DAG( | |
| dag_id='test_kubernetes_executor', | |
| default_args=args, | |
| schedule_interval=None | |
| ) | |
| def print_stuff(): | |
| print("Hi Airflow") | |
| for i in range(2): | |
| one_task = PythonOperator( | |
| task_id="one_task" + str(i), | |
| python_callable=print_stuff, | |
| dag=dag | |
| ) | |
| second_task = PythonOperator( | |
| task_id="two_task" + str(i), | |
| python_callable=print_stuff, | |
| dag=dag | |
| ) | |
| third_task = PythonOperator( | |
| task_id="third_task" + str(i), | |
| python_callable=print_stuff, | |
| dag=dag | |
| ) | |
| one_task >> second_task >> third_task |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment