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

API: Input Data Last Updated Field incorrect #337

Closed
zakwatts opened this issue May 14, 2024 · 10 comments
Closed

API: Input Data Last Updated Field incorrect #337

zakwatts opened this issue May 14, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@zakwatts
Copy link

When the "include_metadata" tag is true the following information returns:

"inputDataLastUpdated": { "gsp": "2023-10-24T16:22:44.812068Z", "nwp": "2023-08-29T14:22:49.582920Z", "pv": "2023-10-24T16:18:29.611871Z", "satellite": "2023-10-24T16:06:39.083938Z" } }

However these dates look very outdated to today 2024-05-15. Possibly a bug.

@zakwatts zakwatts added the bug Something isn't working label May 14, 2024
@zakwatts
Copy link
Author

@peterdudfield Do you think this is a bug?

@peterdudfield
Copy link
Collaborator

yea this is a bug. How important is it for the client?

@zakwatts
Copy link
Author

No one has mentioned it, I just came across when testing the API.

@peterdudfield
Copy link
Collaborator

ok, thanks @zakwatts

@peterdudfield
Copy link
Collaborator

So just checked,
It looks like, GSP and satellite is wokring, but NWP isnt. This is becasue of the new nwp-consumer. I dont think the right thing it to add it to the nwp-consumer, as that is nice and stand alone.

Here's some options

  1. Add to new nwp-consumer ( not want to do this)
  2. Add to airflow, something that hits the database, and updates the input data last updated. This is neat and in ariflow, but has the disadvanate, we dont know if the data consumer receieved any new data, or just ran correctly
  3. Add endpoint to api, that goes and checks when the GSP, Satellite and NWP was last updated. Need to hide this and maybe add auth0 with scopes. Airflow can then call this after running the data consumer

@peterdudfield
Copy link
Collaborator

There's another fix thats needed. Some ends point load a latest forecast. These forecast get updated everytime a forecast gets saved. We need to update the input_data_lates_updated as well in here

@peterdudfield
Copy link
Collaborator

Discuss with @devsjc and @braddf Idea we think we are going to go with is

  1. Add enpoint in API that goes and check when the NWP data was last made. Then save to InputDataLastUdpated in the database.
  2. Add auth to this route, scope: write: data_updated and create a auth0 role called admin that is allowed to call this endpoint
  3. Add dag in airflow that is triggered at the end of the nwp consuer, that hits this new endpoint in the API

@peterdudfield
Copy link
Collaborator

peterdudfield commented May 30, 2024

This is fixed with

  • blend 0.0.29 (done on prod)
  • API 1.5.52 (done on prod)
  • ocf-infrastructure hash of 72ba38d. - Need to also make sure API has access to nwp and satellite bucket (done on prod)
  • GSP Consumer 1.1.14
  • Satip 2.11.62

@zakwatts
Copy link
Author

Nice, good work!

@peterdudfield
Copy link
Collaborator

Had to role back openclimatefix/Satip#273, but this is not a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants