Skip to content

Commit

Permalink
fix for satellite
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Feb 14, 2025
1 parent 71c26f2 commit a9251eb
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions terraform/modules/services/airflow/dags/uk/satellite-dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,22 @@
)

file_5min = f"s3://nowcasting-sat-{env}/data/latest/latest.zarr.zip"
command_5min = (
file_15min = f"s3://nowcasting-sat-{env}/data/latest/latest_15.zarr.zip"
command_5min_and_15min = (
f'curl -X GET '
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_5min}"'
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,
bash_command=command_5min_and_15min,
)

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_5min >> satellite_update_15min

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

0 comments on commit a9251eb

Please sign in to comment.