-
Notifications
You must be signed in to change notification settings - Fork 0
/
deliver_pipeline_dag.py
44 lines (35 loc) · 1.15 KB
/
deliver_pipeline_dag.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from datetime import datetime
import scripts.deliver_pipeline
from airflow import DAG
from airflow.operators.python import PythonOperator
"""
Airflow DAG to call the deliver_pipeline.py code.
"""
with DAG(
dag_id="deliver_pipeline",
schedule_interval=None,
start_date=datetime(2022, 1, 1),
catchup=False,
tags=["deliver_pipeline"],
) as dag:
"""
Read the input arguments such as:
{"project":"13097","pi":"abdelwao","recipe":"RNASeq-TruSeqPolyA"}
"""
def deliver(ds, **kwargs):
project = kwargs["params"]["project"]
pi = kwargs["params"]["pi"]
# recipe here is actually request name
recipe = kwargs["params"]["recipe"]
print("Delivering the pipeline output and/or .bams for {} {} {}".format(project, pi, recipe))
result = scripts.deliver_pipeline.deliver_pipeline_output(project, pi, recipe)
return result
deliver_pipeline_output = PythonOperator(
task_id='deliver_pipeline',
python_callable=deliver,
provide_context=True,
email_on_failure=True,
email='[email protected]',
dag=dag
)
deliver_pipeline_output