Skip to content

Commit

Permalink
fix for satellite data
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Feb 19, 2025
1 parent c1c53c8 commit 94a1c70
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions terraform/modules/services/airflow/dags/uk/satellite-dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,20 @@
)

file_5min = f"s3://nowcasting-sat-{env}/data/latest/latest.zarr.zip"
file_15min = f"s3://nowcasting-sat-{env}/data/latest/latest_15.zarr.zip"
command_5min = (
f'curl -X GET '
f'"{url}/v0/solar/GB/update_last_data?component=satellite&file={file_5min}"'
f'"{url}/v0/solar/GB/update_last_data?component=satellite&file={file_5min}"; '
f'curl -X GET '
f'"{url}/v0/solar/GB/update_last_data?component=satellite&file={file_15min}"'
)

satellite_update_5min = BashOperator(
task_id=f"{region}-satellite-update-5min",
bash_command=command_5min,
)

file_15min = f"s3://nowcasting-sat-{env}/data/latest/latest_15.zarr.zip"
command_15min = (
f'curl -X GET '
f'"{url}/v0/solar/GB/update_last_data?component=satellite&file={file_15min}"'
)

satellite_update_15min = BashOperator(
task_id=f"{region}-satellite-update-15min",
bash_command=command_15min,
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

with DAG(
f"{region}-national-satellite-cleanup",
Expand Down

0 comments on commit 94a1c70

Please sign in to comment.