overthesun / simoc-sam

Back-end system to support SIMOC Live air quality monitor sensor array as used at the SAM Mars habitat analog.
https://samb2.space/
2 stars 1 forks source link

Support and automate different (network) configurations #98

Open ezio-melotti opened 7 months ago

ezio-melotti commented 7 months ago

We currently want to support different possible network configurations:

We should automate the setup of these configurations, and also track all the necessary changes in order to implement a tear-down automation too. The idea is to use simoc-sam.py to automatically create/update all the necessary config files to set up any of these 3 setups, and also have commands to undo these changes.

This will allow to have a single base image and a single copy of the repo, and a simoc-sam.py command that we can use to switch configurations. In order to do this, it's probably easier to install all the dependencies in the base image, so that the configuration can be changed even without internet access.

In addition, we have another configuration that is not strictly network-related, and that theoretically can be used with all the 3 modes, i.e. setting up Nginx to serve the SIMOC web frontend.

A couple of setup/teardown commands for simoc-sam.py should be added to enable/disable this configuration. For this we could also install nginx, clone the simoc-web repo, and configure the simoc_live site and then just use the simoc-sam.py commands to start/stop the nginx service, since this configuration shouldn't interfere with anything else (unlike the different networking configurations that conflict with each other). If in the future we add some other configuration that uses nginx, we can just update the simoc-sam.py commands to create and destroy the simoc_live symlink in sites-enabled while keeping all the different configurations in sites-available.