Solutions provisioner
12 min
a control panel that runs the industry solutions rather than being one of them it starts and stops each solution, connects to a litmus edge once instead of once per solution, and provisions or removes each one from its own card use it when you want to show more than one solution, or to switch between them without editing compose files every solution also runs perfectly well on its own, so this is a convenience rather than a requirement operator view port 4009 devices and tags controls eleven solutions image solgen provisioner scenarios one edge connection for the whole set enter the address and token once the panel verifies them and every solution it starts inherits them provisioning and removal as a control, not a command each card carries deploy and clean up, both with a preview that shows what would change before anything is written to the edge deployment onto the edge itself the panel can ask the connected edge to pull and run a solution through the edge's own applications api, using the registry credentials the device already holds requirements everything in industry solutions # , plus one thing specific to the panel it needs access to the host docker socket, because it starts each solution as a sibling container so their ports land on the host that is a real grant of authority to a container it is how a control panel of this kind has to work, and it is worth knowing before you run it deploy the solution ships two ways use the registry if the host can reach google artifact registry, and the downloaded archive if it cannot option 1 pull from the registry requires a read only registry credential, supplied by litmus separately cat key json | docker login u json key password stdin https //us docker pkg dev save this as docker compose yml services provisioner image us docker pkg dev/litmus customer facing/litmus solutions/solgen provisioner 0 3 0 container name solgen provisioner restart unless stopped ports \ target 4009 published 4009 protocol tcp environment probe host host docker internal runner docker log level info edge url "${edge url }" edge api token "${edge api token }" edge verify tls "${edge verify tls 0}" solgen registry solgen image tag volumes \ /var/run/docker sock /var/run/docker sock \ provisioner state /data extra hosts \ "host docker internal\ host gateway" volumes provisioner state {} docker compose up d then open http //localhost 4009 nothing needs filling in to start it the panel asks for the litmus edge address and a token, verifies them, and stores them itself the two edge values above only let you skip that step option 2 load the downloaded archive download solgen provisioner 0 3 0 amd64 tar gz from the solution's page on portal litmus io the archive is the container image, not a source bundle, and needs no registry access docker load i solgen provisioner 0 3 0 amd64 tar gz docker load prints the image it added loaded image us docker pkg dev/litmus customer facing/litmus solutions/solgen provisioner 0 3 0 that reference is the one the compose file above already names, so the same docker compose yml and env now work offline with no docker login docker compose up d to run it without compose, the three mounts and flags below are not optional the panel starts each solution as a sibling container on the host's own daemon, so it needs the socket; it keeps the edge connection and the logs in /data , so it needs the volume; and it reaches each solution on the host's published ports, so it needs a route to the host docker run d \\ \ name solgen provisioner \\ \ restart unless stopped \\ p 4009 4009 \\ \ add host host docker internal\ host gateway \\ e probe host=host docker internal \\ e runner=docker \\ e log level=info \\ v /var/run/docker sock /var/run/docker sock \\ v provisioner state /data \\ us docker pkg dev/litmus customer facing/litmus solutions/solgen provisioner 0 3 0 flag without it v /var/run/docker sock the panel cannot start, stop or pull anything, and every card reads missing v provisioner state /data the edge connection and every log are lost on each restart add host and probe host the panel probes itself, so every solution it starts reads "no answer on /health" while it is serving edge url and edge api token are optional pass them to skip the connect step, or leave them out and connect from the page, which stores them in /data/ env sim host does not apply to the panel; each solution derives its own solgen registry and solgen image tag are optional and only needed to point at a different registry or tag leave them out rather than setting them empty an empty solgen registry means "use local image names" and makes every card resolve to an image no host can pull configuration variable default what it does edge url unset litmus edge to connect to optional; the panel can ask instead edge api token unset token for that edge edge verify tls 0 1 checks the edge's certificate probe host host docker internal where the panel looks for the solutions it started from inside a container, 127 0 0 1 is the container itself, so this must name the host runner auto docker or source which way to start solutions solgen registry the published repository where to pull solution images from solgen image tag 0 3 0 which tag to run solgen registry and solgen image tag are written without a value on purpose compose leaves a variable absent when it has no value, which lets the default apply giving them an empty string instead would mean something different and the panel would look for images that do not exist operator view the page is three parts litmus edge , at the top what you are connected to, whether it is answering, and how recently that was checked solutions , a card each a switch to start and stop it, what it puts on the edge, the scenarios it demonstrates, a link to its operator view, and deploy and clean up controls with previews team solutions , below the published litmus solutions catalogue joined against the container registries this machine can read, so what is published and what you could actually run here are one view rather than two solutions this machine has no credential for are greyed out rather than shown as errors limitations a solution that is more than one container cannot be started as a single container, and the panel says so on the card rather than offering a button that cannot work rotating equipment reliability # is the one this affects it needs a message broker alongside it, so it is deployed with its own compose file apply and remove docker compose down solutions the panel started keep running, deliberately, so restarting the panel does not interrupt a demonstration stop them from their cards first if you want them to go too support support\@litmus io mailto\ support\@litmus io