This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
aris_email_trial.py
53 lines (45 loc) · 1.46 KB
/
aris_email_trial.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
45
46
47
48
49
50
51
52
53
from datetime import timedelta, datetime
from pickle import TRUE
import airflow
import code_executer
from airflow import DAG
from airflow.operators.python import PythonOperator, PythonVirtualenvOperator
from airflow.operators.python_operator import BranchPythonOperator
from airflow.contrib.operators.ssh_operator import SSHOperator
from airflow.contrib.hooks.ssh_hook import SSHHook
from airflow.operators.email_operator import EmailOperator
SERVICE_GIT_DIR = 'C:\\ARIS\\autoDigest\\ipeds' # File housing ARIS repos on SAS server's C drive
# default args
default_args = {
'owner': 'airflow',
'email': ['mtrinh@air.org', 'gchickering@air.org'],
'depends_on_past': False,
'email_on_failure': True,
'email_on_retry': False,
'email_on_success' : True,
'start_date': datetime.now() - timedelta(minutes=20),
'retries': 0,
'retry_delay': timedelta(minutes=5),
}
# Define Main DAG for CCD pipeline
dag = DAG(dag_id='aris_email_trial',
default_args=default_args,
# schedule_interval='0,10,20,30,40,50 * * * *',
dagrun_timeout=timedelta(seconds=600))
def temp_print():
print("we are in here")
temp_task = PythonOperator(
task_id = "print_message",
python_callable = temp_print,
trigger_rule='all_success',
dag = dag
)
send_email = EmailOperator(
task_id='send_email',
to='mtrinh@air.org',
subject='ingestion complete',
html_content= 'ARIS trial',
conn_id = 'smtp_default',
dag=dag
)
temp_task >> send_email