Showdev: deploy apps to edge devices and servers with Synpse
Karolis
Posted on September 2, 2021
Hey dev.to! I wanted to share our project Synpse that my friend and I have been working on for quite some time.
TL;DR;
Registration is now open at https://cloud.synpse.net. Free for up to 5 devices forever. We can increase your quotas if requested. Self-hosted version available as well.
Synpse provides tooling and services to:
- Prepare machine images that you can burn into SD cards to quickly bootstrap hundreds or thousands of devices.
- Generated simple installation script for one-off device/server bootstrap.
- Group devices based on labels (used for both filtering and scheduling applications).
- Automated device naming (based on hostname, random names, etc.).
- Deploy containerized applications (Docker Compose/K8s Pod style).
- Automated device software updates.
- Easily scale to tens or hundreds of thousands of devices.
- SSH into any of your devices through
synpse
CLI or web UI. - Kubectl style port-forward command to open up TCP tunnels.
- CPU/RAM utilization metrics from device.
Problem
While it's easy to configure a systemd or some other init service in an OS image to launch your application on device boot - it won't help much for fast updates or gradual rollout. It will also not help much if during the rollout you need to collect some data from applications (logs, SSH access to check some files).
We had a need to deploy quite complex piece of software to ~1200 devices. After looking into a bunch of alternatives like Mender, Balena, Deviceplane we came to a conclusion that it's either:
- Can't use my own image (we had a manufacturer that could only use their own Linux distro, new custom OS was not an option).
- Self-hosting is too complicated.
- Not scaleable (started considerably slowing down with very few devices).
Solution
What our testing gave us was the understanding that the ideal solution would be:
- Simple self-hosting, a horizontally scaleable controller and a managed database (we chose Postgres) without disrupting your bank balance.
- Must support any Linux OS.
- Don't try to be compatible with neither Kubernetes or Docker Compose in the API/config manifests. These systems require different semantics so it's fine to be similar but 1:1 mapping will just damage the UX.
- SSH and application logs are a must if you have an outage and you need a fast way to debug.
- Everything belongs to a project. Project can have multiple users but the projects should be able to survive multiple generations of users as these systems will last longer than many individual employees.
The feel
So, one-off device provisioning script + execution parameters can be found in either "devices" or "provisioning" pages:
Once devices are added, they appear in your dashboard for SSH access, monitoring:
You can read more about device management here: https://docs.synpse.net/synpse-core/devices.
You can add various labels and then use them in the application deployment:
View application docs here: https://docs.synpse.net/synpse-core/applications.
Most applications have some shared or private configuration, luckily Synpse provides secrets (similar to Kubernetes ones) where you can reference to them from your application spec:
And when things go south, view your application logs on any of the devices:
Use cases
As mentioned in the first paragraph, we built Synpse for a medium size fleet of ~1200 IoT devices and a bunch of large servers as it appears that the UX can be much nicer than Docker Compose or Kubernetes. All of those devices are actually card readers in a large bus/trolleybus fleet in Lithuania :)
We would recommend using Synpse for:
- Home lab deployments (up to 5 devices free forever).
- PoS deployments.
- Public transport fleets.
- ML on edge (packaging and running ML inference through Docker containers).
- Any kind of industrial applications where devices can be offline for a prolonged time. Synpse will work well without internet access.
- Normal VMs on cloud providers that don't provide good application deployment UX (most smaller ones like Vultr, DO, Packer, etc.)
Next steps
If you run software yourself or in a company, you should definitely check it out.
Useful links:
- Docs: https://docs.synpse.net/
- Website: https://synpse.net
- Our Discord channel: https://discord.gg/dkgN4vVNdm
Posted on September 2, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.