An analyze worker on a second machine
The usual reason: the machine with your video has no GPU, and another machine on your network does. The analyze worker is the only part that can move. It never sees your video. It needs two things from the main machine: the gallery's address, and read-only access to the data folder where the extracted frames are.
You can run more than one; each gets its own name and token (steps 2 and 6), and they share the work.
Get the single-machine install working first, with at least one file through all four stages. Then:
On the main machine#
1. Keep the data in a folder, and share it. A Docker volume cannot be
shared over the network, so the data must live in a folder of yours. In
.env:
HIKARI_DATA=/path/to/hikari/data
The folder must be writable by user id 10001. If you already have works
in the default Docker volume, copy its contents into the folder before
you restart, keeping the owner. With everything stopped
(docker compose stop), and the volume named after the folder you cloned
into (docker volume ls shows it):
docker run --rm --entrypoint cp -v hikari-index_hikari-data:/from:ro -v /path/to/hikari/data:/to ghcr.io/hikari-index/worker:latest -a /from/runs /to/
The image is the worker your install already pulled. If you set
HIKARI_VERSION in .env, use that tag instead of latest.
Then start everything again with docker compose up -d; step 2 needs
the gallery running.
Share that folder on your network, read-only, by whatever your system
uses (SMB or NFS). The share's top level must be the data folder itself,
so that runs is directly inside it. A separate account that can only
read this one share is worth the minute it takes.
2. Give the new worker a name and a token. Each worker has its own. Make a token on the main machine:
docker compose exec gallery node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Add it to HIKARI_WORKER_TOKENS in .env, after a comma, as
name:token. With a worker named gpu:
HIKARI_WORKER_TOKENS=analyze:<the token already there>,gpu:<the new token>
3. Decide what the main machine's own analyze worker does. In .env:
Keep it as a fallback for when the other machine is off: leave
COMPOSE_PROFILES=cpuand addHIKARI_ANALYZE_STANDBY=1. A standby worker takes a stage only when no regular analyze worker has checked in for ten minutes.Or turn it off. Stop and remove it first, because emptying the profile alone leaves a running container running:
docker compose rm -sf analyze-cpu(
analyze-gpuif that is the one you ran), then setCOMPOSE_PROFILES=(empty). Analyze then waits whenever the other machine is off.
Without one of these, both workers take stages as they come, and some of your episodes are described on the main machine.
4. Apply:
docker compose up -d
On the second machine#
5. Get the same code. Clone the same commit the main machine runs. Workers from different versions can often read each other's work, but the same commit is the case that has been tested.
6. Settings. For a GPU, copy .env.rtx-worker.example to
.env.rtx-worker. For CPU only, copy .env.cpu-worker.example to
.env.cpu-worker, and use that pair (.env.cpu-worker,
compose.cpu-worker.yaml) in every command from here on. Set:
HIKARI_GALLERY_URL: the main machine's address and port, for examplehttp://192.0.2.10:5183. Notlocalhost.HIKARI_WORKER_IDandHIKARI_WORKER_TOKEN: the name and token from step 2.- For a CPU worker,
HIKARI_VERSION: the same as the main machine's (leave it out forlatest). - For a GPU worker,
HIKARI_WORKER_VERSION: any label, for examplertx-worker-local. It is baked into the image at build time and printed at the top of the worker's log, so set it before step 7.
The CPU example file sets HIKARI_WORKER_STANDBY=1: that worker is meant
as the fallback for a GPU machine that is sometimes off. If this CPU
machine is meant to do the analyzing, delete that line. With both
workers on standby, neither counts as the regular one, so both take
stages as they come, which is the thing step 3 was meant to prevent.
7. Get the worker. A CPU worker is published; pull it:
docker compose --env-file .env.cpu-worker -f compose.cpu-worker.yaml pull
A GPU worker is built here. First the base it is built on (large, once):
docker build -f containers/inference/Dockerfile -t hikari-index/inference:inference-d1f2552-20261002.1 .
Then the worker:
docker compose --env-file .env.rtx-worker -f compose.rtx-worker.yaml build
8. Mount the share as a Docker volume. The worker reads the data
through a Docker volume named hikari-index-share. Over SMB, with the
share at //192.0.2.10/hikari-data:
docker volume create --driver local --opt type=cifs --opt device=//192.0.2.10/hikari-data --opt o=addr=192.0.2.10,vers=3.0,ro,uid=10001,gid=10001,file_mode=0440,dir_mode=0550,nosuid,nodev,noexec,username=READER,password=PASSWORD hikari-index-share
Over NFS, with the export at /export/hikari-data:
docker volume create --driver local --opt type=nfs --opt o=addr=192.0.2.10,ro,nfsvers=4 --opt device=:/export/hikari-data hikari-index-share
Docker keeps the share password in the volume's settings on this machine, which is one more reason for a read-only account. This works the same on Linux and on Docker Desktop for Windows; a drive letter mapped in Windows cannot be used instead. The SMB form is the one in daily use; the NFS form is the standard Docker one and has not been tested here.
9. Start it:
docker compose --env-file .env.rtx-worker -f compose.rtx-worker.yaml up -d
Always pass --env-file: without it Compose reads .env, which is the
main install's file.
Check#
Onboard something on the main machine and watch Jobs. While the
second stage (describe each frame and pick the stills) runs, its row
names the worker that took it: gpu, or whatever you called it in step
2. If the work waits instead, the Waiting section says whether an
analyze worker is checked in.
| What you see | What it means |
|---|---|
| The worker never appears | Read its log: docker compose --env-file .env.rtx-worker -f compose.rtx-worker.yaml logs --tail 20. "gallery not reachable" is the address or a firewall. A refused token means the name and token in step 6 do not match the pair in step 2, or the gallery was not restarted after step 2. |
| It appears, and the stage fails with "the run root is not readable ... (is the share mounted?)" | The volume does not show the data folder. Check that runs is at the top of the share and that the share account can read it. |
| It says it cannot read a bundle, and to update whichever worker is behind | Usually the two machines were built from different versions. Rebuild the older one. |
| Both workers take stages | Step 3 was skipped. |