Skip to content

Commit

Permalink
no err for 5min fails,
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanbhosale authored Feb 12, 2025
1 parent 01ade63 commit 61cc2c8
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions terraform/modules/services/airflow/dags/uk/satellite-dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,24 @@

satellite_error_message = (
"⚠️ The task {{ ti.task_id }} failed. "
"But its ok, the forecast will automatically move over to a PVNET-ECMWF, "
"which doesnt need satellite data. "
"But it's OK, the forecast will automatically move over to PVNET-ECMWF, "
"which doesn't need satellite data. "
"EUMETSAT status links are <https://uns.eumetsat.int/uns/|here> "
"and <https://masif.eumetsat.int/ossi/webpages/level3.html?ossi_level3_filename=seviri_rss_hr.html&ossi_level2_filename=seviri_rss.html|here>. "
"No out of office hours support is required, but please log in an incident log."
"No out-of-hours support is required, but please log in an incident log."
)

satellite_clean_up_error_message = (
"⚠️ The task {{ ti.task_id }} failed. "
"But its ok, this is only used for cleaning up the EUMETSAT customisation, "
"but the satellite consumer should also do this. "
"No out of office hours support is required."
satellite_both_files_missing_error_message = (
":warning: Tried to update the latest Satellite data, but could not find "
"the 5-min or the 15-min satellite files."
)

# Tasks can still be defined in terraform, or defined here
satellite_clean_up_error_message = (
"⚠️ The task {{ ti.task_id }} failed. "
"But it's OK, this is only used for cleaning up the EUMETSAT customisation, "
"and the satellite consumer should also do this. "
"No out-of-hours support is required."
)

region = "uk"

Expand Down Expand Up @@ -91,7 +94,7 @@
satellite_update_5min = BashOperator(
task_id=f"{region}-satellite-update-5min",
bash_command=command_5min,
on_failure_callback=slack_message_callback(satellite_error_message),
on_failure_callback=None,
)

file_15min = f"s3://nowcasting-sat-{env}/data/latest/latest_15.zarr.zip"
Expand All @@ -103,11 +106,11 @@
satellite_update_15min = BashOperator(
task_id=f"{region}-satellite-update-15min",
bash_command=command_15min,
on_failure_callback=slack_message_callback(satellite_error_message),
trigger_rule="all_failed",
on_failure_callback=slack_message_callback(satellite_both_files_missing_error_message),
)

latest_only >> sat_consumer >> [satellite_update_5min, satellite_update_15min]

latest_only >> sat_consumer >> satellite_update_5min >> satellite_update_15min

with DAG(
f"{region}-national-satellite-cleanup",
Expand Down Expand Up @@ -145,4 +148,3 @@
latest_only_cleanup >> sat_consumer_cleanup



0 comments on commit 61cc2c8

Please sign in to comment.