Choosing a target¶
myxo export writes a platform's files from the layout. The application's code has no line per target.
| systemd | Hop3 | Kubernetes | |
|---|---|---|---|
| Suits | a server with no platform | a server that runs Hop3 | a cluster, and replicas |
| What you deliver | a tarball or an environment in /opt, the layout, the units |
a directory with your wheel and a project | an image, the manifests |
| Operator's commands to install | 7 | 1 | 5 |
| Installed to running, measured | 7.4 s | 18.3 s | 11.9 s |
| Database | SQLite or PostgreSQL | PostgreSQL, from an addon | PostgreSQL |
| Replicas | one of each process | one of each process | instances |
| Reduced privileges | systemd's sandbox | none; --without-sandbox |
a restricted security context |
The numbers come from E10: a fresh machine for each target, each measured once.
Conventions the export relies on¶
- The public process. The process named
web, or the only process, serves$PORT, so read it in your web service's settings:port = "${PORT:-8000}". - The address. A pod is reached on its own address, so a web service for Kubernetes reads its
hostfrom itsConfig, as that guide shows. - Settings from the environment.
${...}in the layout reads the platform's settings, so that one file serves every target. - Migrations are a release step. Each target runs
myxo migratebefore the processes start: a one-shot unit on systemd,before-runon Hop3, a job on Kubernetes,releasein a Procfile. env.example. Each export lists the variables the layout reads, with their defaults, for the operator to fill in.
A layout that serves every target looks like the tutorial's, examples/guestbook/layouts/app.toml.
What has been tested¶
E10 deployed a testbed from exported files alone, on a fresh Debian 13 machine in OrbStack, a kind cluster, and Hop3 0.7.5. E14 repeated Kubernetes on three kind nodes. E15 upgraded a running installation one process at a time, on one host with the processes started by hand (operations). These have not been tried:
- an upgrade over a running version on a target, one process at a time;
- Kubernetes on separate hosts, since kind's nodes share a machine;
- systemd's whole sandbox, since OrbStack's containers turn parts of it off;
- Hop3 with a domain and TLS, or with a cold cache;
- the
procfiletarget on any platform.
The procfile target¶
myxo export LAYOUT procfile --name NAME writes a Procfile in Heroku's form, with the migrations as its release phase. Check how your platform connects its processes first: Heroku's Common Runtime firewalls dynos from one another, so a layout whose processes call each other needs its Private Spaces.