WebThingsIO / gateway

WebThings Gateway
http://webthings.io/gateway
Mozilla Public License 2.0
2.61k stars 333 forks source link

Epic: Production quality base OS #2801

Open benfrancis opened 3 years ago

benfrancis commented 3 years ago

Currently the default WebThings Gateway software image is based on Raspbian/Raspberry Pi OS.

This has served us very well up until now, but it has some limitations:

  1. OTA updates - Whilst the gateway application receives automatic over-the-air updates, the underlying Raspberry Pi OS does not. This means that unless users manually update the OS on their gateway via the command line, they stay on whatever version of the OS was current when they first flashed the software image. This becomes a problem when new versions of the gateway application start to rely on features of the latest version of the OS. Upgrades to old versions may not be possible.
  2. Security - No updates means no security patches to the underlying OS, which may expose security vulnerabilities.
  3. Maintenance - Maintaining a fork of Raspberry Pi OS as we essentially do today is a lot of work. Without Mozilla's resources going forward we may not be able to continue to do this. It would be better if we could just maintain the gateway application and let someone else maintain the OS.
  4. Software footprint - Raspberry Pi OS includes a lot of software packages which we don't actually use and has quite high resource requirements for an IoT gateway.
  5. Hardware compatibility - Raspberry Pi OS is designed specifically for the Raspberry Pi single board computer and can not run on production consumer or enterprise hardware.

I'd therefore like to explore an alternative base OS for WebThings Gateway which:

  1. Supports automatic OTA updates
  2. Has better security through automatic software updates and containerisation
  3. Is ideally maintained by someone else, so we can focus on the gateway application
  4. Has a smaller footprint, reducing minimum system requirements
  5. Supports a wider range of hardware for consumer and enterprise use cases

It's important that we continue to support Raspberry Pi as a hardware target for existing and new hobbyist/educational users, who form the backbone of our community. It's also likely we may need to support the Raspberry Pi OS based image in some form for an extended period of time, as upgrading to a new base OS will probably require a manual re-flash.

Some potential candidates I am aware of are:

  1. Balena OS - runs docker containers¹
  2. Ubuntu Core - runs snaps²
  3. Fedora IoT - runs OCI images

If we do choose a containerised OS like one of the above, we may also need to re-consider the architecture of the add-ons system. It's likely that some existing add-ons would break if the gateway application was containerised, so we may want to consider making each add-on its own container for example.

Ideas welcome.


Footnotes:

  1. We have an existing docker image of the gateway, which makes Balena OS an attractive target, but unfortunately the pricing model of Balena Cloud is not a good fit for our application.
  2. We have a work-in-progress snap package of the gateway which could run on Ubuntu Core, but some add-ons may break as noted above.