Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isse/postive slack #787

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from airflow.operators.latest_only import LatestOnlyOperator
from airflow.operators.python import PythonOperator
from utils.elastic_beanstalk import scale_elastic_beanstalk_instance
from utils.slack import slack_message_callback_no_action_required
from utils.slack import slack_message_callback_no_action_required, task_success_if_previous_failed

default_args = {
"owner": "airflow",
Expand Down Expand Up @@ -46,6 +46,7 @@
op_kwargs={"name": name, "number_of_instances": 2, "sleep_seconds": 60 * 5},
task_concurrency=2,
on_failure_callback=slack_message_callback_no_action_required,
on_success_callback=task_success_if_previous_failed,
)

elb_1 = PythonOperator(
Expand All @@ -54,6 +55,7 @@
op_kwargs={"name": name, "number_of_instances": 1},
task_concurrency=2,
on_failure_callback=slack_message_callback_no_action_required,
on_success_callback=task_success_if_previous_failed,
)

latest_only >> elb_2 >> elb_1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime, timedelta, timezone
from airflow import DAG
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed

from airflow.operators.latest_only import LatestOnlyOperator

Expand Down Expand Up @@ -63,6 +63,7 @@
},
},
on_failure_callback=slack_message_callback(forecast_ruvnl_error_message),
on_success_callback=task_success_if_previous_failed,
task_concurrency=10,
awslogs_group="/aws/ecs/forecast/forecast",
awslogs_stream_prefix="streaming/forecast-forecast",
Expand Down Expand Up @@ -96,6 +97,7 @@
},
},
on_failure_callback=slack_message_callback(forecast_ad_error_message),
on_success_callback=task_success_if_previous_failed,
task_concurrency=10,
awslogs_group="/aws/ecs/forecast/forecast-ad",
awslogs_stream_prefix="streaming/forecast-ad-forecast",
Expand Down
5 changes: 4 additions & 1 deletion terraform/modules/services/airflow/dags/india/nwp-dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator

from airflow.operators.latest_only import LatestOnlyOperator
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed
from utils.s3 import determine_latest_zarr

default_args = {
Expand Down Expand Up @@ -73,6 +73,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(nwp_ecmwf_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/consumer/nwp-consumer-ecmwf-india",
awslogs_stream_prefix="streaming/nwp-consumer-ecmwf-india-consumer",
awslogs_region="ap-south-1",
Expand All @@ -93,6 +94,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(nwp_gfs_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/consumer/nwp-consumer-gfs-india",
awslogs_stream_prefix="streaming/nwp-consumer-gfs-india-consumer",
awslogs_region="ap-south-1",
Expand All @@ -113,6 +115,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(nwp_metoffice_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/consumer/nwp-consumer-metoffice-india",
awslogs_stream_prefix="streaming/nwp-consumer-metoffice-india-consumer",
awslogs_region="ap-south-1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime, timedelta, timezone
from airflow import DAG
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator
from utils.slack import slack_message_callback_no_action_required
from utils.slack import slack_message_callback_no_action_required, task_success_if_previous_failed

from airflow.operators.latest_only import LatestOnlyOperator

Expand Down Expand Up @@ -49,6 +49,7 @@
},
},
on_failure_callback=slack_message_callback_no_action_required,
on_success_callback=task_success_if_previous_failed,
task_concurrency=10,
awslogs_group="/aws/ecs/consumer/runvl-consumer",
awslogs_stream_prefix="streaming/runvl-consumer-consumer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator

from airflow.operators.latest_only import LatestOnlyOperator
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed

default_args = {
"owner": "airflow",
Expand Down Expand Up @@ -60,6 +60,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(satellite_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/consumer/sat-consumer",
awslogs_stream_prefix="streaming/sat-consumer-consumer",
awslogs_region="ap-south-1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator

from airflow.operators.latest_only import LatestOnlyOperator
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed

default_args = {
"owner": "airflow",
Expand Down Expand Up @@ -59,6 +59,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(cloudcasting_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/forecast/cloudcasting",
awslogs_stream_prefix="streaming/cloudcasting-forecast",
awslogs_region="eu-west-1",
Expand Down
5 changes: 4 additions & 1 deletion terraform/modules/services/airflow/dags/uk/dayafter-dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from airflow import DAG
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator
import os
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed

from airflow.operators.latest_only import LatestOnlyOperator

Expand Down Expand Up @@ -56,6 +56,7 @@
},
},
on_failure_callback=slack_message_callback(day_after_error_message),
on_success_callback=task_success_if_previous_failed,
task_concurrency=10,
awslogs_group="/aws/ecs/consumer/pvlive-national-day-after",
awslogs_stream_prefix="streaming/pvlive-national-day-after-consumer",
Expand Down Expand Up @@ -86,6 +87,7 @@
},
},
on_failure_callback=slack_message_callback(day_after_error_message),
on_success_callback=task_success_if_previous_failed,
task_concurrency=10,
awslogs_group="/aws/ecs/consumer/pvlive-gsp-day-after",
awslogs_stream_prefix="streaming/pvlive-gsp-day-after-consumer",
Expand Down Expand Up @@ -117,6 +119,7 @@
},
},
on_failure_callback=slack_message_callback(day_after_error_message),
on_success_callback=task_success_if_previous_failed,
task_concurrency=10,
awslogs_group="/aws/ecs/analysis/metrics",
awslogs_stream_prefix="streaming/metrics-analysis",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from airflow.operators.latest_only import LatestOnlyOperator
from airflow.operators.python import PythonOperator
from utils.elastic_beanstalk import scale_elastic_beanstalk_instance
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed

