Volumes
A volume is a directory a web service or a worker keeps across deploys and restarts: uploads, a SQLite file, a search index. Without one, every deploy starts empty.
Adding one
In yawl.yaml:
services:
- name: api
kind: web
volumes:
- {name: uploads, path: /app/uploads}
Or in the service’s Settings, the Volumes field, one name: /path per line.
- A name is lowercase letters, digits and dashes; a path is absolute; a service has at most 4.
- Only a web service or a worker has volumes. A cron job and a database do not.
- On the server the volume is the Docker volume
yawl_<project>_<env>_<service>_<name>(underscores, which no name can hold, so two services never share one).
Deploys
A service with a volume deploys stop, then start: the old version stops before the new one mounts the volume, so two containers never write it at once. The plan says so:
api has a volume: it is down for a few seconds while the new version starts.
A web service is still health checked before its route moves. A failed check starts the old version again, on the same volume.
A release command (a migration) runs after the old version stops, with the volumes mounted, so a SQLite file on a volume is the one it migrates. If it fails, the old version starts again.
Backups
Every volume is backed up each night at the service’s backup_at (03:30 UTC unless set), to the same storage and with the same recovery key as databases. They are kept like a database’s: 7 daily and 4 weekly.
- What a backup is. A
tarof the volume, read while the app runs, encrypted on the server and streamed to storage. A file being written at that moment may be cut; keep what must be exact in Postgres. - Back up now. The service’s Backups tab lists each volume’s backups and has a button per volume.
- A failed backup sends one Telegram message naming the volume, for example
api volume uploads backup failed: 403 ..., and one more when it works again.
Restoring
From the Backups tab, Restore on a backup. The dialog says what happens, for example:
api stops, uploads is emptied and filled from the backup of 28 Oct 03:30 UTC, then api starts.
It asks for the recovery key (sealed in the browser to the server’s agent; the panel never sees it) and for the service’s name.
- The restore decrypts the backup before it empties the volume. A wrong key leaves the volume as it was, and the service is started again on it.
- Any failure after the stop starts the running version again.
Moving an environment
A move carries volumes as it carries databases: it stops the apps, takes a fresh backup of each volume, restores it into a volume of the same name on the new server, then starts the apps there. When the move is done, the old server’s volume is removed.
If the old server is offline, the volume comes from its last backup, and the plan says how old it is:
hel1 is offline: api volume uploads is restored from its last backup, 3 hours old; changes after it are lost
In that case the old server’s copy is kept when it comes back (it may hold changes newer than the backup); remove it by hand once you no longer need it.
Removing a volume
Taking a volume out of yawl.yaml only stops mounting it: its data stays on the server, and the plan says so:
api: volume uploads is no longer mounted; its data is kept until api is deleted
It is no longer backed up. Deleting the service removes it, after the 48 hours in the trash, with its backups.