dag3_hpc_pipelines.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from datetime import timedelta
  2. from airflow.models import DAG,Variable
  3. from airflow.utils.dates import days_ago
  4. from airflow.operators.bash_operator import BashOperator
  5. ## ARGS
  6. default_args = {
  7. 'owner': 'airflow',
  8. 'depends_on_past': False,
  9. 'start_date': days_ago(2),
  10. 'email_on_failure': False,
  11. 'email_on_retry': False,
  12. 'retries': 1,
  13. 'retry_delay': timedelta(minutes=1),
  14. }
  15. ## DAG
  16. dag = \
  17. DAG(
  18. dag_id='dag3_hpc_pipelines',
  19. catchup=False,
  20. schedule_interval="*/3 * * * *",
  21. max_active_runs=1,
  22. tags=['hpc'],
  23. default_args=default_args)
  24. with dag:
  25. ## TASK
  26. run_demultiplexing_pipeline = \
  27. BashOperator(
  28. task_id='run_demultiplexing_pipeline',
  29. dag=dag,
  30. queue='hpc_4G',
  31. bash_command='bash /rds/general/user/igf/home/git_repo/IGF-cron-scripts/hpc/run_demultiplexing_pipeline.sh ')
  32. ## TASK
  33. run_primary_analysis_pipeline = \
  34. BashOperator(
  35. task_id='run_primary_analysis_pipeline',
  36. dag=dag,
  37. queue='hpc_4G',
  38. bash_command='bash /rds/general/user/igf/home/git_repo/IGF-cron-scripts/hpc/run_primary_analysis_pipeline.sh ')
  39. ## PIPELINE
  40. run_demultiplexing_pipeline >> run_primary_analysis_pipeline