Skip to content

Commit ed9da9d

Browse files
committed
Merge branch 'main' of github.com:cloud-barista/cm-cicada
2 parents eec7cd9 + d46865c commit ed9da9d

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

README.md

+69
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,75 @@ The Task Component automatically generated from the above JSON is as follows:
376376

377377
</details>
378378

379+
## SMTP
380+
381+
### 1. Add SMTP info
382+
file path : /_airflow/docker-compose.yml
383+
384+
modify docker-compose.yml file and enter your smtp info.
385+
386+
gmail example : https://support.google.com/a/answer/176600?hl=en
387+
388+
389+
```
390+
...
391+
airflow-server:
392+
environment:
393+
AIRFLOW__SMTP__SMTP_HOST: 'smtp.gmail.com'
394+
AIRFLOW__SMTP__SMTP_USER: '[email protected]'
395+
AIRFLOW__SMTP__SMTP_PASSWORD: 'wtknvaprkkwyaurd'
396+
AIRFLOW__SMTP__SMTP_PORT: 587
397+
AIRFLOW__SMTP__SMTP_MAIL_FROM: '[email protected]'
398+
...
399+
```
400+
### 2. Modify mail.py
401+
file path : /_airflow/airflow-home/dags/mail.py
402+
403+
Modify the recipient's email address in the email_task.
404+
405+
```
406+
...
407+
email_task = EmailOperator(
408+
task_id='send_email',
409+
to='Your [email protected]',
410+
subject='DAG 상태 보고서',
411+
...
412+
)
413+
...
414+
```
415+
416+
### 3. Add taskComponent
417+
Add trigger_email task component at the bottom of the workflow to receive email alarms.
418+
419+
```
420+
...
421+
{
422+
"name": "trigger_email",
423+
"task_component": "trigger_email",
424+
"request_body": "",
425+
"path_params": {},
426+
"dependencies": [
427+
"{$Pre_taskName}"
428+
]
429+
}
430+
431+
...
432+
```
433+
434+
## GET task log
435+
### 1. GET workflow RunId
436+
[GET] /workflow/{wfId}/runs
437+
![image](https://github.com/user-attachments/assets/27fbaf5f-c52d-4d04-b599-ef2eac9e76de)
438+
439+
### 2. GET taskId and task_Try_Num
440+
[GET] /workflow/{wfId}/workflowRun/{wfRunId}/taskInstances
441+
![image](https://github.com/user-attachments/assets/d893cc1a-2cbd-417c-a19d-a650aaca7f6e)
442+
443+
### 3. GET execution task log
444+
[GET] /workflow/{wfId}/workflowRun/{wfRunId}/task/{taskId}/taskTryNum/{taskTyNum}/logs
445+
![image](https://github.com/user-attachments/assets/347babf5-df32-4fe0-82e0-f0e111c333d1)
446+
447+
379448
## Health-check
380449

381450
Check if CM-Cicada is running

_airflow/airflow-home/dags/mail.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _inner(session=None):
6363
email_task = EmailOperator(
6464
task_id='send_email',
6565
66-
subject='DAG 상태 보고서',
66+
subject='Workflow 상태 보고서',
6767
html_content="""<h3>Workflow Execution Complete</h3>
6868
<p><strong>Workflow ID:</strong> {{ ti.xcom_pull(task_ids='collect_failed_tasks').get('dag_id') }}</p>
6969
<p><strong>Workflow Run ID:</strong> {{ ti.xcom_pull(task_ids='collect_failed_tasks').get('dag_run_id') }}</p>

0 commit comments

Comments
 (0)