Skip to content

Self-update

moirad runs as a stack in the deploy folder, so you can update it like any other service:

Terminal window
moira update edge/moirad/moirad

A daemon can’t recreate its own container and report the result at the same time, so for actions that would replace or restart it, moirad hands the work to a helper.

  1. The daemon starts a detached, auto-removing container from its own image (or MOIRAD_HELPER_IMAGE). The helper gets the Docker socket, the deploy folder at the same path and the registry config.
  2. The job ends in state handed-off. The helper holds the stack lock until it exits, also across the daemon’s replacement.
  3. The helper runs the action: update pulls the tag in the compose file and runs up -d if the pull succeeded; apply runs up -d; restart and start act on the selected containers.
  4. The client polls the host every 2 seconds for up to 2 minutes:
    • the version changed, or the daemon came back after being unreachable → exit 0;
    • the daemon stayed up with the same version → warning handed off; no daemon restart observed, exit 0;
    • still unreachable at the deadline → warning, exit 1.

The helper’s own output isn’t available through the jobs API. If an update seems stuck, check the host with docker ps -a --filter label=moira.helper=self-update and docker logs moirad.

  • Stop is refused. Stopping moirad or its whole stack over the API returns an error. Use SSH.
  • The :stable tag in the compose file makes update follow releases. Use a version tag such as :0.3 or :0.3.0 to hold a host back.
  • Self-detection. The daemon finds its own container automatically. If detection fails, it logs a warning and refuses stack actions until you set MOIRAD_SELF_CONTAINER to the container name and restart it.
Tag Moves on
:stable The highest final release (v0.3.0)
:0.3 The highest patch of that minor series
:0.3.0 Never
:0.3.1-rc.1 Never (prerelease)
:edge, :sha-<short> Every push to main