-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dag to create elementary report (#506)
* Add dag to create elementary report * lint update update * Use last invocation update * send args * concat * reduce days * update * update dbt image * get all invokes * update dbt image * udpate image * increase task sla threshold * limited data fetch * increase memory * Specific config for elementary report * Increase ephemeral storage * report for last 7 days * report for last 7 days * upgrade elementary * limit days * increase ephemeral storage * decrease execution limit * Actually use ephemeral storage * Actually use ephemeral storage * Actually use ephemeral storage * bring memory down back * Fix schedule, add vars in prod * lint * update dbt image and remove unnecessary vars
- Loading branch information
1 parent
b29125b
commit 48c8e63
Showing
5 changed files
with
82 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from datetime import datetime | ||
|
||
from airflow import DAG | ||
from airflow.operators.empty import EmptyOperator | ||
from kubernetes.client import models as k8s | ||
from stellar_etl_airflow.build_dbt_task import dbt_task | ||
from stellar_etl_airflow.build_elementary_slack_alert_task import elementary_task | ||
from stellar_etl_airflow.default import ( | ||
alert_sla_miss, | ||
get_default_dag_args, | ||
init_sentry, | ||
) | ||
|
||
init_sentry() | ||
|
||
with DAG( | ||
"elementary_report", | ||
default_args=get_default_dag_args(), | ||
start_date=datetime(2024, 11, 11, 0, 0), | ||
description="This DAG creates elementary report and send it to slack", | ||
schedule="0 3 * * MON", # Runs every Monday | ||
user_defined_filters={ | ||
"container_resources": lambda s: k8s.V1ResourceRequirements(requests=s), | ||
}, | ||
max_active_runs=1, | ||
catchup=False, | ||
) as dag: | ||
|
||
# Trigger elementary | ||
elementary_alerts = elementary_task( | ||
dag, | ||
"generate_report", | ||
"send-report", | ||
resource_cfg="elementaryreport", | ||
cmd_args=[ | ||
"--days-back", | ||
"7", | ||
"--profiles-dir", | ||
".", | ||
"--executions-limit", | ||
"120", | ||
"--slack-file-name", | ||
f"elementary_report_{datetime.today().date()}.html", | ||
], | ||
) | ||
|
||
elementary_alerts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters