ConductScience Sequences
Contents

Installation guide · Several servers

Add workers

Add workers on the coordinator's own server or on other hosts.

Two workers on one host

Two workers beside the coordinator on its own server are the simplest setup, and a way to try several servers before you add hosts. The coordinator and its workers join a Docker network of their own, sequences-workers, where each worker reaches the worker port by the coordinator's container name. The port is not published, so only containers on that network reach it, and it needs no TLS there. The network outlives each container, so after the coordinator restarts, its workers join it again by themselves. The commands below give the coordinator 2 CPUs and each worker 6.

First make the worker key, readable only by root and by group 10001, the service's group, and the network:

sudo install -m 0640 -g 10001 /dev/null /etc/sequences/worker.key
head -c 32 /dev/urandom | base64 | sudo tee /etc/sequences/worker.key > /dev/null
docker network create sequences-workers

Load each snapshot and delta the coordinator holds into a volume for each worker, from the same copies, as in Load a copy. For the first worker:

docker volume create sequences-w1-data
docker run --rm \
  -v sequences-w1-data:/data \
  -v /srv/sequences/import:/import:ro \
  conductscience/sequences:<version> \
  load /import/2026-11-05-c456f6bdba29 --sums /import/2026-11-05-c456f6bdba29.SHA256SUMS

If the coordinator has a paper folder or a taxa folder, copy it into each worker's volume as it is, since a folder made again is another folder, and give the worker the same BIOSEQUENCE_PAPERS or BIOSEQUENCE_TAXA with one more -e each in its command below. For a taxa folder, run this again with /from/taxa in place of /from/papers:

docker run --rm --user 0 \
  -v sequences-data:/from:ro \
  -v sequences-w1-data:/to \
  --entrypoint cp conductscience/sequences:<version> -a /from/papers /to/

Add these lines to the coordinator's /etc/sequences/sequences.env:

BIOSEQUENCE_ROLE=coordinator
BIOSEQUENCE_WORKER_KEY_FILE=/config/worker.key
BIOSEQUENCE_CONCURRENCY=0
BIOSEQUENCE_WORKER_BIND=0.0.0.0

Start the coordinator as in Start the container, with --cpus 2 --network sequences-workers added. If it runs, remove it first with docker stop sequences && docker rm sequences. Then start the two workers:

for w in w1 w2; do
  docker run -d --name sequences-$w --restart unless-stopped \
    --network sequences-workers --cpus 6 \
    --read-only --tmpfs /tmp \
    --cap-drop ALL --security-opt no-new-privileges \
    -v sequences-$w-data:/data \
    -v /etc/sequences/worker.key:/config/worker.key:ro \
    -e BIOSEQUENCE_ROLE=worker \
    -e BIOSEQUENCE_WORKER_NAME=$w \
    -e BIOSEQUENCE_COORDINATOR_URL=http://sequences:8766 \
    -e BIOSEQUENCE_WORKER_KEY_FILE=/config/worker.key \
    -e BIOSEQUENCE_THREADS=6 \
    conductscience/sequences:<version>
done

A worker mounts the key alone, not the rest of /etc/sequences. Its log names the coordinator and says when its copies match:

Sequences worker w1 for the coordinator at http://sequences:8766: 1 search at a time, 6 threads each. Data stays on this computer: /data
Joined the coordinator at http://sequences:8766 as w1.
This worker's copy of snapshot 2026-11-05-c456f6bdba29 matches the coordinator's.

The coordinator's log says how many searches came back from its last stop, and when each worker joins:

Coordinator: searches of a snapshot keep their place in the queue across a restart (0 came back from the last stop).
Coordinator: BIOSEQUENCE_CONCURRENCY is 0, so workers run every search of a snapshot and this server runs none.
Workers join on 0.0.0.0:8766.
The worker port takes plain HTTP. For workers on other hosts, set BIOSEQUENCE_WORKER_TLS_CERT and BIOSEQUENCE_WORKER_TLS_KEY.
Worker w1 joined: 1 search at a time, 6 threads each.
Worker w1 matches this server's copy of snapshot 2026-11-05-c456f6bdba29.
Worker w2 joined: 1 search at a time, 6 threads each.
Worker w2 matches this server's copy of snapshot 2026-11-05-c456f6bdba29.

The plain HTTP line is expected here: the worker port is not published, so only the sequences-workers network reaches it.

The workers keep the network while the coordinator stops and starts, so a restart of the coordinator needs nothing done to them, whether you restart it, Docker does after a crash or a reboot, or its health check does (see Health and logs). Their logs say that it does not answer, they say hello every 20 seconds, and they join it again once it answers. A search a worker runs goes on if the worker reaches the coordinator within a minute of its start, and otherwise waits in the queue again, counted as cut off once.

When you make the coordinator's container anew, as in an upgrade, start it with --network sequences-workers again. The workers must run its release, so drain them before the upgrade (see Drain and stop a worker), remove them with docker stop sequences-w1 sequences-w2 && docker rm sequences-w1 sequences-w2, and run the loop again with the new version once the coordinator runs.

Workers on other hosts

Workers on other hosts reach the coordinator's worker port across your network, so turn on TLS there: each request carries the worker key, and each search's queries and results cross the network. You need a certificate for the name the workers use, such as coordinator.example.org, and its private key, as PEM files.

On the coordinator, put both files in /etc/sequences, the private key readable only by root and group 10001:

sudo install -m 0644 worker-tls.crt /etc/sequences/worker-tls.crt
sudo install -m 0640 -g 10001 worker-tls.key /etc/sequences/worker-tls.key

Then add these lines to its settings:

BIOSEQUENCE_WORKER_BIND=0.0.0.0
BIOSEQUENCE_WORKER_TLS_CERT=/config/worker-tls.crt
BIOSEQUENCE_WORKER_TLS_KEY=/config/worker-tls.key

Publish the worker port on the address the workers reach, with -p <coordinator address>:8766:8766 in its docker run, and let your firewall admit only the workers' addresses to it. The log then says Workers join on 0.0.0.0:8766 over TLS. Without TLS on that address, it says that the worker port takes plain HTTP.

On each worker host, copy the coordinator's key to /etc/sequences/worker.key, readable only by root and group 10001, and put the PEM file of your certificate authority in /etc/sequences/ca.pem if your own authority signed the certificate. Load the snapshots and deltas into the host's sequences-data volume from the same copies, and copy the coordinator's papers/ and taxa/ folders into it as they are if the coordinator has them (see Backups), with the same BIOSEQUENCE_PAPERS and BIOSEQUENCE_TAXA in the worker's command. Then start the worker. Leave out NODE_EXTRA_CA_CERTS when a public authority signed the certificate:

docker run -d --name sequences --restart unless-stopped \
  --read-only --tmpfs /tmp \
  --cap-drop ALL --security-opt no-new-privileges \
  -v sequences-data:/data \
  -v /etc/sequences:/config:ro \
  -e BIOSEQUENCE_ROLE=worker \
  -e BIOSEQUENCE_WORKER_NAME=w3 \
  -e BIOSEQUENCE_COORDINATOR_URL=https://coordinator.example.org:8766 \
  -e BIOSEQUENCE_WORKER_KEY_FILE=/config/worker.key \
  -e NODE_EXTRA_CA_CERTS=/config/ca.pem \
  conductscience/sequences:<version>

A worker opens no port. It connects to its coordinator and to nothing else. It takes an http:// address only for its own machine or a one-word host on the same Docker network, such as a container named coordinator, so the key never crosses a network in plain text by mistake.

Guide version 1.63.0 · For Sequences 0.155.0