-
-
Notifications
You must be signed in to change notification settings - Fork 5
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: Added an alert cache mechanism to avoid loosing information without internet #61
Conversation
Codecov Report
@@ Coverage Diff @@
## master #61 +/- ##
==========================================
- Coverage 63.46% 61.08% -2.38%
==========================================
Files 10 10
Lines 208 257 +49
==========================================
+ Hits 132 157 +25
- Misses 76 100 +24
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @frgfm , thanks a lot for this PR. It looks good to me and I don't have more information about the binding of the volumes. I guess it all needs to be checked manually, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi thanks a lot for this PR !
If I understand correctly, your concern about the reboot is the ensure that the data
volume remains persistent after a reboot of the main rpi which rebuilds docker ?
A dump of cache outside of docker could then be a solution ?
Another question here, could we estimate on avg how many 'lost connection time' we can recover having the 100 frames max storage in cache within a full alert time-lapse ?
Correct
Yes, that's why I put this in
Rather easy yes : But this would be the very worst case scenario (all devices won't be pointing towards the same location, and hopefully we won't have lost connection for all of those) :) |
Isn't |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, thanks a lot for this PR :)
So far, it looks good to me. I would like to set up test devices to approve, if I can find the time.
About volume binding, as far as I understand, the volume source is ./data so this is a path, hence implicitly the volume is of type "bind" . (Would be a volume either if there is no source or a source as a named volume).
So, seems OK for our use case 👍
(but @Akilditu, to me, if I properly understand the doc If you don’t explicitly create it, a volume is created the first time it is mounted into a container. When that container stops or is removed, the volume still exists. Multiple containers can mount the same volume simultaneously, either read-write or read-only. Volumes are only removed when you explicitly remove them.
Hence, it should be OK with a volume as well )
So I've checked on my own, having a docker with a volume bind, creating a file in it, and then rebuild the image and check whether the file is still there and it works! With this docker-compose:
I run it the first time to create the file in the volume: ➜ docker_check docker-compose up --build
Recreating docker_check_web_1 ... done
Attaching to docker_check_web_1
web_1 | 1
web_1 | tmp.txt
docker_check_web_1 exited with code 0 then a second time to see if it can access the created file:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the check FG ! So, let's merge 😃
This PR introduces the following modifications:
One point to pay attention at: this can be checked in another PR but I prefer to point it out now. This PR handles the process as if the disk is persistent through reboot (if I save a file in
my_path.jpg
, then reboot, I'll find it in the same place). However, since we are using Docker and I'm not too sure about whether we bind volumes in production, this might be tricky. Anyone got more information about this? (I set the back path todata/
which seems to be the volume bind according to https://github.com/pyronear/pyro-engine/blob/master/server/docker-compose.yml#L14)Any feedback is welcome!