Skip to content

dev/release: Release a single build artifact which can be used for both the Adafruit HAT and PlanktoScope HAT versions of the hardware #182

@ethanjli

Description

@ethanjli

Motivation

For the v2.3 software release, two separate SD card images were provided - one to provide hardware support for the Adafruit HAT, and the other to provide hardware support for the PlanktoScope HAT. As a result, we had to provide special guidance to users about which SD card image to use. Additionally, the v2.3 version of the Python backend maintained Adafruit HAT support on the main branch of this repo and PlanktoScope HAT support on the pscopehat branch of this repo, which meant the process for building the SD card image for each HAT was slightly different (i.e. the repo had to be downloaded to the SD card from a different URL). This adds complexity to the process for building and releasing SD card images. In particular, after #416 (because the GitHub Actions workflow for building OS images involves a QEMU VM step which occasionally freezes for no good reason), building many SD card images makes our CI workflows flaky.

The Node-RED dashboard already has a menu to select which HAT to use - so we could just use that as the one and only way to select which HAT is used, and simplify away everything else related to which HAT the software uses. However, currently there are actually two different Node-RED dashboards (one version for the Adafruit HAT, and the other for the pscopehat), so until we can merge them back into the same dashboard (which would be a big project in and of itself), we should just have either an external UI to switch the Node-RED dashboard or an internal UI in the Node-RED dashboard which switches the flows.json file and restarts the Node-RED server.

Goals

  • Make a single SD card image which can run the Python backend and Node-RED dashboard for either HAT.
  • Make an easy way to set and change the supported hardware version.

Steps

  • Move the Adafruit HAT version of the Python backend to a separate repository from the SD card setup scripts
  • Split the segmenter from the hardware controller
  • Move the pscopehat HAT version of the Python backend from the PlanktoScope repository's pscopehat branch into a separate subdirectory of the device-backend repository
  • Provide a user-friendly way to switch the hardware version (e.g. in forklift or in a first-boot wizard and admin panel)
  • Update the software setup documentation to provide instructions for choosing the hardware version as part of first-time software setup

Unresolved Questions

  • Do we need to drop support for the waveshare HAT? Yes, we need to drop support
  • How might we unify the codebases of the two Python backends for the two HATs? (this will be saved for future PRs)
  • How will we configure which Python backend runs when we package the backend in Forklift? Will we have two different packages, or a single package which receives configuration from Node-RED in some other way? (this will be addressed in a future PR to containerize the Python backends; ideally the adafruithat version's Forklift package or Forklift feature flag would be mutually exclusive with the Forklift package or Forklift feature flag for the pscopehat version of the Python backend, or it would be toggled via a config file rather than via Forklift)
  • What work is needed for us to be able to unify the Node-RED dashboards?

Implementation History

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions