infra_wiki

Tidbyt apps

Six Pixlet apps, rackstat, tempest, wishin, callerid, burnsafe and flameboss, that the Tronbyt server on folly renders for the lab's Tidbyt pixel displays.

live

The Tidbyt apps are six Pixlet apps, rackstat, tempest, wishin, callerid, burnsafe and flameboss, that draw screens on the lab's Tidbyt displays for the owner. A Tidbyt is an LED display of 64 by 32 pixels, and Pixlet renders its Starlark apps. Tronbyt, a self-hosted Tidbyt server on the folly Kubernetes cluster, renders the installed apps and serves the images to each display.

Apps#

AppShowsData
apps/rackstat/Lab health: firing alerts, nodes, Flux sync, network probes, the office phone's lines and trunks, and 24 hours of cluster CPU. Problem screens show first, and an ON AIR page jumps the rotation while a call is live.The rackstat aggregator, a Go service in the same directory
apps/tempest/One Tempest weather station: current conditions, a 3-day forecast and a 24-hour temperature graphWeatherFlow's forecast API, with a station ID and token set in Tronbyt
apps/wishin/The gift, user and claimed counts of wishin.apphttps://www.wishin.app/api/stats
apps/callerid/An incoming call: a name or number, a SPAM screen, or a troll screenA name/number/verdict config passed in by whatever pushes to it
apps/burnsafe/Today's Nova Scotia fire restriction for two counties, Colchester for folly and Halifax for offsite by defaultThe county table on https://novascotia.ca/burnsafe/, which has no API
apps/flameboss/A barbecue cook: the pit over a fire that follows the blower, each meat probe's progress to pull, and a graph of the cook./api/cook on the Flame Boss exporter, a Go service in the same directory

apps/wishin/ holds only the display app. wishin.app, a gift wishlist site, is a separate project on Vercel.

rackstat, tempest, wishin, burnsafe and flameboss fetch their own data on Tronbyt's render schedule. callerid renders only its config, so something has to push it: Tronbyt's push_app API renders a named app with a config and sends the image to a device. Nothing calls that endpoint for callerid yet, so with no verdict set it cycles a demo of every verdict instead. A verdict with no number, such as a withheld caller ID, still renders that verdict.

Use it#

SurfaceAddressWho can reach it
Tronbyt web UIhttps://tronbyt.lolwtf.caClients that route to folly's load-balancer range, with a Tronbyt sign-in. New users cannot register.
rackstat snapshothttp://rackstat.tronbyt:8080/api/rackstatPods in folly

Tronbyt keeps in its database which apps each display shows. Git does not record it.

Limits#

  • Pixlet rejects a load() outside the app directory, so each app carries its own helpers.
  • If an API answers with an error status or incomplete data, the app draws a screen that names the error. If the API cannot be reached, the render fails.
  • rackstat shows STALE when its snapshot has errors or is older than 5 minutes. Its header clock comes from the cluster, so a frozen clock means Tronbyt or folly is down.
  • flameboss draws nothing while no cook is running, so Tronbyt skips it. Its show_idle setting draws an idle screen instead.
  • flameboss calls PIT LOW, PIT HIGH, ADD FUEL and PIT PROBE UNPLUGGED only when the cook's history holds the condition for the alert rule's for window. LID OPEN, the controller's own alarms, GONE QUIET, CLOUD DOWN and PULL IT show at once.
  • flameboss shows at most two alert screens per rotation, and PULL IT keeps one of them.
  • callerid takes no API errors: a malformed number or an unknown verdict falls back to plain digits or the ring screen instead of failing the render.

How it works#

Tronbyt runs the ghcr.io/tronbyt/server image, with a CloudNativePG database and a local-path volume on a worker node. CloudNativePG archives the database to folly's Garage through the barman-cloud plugin, and Velero backs up the data volume each night. The pod cannot move to another node without a restore of that volume (Restore a volume).

The rackstat aggregator runs in the tronbyt namespace. It merges Prometheus data, the Flux Kustomization and HelmRelease objects, the folly PBX's line and trunk registration state, and TCP probe results into one JSON snapshot. It caches the snapshot for 15 seconds. The rackstat-flux-reader ClusterRole gives it read access to the Flux objects. PROBES in clusters/folly/apps/tronbyt/07-rackstat-deployment.yaml names the probe targets. rackstat.star reads the snapshot from http://rackstat:8080/api/rackstat in the same namespace. flameboss.star reads http://flameboss.monitoring:8080/api/cook, the exporter's Service in monitoring.

On a pull request, the pixlet-preview workflow posts a render of each changed app.

Operate#

No alert rule is specific to the displays or Tronbyt. The default kube-prometheus-stack rules on folly cover their pods.

Reference#

  • Source: apps/rackstat/, apps/tempest/, apps/wishin/, apps/callerid/, apps/burnsafe/ and apps/flameboss/
  • Manifests: clusters/folly/apps/tronbyt/
  • Images: ghcr.io/jonpulsifer/rackstat and ghcr.io/tronbyt/server
  • Previews: .github/workflows/pixlet-preview.yml

Edit on GitHub

↑↓ move ↵ open esc close