Skip to content

Commit

Permalink
final deployment stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mdkrol committed Nov 7, 2024
1 parent 515a11a commit e4c43d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/flows.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, timedelta

from prefect import flow, get_run_logger
from tasks import get_precipitation, post_timeseries
Expand All @@ -7,9 +7,6 @@
uuid_gpm_ts = "fb384ac4-c8e8-452e-83d3-30f23c522577"
uuid_gpm_rast = "f23e174e-0636-45f1-86fd-e543a7aa49ac"


start = datetime(2024, 11, 1, 0, 0, 0)
end = datetime(2024, 11, 6, 0, 0, 0)
coordinates = (74.590958, 42.871773, 0.0)


Expand All @@ -25,6 +22,9 @@ def kghub_example_task_flow():
logger = get_run_logger()

logger.info("Downloading precipitation data from Dutch Lizard")

end = datetime.now().replace(microsecond=0, second=0, minute=0)
start = end - timedelta(days=3)
df = get_precipitation(uuid_gpm_rast, start, end, coordinates)

logger.info("Data downloaded, uploading to KGhub")
Expand Down
2 changes: 1 addition & 1 deletion src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if __name__ == "__main__":
kghub_example_task_deployment = kghub_example_task_flow.to_deployment(
name="GPM data",
# interval=60, # alternative: cron="5 4 * * *". Check crontab.guru to create the correct schedule expression
cron="10 4 * * *",
description="Code found at: https://github.com/nens/prefect-kghub-example-task", # Place this in EACH deployment, so that it its clear which repo serves which deployment
tags=["KGhub", "example"],
)
Expand Down

0 comments on commit e4c43d1

Please sign in to comment.