Skip to content

Commit

Permalink
Fix schedule, add vars in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
amishas157 committed Nov 12, 2024
1 parent 6a645fb commit 1ece005
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
8 changes: 4 additions & 4 deletions airflow_variables_dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,29 +288,29 @@
"dbt": {
"requests": {
"cpu": "1",
"ephemeral-storage": "500Mi",
"ephemeral-storage": "1Gi",
"memory": "600Mi"
}
},
"default": {
"requests": {
"cpu": "0.3",
"ephemeral-storage": "500Mi",
"ephemeral-storage": "1Gi",
"memory": "600Mi"
}
},
"stellaretl": {
"requests": {
"cpu": "0.3",
"ephemeral-storage": "500Mi",
"ephemeral-storage": "1Gi",
"memory": "600Mi"
}
},
"elementaryreport": {
"requests": {
"cpu": "1",
"ephemeral_storage": "2Gi",
"memory": "8Gi"
"memory": "4Gi"
}
}
},
Expand Down
8 changes: 8 additions & 0 deletions airflow_variables_prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@
"ephemeral-storage": "1Gi",
"memory": "1Gi"
}
},
"elementaryreport": {
"requests": {
"cpu": "1",
"ephemeral_storage": "2Gi",
"memory": "4Gi"
}
}
},
"sandbox_dataset": "crypto_stellar_internal_sandbox",
Expand Down Expand Up @@ -344,6 +351,7 @@
"current_state": 1200,
"default": 60,
"elementary_dbt_data_quality": 2100,
"elementary_generate_report": 1200,
"enriched_history_operations": 1800,
"enriched_history_operations_with_exclude": 1800,
"fee_stats": 360,
Expand Down
2 changes: 1 addition & 1 deletion dags/dbt_data_quality_alerts_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
) as dag:

# Trigger elementary
elementary_alerts = elementary_task(dag, "dbt_data_quality", resource_cfg="dbt")
elementary_alerts = elementary_task(dag, "dbt_data_quality", "monitor", resource_cfg="dbt")

elementary_alerts
8 changes: 4 additions & 4 deletions dags/elementary_report_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
with DAG(
"elementary_report",
default_args=get_default_dag_args(),
start_date=datetime(2024, 6, 25, 0, 0),
start_date=datetime(2024, 11, 11, 0, 0),
description="This DAG creates elementary report and send it to slack",
schedule="*/60 * * * *", # Runs every 60 minutes
schedule="0 0 * * MON", # Runs every Monday
user_defined_filters={
"container_resources": lambda s: k8s.V1ResourceRequirements(requests=s),
},
Expand All @@ -30,9 +30,9 @@
elementary_alerts = elementary_task(
dag,
"generate_report",
"send-report",
resource_cfg="elementaryreport",
command="send-report",
cmd_args=["--days-back", "7", "--profiles-dir", ".", "--executions-limit", "120"],
cmd_args=["--days-back", "7", "--profiles-dir", ".", "--executions-limit", "120", "--slack-file-name", f"elementary_report_{datetime.today().date()}.html"],
)

elementary_alerts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def access_secret(secret_name, namespace):


def elementary_task(
dag, task_name, cmd_args=[], resource_cfg="default", command="monitor"
dag, task_name, command, cmd_args=[], resource_cfg="default"
):
namespace = conf.get("kubernetes", "NAMESPACE")

Expand Down
2 changes: 1 addition & 1 deletion example_airflow_worker_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ spec:
name: gcs-syncd
resources:
limits:
memory: 2400Mi
memory: 600Mi
requests:
cpu: 10m
memory: 50Mi
Expand Down

0 comments on commit 1ece005

Please sign in to comment.