Make the webapp a service that starts on its own#12
Make the webapp a service that starts on its own#12mgalardini wants to merge 2 commits intoHarrisonSteel:masterfrom
Conversation
These changes make the ChiBio webserver start in the background as a service after the board has been turned on The `chibio.service` must be placed in `/lib/systemd/` and enabled with the command `systemctl enable chibio.service` The service can be stopped/started using `systemctl`: * `systemctl start chibio.service` * `systemctl stop chibio.service` * `systemctl status chibio.service` Messages that used to be printed to stdout are now fed into `systemd` and can be read with timestamps using `journalctl`: * `journalctl -u chibio.service` * To follow new messages: `journalctl -f -u chibio.service` Also added `--timeout 0` to `gunicorn` as our board was sometimes shutting down the webserver mid-experiment because of a timeout; gunicorn by default has a 30 seconds timeout, with this change there is no limit
|
Hi Marco, this looks very interesting! I willl have to go through to understand it all in detail. If you are always running the web server - I suppose it now requires the user to have all the reactors plugged in/powered at Beaglebone start-up in order to be detected, though they could always restart the service if not. Have you found this is particularly common for your lab/use cases? |
|
The Gunicorn timeout is an interesting one, were you finding here that it was taking too long to upload the SysData into the web server, hence leading to the crash? Previously before we were downsampling the data stored there we had this issue over very long experiments whereby the quantity of data being loaded into the web interfaced increased with the length of experiment and eventually could overwhelm the server timeout... |
|
Hi sorry for the slow reply; I think the chibio web interface has a button to refresh the device list right? At any rate the person using the chibio usually turns everything on when the board is turned on. For the gunicon problem, I'm not entirely sure what was causing it, but we suspect that it was perhaps a rare problem encountered because we had a browser open to the chibio interface during the whole duration of the experiment. If for any reason the webpage fails to reload data (or rather if it tool longer than 30 seconds to do so), then the whole chibio system would come down. We now have this change in place and for good measure we only open the web interface when needed. Hope this clarifies things a bit! |
Hi, thanks for putting together this system! Here's a proposed change to have the webserver and "operating system" turn on at startup, and have the various messages show up in a log using
systemd. Hope this can be useful! Below the commit message with details.These changes make the ChiBio webserver start in the background as a service after the board has been turned on
The
chibio.servicemust be placed in/lib/systemd/and enabled with the commandsystemctl enable chibio.serviceThe service can be stopped/started using
systemctl:systemctl start chibio.servicesystemctl stop chibio.servicesystemctl status chibio.serviceMessages that used to be printed to stdout are now fed into
systemdand can be read with timestamps usingjournalctl:journalctl -u chibio.servicejournalctl -f -u chibio.serviceAlso added
--timeout 0togunicornas our board was sometimes shutting down the webserver mid-experiment because of a timeout; gunicorn by default has a 30 seconds timeout, with this change there is no limit