Meridian: a deployment CLI for rootless Podman

Meridian: a deployment CLI for rootless Podman

I mentioned Meridian in the What are you cooking? thread a while ago. I just tagged the first alpha version.

It’s an alpha not because it’s untested, I use it for most of my own apps and services, but because I want some feedback before calling the interface stable.

About Meridian: it’s a deployment CLI inspired by Kamal, built around rootless Podman, Quadlets and Caddy.

The main idea is to keep the deployment model fairly small: connect to a server over SSH, deploy the application, and leave regular Podman containers managed as systemd services behind.

Registries are supported, but optional. I mostly have private apps that I don’t want to push to an external registry, and I also don’t want to maintain my own registry. Images can therefore also be transferred directly over SSH, either as a compressed stream or incrementally through an OCI layout and rsync.

Assets follow a similar idea. For my smaller apps a CDN would be overkill, but I still want fingerprinted assets with proper caching and compression. Meridian can deploy them together with the application and serve them through Caddy!

Web applications use health-checked blue/green deployments through Caddy. Caddy 2.11.2 exposes in-flight request information through /reverse_proxy/upstreams, which Meridian uses to wait for draining before removing the old container.

Meridian also supports accessories such as PostgreSQL or Redis, Podman secrets, rollback to the previous web release, logs and exec/run.

I’m also looking into whether Grafito from @ralsina could be a useful way to inspect logs from the systemd journal for services deployed with Meridian.

The alpha label mainly means that configuration and CLI details may still change based on feedback.

GitHub: GitHub - treagod/meridian: Deploy anywhere, without a harbor · GitHub

Feedback from anyone trying it on a real server would be especially useful.

This looks cool! I’ve done something similar: willhbr/pod: Container manager and dev helper for podman - Codeberg.org (it was originally written in Crystal and then I rewrote it as an exercise.

pod is mostly just written for my needs and whims, it started for just running containers for development, then grew into an ad-hoc deploy tool.

You might be able to simplify your image copying (based only on reading the “How does SSH image transfer work?” section on the website) with podman image scp which does what you seem to be doing yourself. I check that the ID has changed first, since the default behaviour seems to be a somewhat-expensive hash of the bytes to check if something has changed. If there is a difference, I think it uses the same method as podman pull to copy only changed layers. Or something.

Thanks for the hint! I actually looked at podman image scp early on, but dropped it after running into issues with my setup.

Looking at it again, it still transfers a full archive and only skips existing layers when loading it remotely, so it wouldn’t replace Meridian’s incremental OCI/rsync mode. It’s also not supported from Podman remote clients like macOS, which matters to me since I’m currently still working from a Mac.

I may still revisit it for the simple stream mode on Linux if it proves to be more efficient. Otherwise, I don’t think maintaining two code paths is worth the effort.