PlanktoScope / forklift

Composable, reprovisionable, decentralized management of apps & configs on Raspberry Pis and other embedded Linux systems
Apache License 2.0
7 stars 0 forks source link

host/docker: Enable restarting of a package deployment's Compose app #234

Open ethanjli opened 3 months ago

ethanjli commented 3 months ago

Currently, the only programmatic way to restart the Docker containers of a Compose app provided by a package deployment is to guess the names of the containers and pass them to the docker restart command, e.g. as in https://github.com/PlanktoScope/PlanktoScope/blob/e3dbfc7ed25da6c0cd5e3159cf6880f3e3abda38/software/node-red-dashboard/flows/adafruithat.json#L7519 . It would be simpler, cleaner, and easier to run a host restart-app or host restart-depl subcommand which automatically does all that work for us, for a given package deployment name.

An alternative approach (inspired by https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html) could be to generate a systemd unit for each package deployment with a Compose app, so that we could use systemctl restart with the name of the package deployment (but with slashes converted to underscores). This would be much more complex to implement, but it would enable us to use systemd for ordering and supervising Compose apps. I'm not sure that is a very salient benefit for the PlanktoScope project at the moment, though.