Kaynağa Gözat

aded test dag for hpc

Avik Datta 4 yıl önce
ebeveyn
işleme
9d02977982
1 değiştirilmiş dosya ile 33 ekleme ve 0 silme
  1. 33 0
      dags/test_dag.py

+ 33 - 0
dags/test_dag.py

@@ -0,0 +1,33 @@
+from airflow.models import DAG,Variable
+from airflow.operators.bash_operator import BashOperator
+from airflow.utils.dates import days_ago
+
+args = {
+    'owner':'airflow',
+    'start_date':days_ago(2),
+    'provide_context': True,
+}
+
+dag = DAG(
+        dag_id='test_dag',
+        schedule_interval=None,
+        default_args=args,
+        tags=['test','hpc',]
+      )
+
+with dag:
+  task1 = \
+    BashOperator(
+      task_id='task1',
+      dag=dag,
+      bash_command='echo "Test1"',
+      queue='hpc_4G'
+    )
+  task2 = \
+    BashOperator(
+      task_id='task2',
+      dag=dag,
+      bash_command='echo "Test2"',
+      queue='hpc_1G'
+    )
+  task1 >> task2