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

feat(cameras): add a route to update the last known image of a camera #371

Merged
merged 12 commits into from
Sep 22, 2024

Conversation

frgfm
Copy link
Member

@frgfm frgfm commented Sep 22, 2024

This PR introduces the following modifications:

  • add a "last_image" column in the Camera table
  • every time a camera uses it, it uploads an image, stores it in the bucket (and delete the previous one) + update the DB entry
  • update the client & corresponding tests
  • update the UML & made it live

Here is the updated UML
pyronear_uml
(live link: https://dbdiagram.io/d/Pyronear-UML-665a15d0b65d933879357b58)

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

Attention: Patch coverage is 90.19608% with 5 lines in your changes missing coverage. Please review.

Project coverage is 86.39%. Comparing base (5ed718e) to head (e9d018a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/app/services/storage.py 87.50% 3 Missing ⚠️
client/pyroclient/client.py 75.00% 1 Missing ⚠️
src/app/api/api_v1/endpoints/cameras.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #371      +/-   ##
==========================================
+ Coverage   86.19%   86.39%   +0.20%     
==========================================
  Files          34       34              
  Lines         920      941      +21     
==========================================
+ Hits          793      813      +20     
- Misses        127      128       +1     
Flag Coverage Δ
backend 85.99% <91.48%> (+0.19%) ⬆️
client 92.06% <75.00%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@frgfm
Copy link
Member Author

frgfm commented Sep 22, 2024

Worth noting: @MateoLostanlen we'll have to update the engine. We now have 2 potential high frequency interactions: heartbeat & update image. I suggest reversing the equations to set the adequate frequency (& decorrelate it from the prediction frequency on raspberry pi):

  • last image: I'd argue we don't need more often than every 10mins
  • heartbeat: this is our way to detect if we have "downtime" on a station. Probably every minute ?

What do you think?

@frgfm frgfm merged commit 8116fda into main Sep 22, 2024
28 of 29 checks passed
@frgfm frgfm deleted the frgfm/last-image branch September 22, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant