01kaayqrms7nw0kwp6h37hw45k.py committed by groupuser
This commit is contained in:
parent
fa56270f31
commit
fef17c0a01
69
dags/groupuser/01kaayqrms7nw0kwp6h37hw45k.py
Normal file
69
dags/groupuser/01kaayqrms7nw0kwp6h37hw45k.py
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
# ----------------------------------------------
|
||||||
|
# Cheetah Pipeline Template
|
||||||
|
# ----------------------------------------------
|
||||||
|
|
||||||
|
# USER_EDIT_IMPORT_START
|
||||||
|
|
||||||
|
# 필요한 라이브러리 import 영역
|
||||||
|
# 예)
|
||||||
|
# from airflow.operators.bash import BashOperator
|
||||||
|
# from airflow.operators.python import PythonOperator
|
||||||
|
from airflow.operators.bash import BashOperator
|
||||||
|
from airflow.operators.python import PythonOperator
|
||||||
|
# USER_EDIT_IMPORT_END
|
||||||
|
|
||||||
|
|
||||||
|
from decorators.cheetah_pipeline_decorator import cheetah_pipeline
|
||||||
|
from airflow import DAG
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
@cheetah_pipeline()
|
||||||
|
def dag_template():
|
||||||
|
|
||||||
|
# ------------------------------------------------
|
||||||
|
# DAG 기본 설정 (수정 가능)
|
||||||
|
# ------------------------------------------------
|
||||||
|
|
||||||
|
# USER_EDIT_DAG_META_START
|
||||||
|
|
||||||
|
start_date = datetime(2024, 1, 1)
|
||||||
|
schedule = None
|
||||||
|
catchup = False
|
||||||
|
tags = []
|
||||||
|
|
||||||
|
# USER_EDIT_DAG_META_END
|
||||||
|
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
dag_id='ca_second_paused',
|
||||||
|
start_date=start_date,
|
||||||
|
schedule=schedule,
|
||||||
|
catchup=catchup,
|
||||||
|
tags=tags,
|
||||||
|
is_paused_upon_creation=False
|
||||||
|
) as dag:
|
||||||
|
|
||||||
|
# ------------------------------------------------
|
||||||
|
# TASK 작성 영역 (수정 가능)
|
||||||
|
# ------------------------------------------------
|
||||||
|
|
||||||
|
# USER_EDIT_TASK_START
|
||||||
|
def generate_json(**context):
|
||||||
|
with open("result.json", "w") as f:
|
||||||
|
f.write('{"model": "v1", "f1": 0.95}')
|
||||||
|
t1 = BashOperator(
|
||||||
|
task_id="task1",
|
||||||
|
bash_command='echo "Loss=0.12, Accuracy=0.98" > metrics.txt'
|
||||||
|
)
|
||||||
|
t2 = PythonOperator(
|
||||||
|
task_id="task2",
|
||||||
|
python_callable=generate_json
|
||||||
|
)
|
||||||
|
t1 >> t2
|
||||||
|
|
||||||
|
|
||||||
|
# USER_EDIT_TASK_END
|
||||||
|
|
||||||
|
return dag
|
||||||
|
|
||||||
|
dag = dag_template()
|
||||||
Loading…
Reference in New Issue
Block a user