Skip to content

High Availability and Topologies

NORA has no built-in failover yet. It runs with one writer: one process that writes to the storage at a time. This page lists the topologies that work within that rule, what each one survives, and what is planned. Active/standby with leader election is designed in #796.

StateWhereAfter a restart
Artifacts, metadata, cacheThe storage backend: local disk, S3-compatible storage or Google Cloud StorageKept
API tokensauth.token_storage, data/tokens by default, on the local disk with every backendKept if the directory is on a persistent volume
Curation quarantine ledgerquarantine.jsonl in storage.path, on the local diskKept if the directory is on a persistent volume
Upload sessions, publish locks, circuit breakers, cachesProcess memoryReset; a docker push cut by the restart is run again

With S3 or GCS storage the artifacts outlive the host. Keep the local data directory (/data in the container) on a persistent volume as well: with authentication on, a restart without it loses the issued tokens and every client gets 401.

Section titled “Single instance, restarted on failure (recommended)”

One NORA, restarted by the supervisor when it dies.

  • systemd: the shipped unit dist/nora.service restarts NORA on failure (Restart=on-failure, RestartSec=5).
  • Kubernetes: the Helm chart defaults to one replica, the Recreate strategy and a persistent volume for /data. Kubernetes starts a new pod when the old one fails; when the node is lost, the pod comes back once the volume is attached on another node.
  • Docker: --restart unless-stopped and a named volume for /data.

While NORA restarts, builds keep working from the clients’ own caches (the Docker image store, ~/.m2, ~/.npm, ~/.cargo, the pip cache) for everything they already have. Pulls of new artifacts and publishes wait for NORA.

Two hosts with access to the same bucket. NORA runs on one of them; on the other it is installed and stopped. A failover tool (keepalived with VRRP, Pacemaker) moves the service address to the standby host and starts NORA there.

  • Keep the standby stopped. A running NORA works on the storage without any requests: the maintenance loop probes it, and the retention scheduler, when enabled, deletes. Two running instances on one bucket are two writers.
  • Tokens: put auth.token_storage on storage both hosts can reach, or copy the directory from the active host to the standby one way, on a schedule. Tokens issued after the last copy are missing after a failover.
  • Quarantine ledger: the same applies to quarantine.jsonl if curation quarantine is on.
  • Kubernetes: do not run a second replica as a standby. It passes its readiness probe, receives traffic and writes. Use one replica until active/standby lands.

Several replicas behind a load balancer are not supported:

  • the publish lock that serializes writes to one artifact is per process, so two replicas can write the same path at once;
  • a docker push is several requests (POST, PATCH, PUT) bound to an upload session kept in memory, so they must reach the same replica;
  • each replica caches token checks for up to 5 minutes, so a revoked token keeps working on the other replicas for that long.

See also the storage notes in COMPAT.md on conditional writes.

  • nora backup and nora restore write and read a full copy of the artifacts.
  • On S3, bucket versioning and replication by the storage itself protect against a lost bucket or a bad delete. Replicate one way, from the bucket NORA writes to.
  • File-level sync (rsync) suits a cold copy taken in one direction. Two hosts that write and sync into each other diverge.

For geo-distributed reads, put a CDN in front of NORA. Immutable artifacts (Docker blobs, Maven releases, crates, wheels) cache well and stay available while NORA restarts.

#796 describes active/standby on a shared bucket, in two steps:

  1. Conditional writes in the storage layer (put_if_absent, put_if_match) on S3 and local disk.
  2. A lease object in the bucket. The instance holding the lease serves traffic; the others answer 503 on /ready and take the lease over when it expires. The bucket plays the role a database plays in other registries.

Active-active (several writers) is not planned before that.