default_args = {
"owner": "airflow",
Expand Down Expand Up @@ -53,6 +53,7 @@
op_kwargs={"name": name, "number_of_instances": 2, "sleep_seconds": 60 * 5},
task_concurrency=2,
on_failure_callback=slack_message_callback(elb_error_message),
on_success_callback=task_success_if_previous_failed,
)

elb_1 = PythonOperator(
Expand All @@ -61,6 +62,7 @@
op_kwargs={"name": name, "number_of_instances": 1},
task_concurrency=2,
on_failure_callback=slack_message_callback(elb_error_message),
on_success_callback=task_success_if_previous_failed,
)

latest_only >> elb_2 >> elb_1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime, timedelta, timezone
from airflow import DAG
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed

from airflow.operators.latest_only import LatestOnlyOperator

Expand Down Expand Up @@ -77,6 +77,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(forecast_pvnet_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/forecast/forecast_pvnet",
awslogs_stream_prefix="streaming/forecast_pvnet-forecast",
awslogs_region="eu-west-1",
Expand All @@ -97,6 +98,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(forecast_ecmwf_error_message),
on_success_callback=task_success_if_previous_failed,
trigger_rule="all_failed",
awslogs_group="/aws/ecs/forecast/forecast_pvnet_ecmwf",
awslogs_stream_prefix="streaming/forecast_pvnet_ecmwf-forecast",
Expand All @@ -118,6 +120,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(forecast_blend_error_message),
on_success_callback=task_success_if_previous_failed,
trigger_rule="one_success",
awslogs_group="/aws/ecs/blend/forecast_blend",
awslogs_stream_prefix="streaming/forecast_blend-blend",
Expand Down Expand Up @@ -154,6 +157,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(forecast_pvnet_da_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/forecast/forecast_pvnet_day_ahead",
awslogs_stream_prefix="streaming/forecast_pvnet_day_ahead-forecast",
awslogs_region="eu-west-1",
Expand All @@ -174,6 +178,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(forecast_blend_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/blend/forecast_blend",
awslogs_stream_prefix="streaming/forecast_blend-blend",
awslogs_region="eu-west-1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator

from airflow.operators.latest_only import LatestOnlyOperator
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed

default_args = {
"owner": "airflow",
Expand Down Expand Up @@ -72,6 +72,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(national_xg_forecast_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/forecast/forecast_national",
awslogs_stream_prefix="streaming/forecast_national-forecast",
awslogs_region="eu-west-1",
Expand All @@ -92,6 +93,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(forecast_blend_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/blend/forecast_blend",
awslogs_stream_prefix="streaming/forecast_blend-blend",
awslogs_region="eu-west-1",
Expand Down Expand Up @@ -127,6 +129,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(neso_forecast_consumer_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/consume/neso-forecast",
awslogs_stream_prefix="streaming/neso-forecast-consume",
awslogs_region="eu-west-1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime, timedelta, timezone
from airflow import DAG
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator
from utils.slack import slack_message_callback, slack_message_callback_no_action_required
from utils.slack import slack_message_callback, slack_message_callback_no_action_required, task_success_if_previous_failed

from airflow.operators.latest_only import LatestOnlyOperator

Expand Down Expand Up @@ -56,6 +56,7 @@
},
},
on_failure_callback=slack_message_callback(site_forecast_error_message),
on_success_callback=task_success_if_previous_failed,
task_concurrency=10,
awslogs_group="/aws/ecs/forecast/pvsite_forecast",
awslogs_stream_prefix="streaming/pvsite_forecast-forecast",
Expand Down Expand Up @@ -88,6 +89,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback_no_action_required,
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/clean/database_clean_up",
awslogs_stream_prefix="streaming/database_clean_up-clean",
awslogs_region="eu-west-1",
Expand Down
4 changes: 3 additions & 1 deletion terraform/modules/services/airflow/dags/uk/nwp-dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from airflow.operators.bash import BashOperator

from airflow.operators.latest_only import LatestOnlyOperator
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed
from utils.s3 import determine_latest_zarr

default_args = {
Expand Down Expand Up @@ -75,6 +75,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(nwp_metoffice_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/consumer/nwp-metoffice",
awslogs_stream_prefix="streaming/nwp-metoffice-consumer",
awslogs_region="eu-west-1",
Expand All @@ -95,6 +96,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(nwp_ecmwf_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/consumer/nwp-consumer-ecmwf-uk",
awslogs_stream_prefix="streaming/nwp-consumer-ecmwf-uk-consumer",
awslogs_region="eu-west-1",
Expand Down
3 changes: 2 additions & 1 deletion terraform/modules/services/airflow/dags/uk/pv-dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from airflow.decorators import dag

from airflow.operators.latest_only import LatestOnlyOperator
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed

default_args = {
"owner": "airflow",
Expand Down Expand Up @@ -59,6 +59,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(pv_consumer_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/consumer/pv",
awslogs_stream_prefix="streaming/pv-consumer",
awslogs_region="eu-west-1",
Expand Down
3 changes: 2 additions & 1 deletion terraform/modules/services/airflow/dags/uk/pvlive-dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from airflow.operators.bash import BashOperator

from airflow.operators.latest_only import LatestOnlyOperator
from utils.slack import slack_message_callback
from utils.slack import slack_message_callback, task_success_if_previous_failed

default_args = {
"owner": "airflow",
Expand Down Expand Up @@ -65,6 +65,7 @@
},
task_concurrency=10,
on_failure_callback=slack_message_callback(pvlive_error_message),
on_success_callback=task_success_if_previous_failed,
awslogs_group="/aws/ecs/consumer/pvlive",
awslogs_stream_prefix="streaming/pvlive-consumer",
awslogs_region="eu-west-1",
Expand Down
Loading