Expand description
Local cluster orchestrator: S, P, O, string-registry, and compute.
waratah start spawns the four storage-side processes from their own
binaries (waratah-partition, waratah-registry) at the addresses in the
static ClusterConfig, then runs the compute coordinator in this process
behind an RDF4J HTTP facade (waratah_api) by default. It daemonizes
itself unless --foreground is given (see crate::daemon).
waratah standalone skips spawn: this process opens
waratah_partition::PartitionService Γ3 and
waratah_registry::RegistryService and injects them into compute (same
SPARQL / HTTP session, no gRPC). Always foreground.
Nothing here is a production supervisor β restarts, health checks, and address discovery belong to the gossip/etcd work in Phase 10.
StructsΒ§
- DevOptions
- Options for
start. - Spawned
Cluster π - Child processes, killed when this value is dropped.
- Warm
Gate π - Startup cache-warm gating handed to a session: the shared tracker
(standalone mode;
/healthreturns 503 with the pending walk names until it drains) plus any orchestrator warnings (RPC mode; a child walk outlived the readiness wait). Both surface in the/healthbody.
EnumsΒ§
- Backend
- Backend for the spawned hexastore partitions.
- Warm
Probe π - One storage childβs
Healthprobe (the two tonic client types differ, so the poll matches on which it holds).
ConstantsΒ§
- DEFAULT_
HTTP_ ADDR - Default RDF4J HTTP listen address (
/rdf4junder this host:port). - DEMO_
COMMIT_ πTS - Commit timestamp of the demo load (Phase 8 assigns these from a TSO).
- DEV_
PID_ πFILE - Pidfile name: next to the data dir when one is set, otherwise in the
working directory (memory-backend daemons).
waratah stopreads it to SIGTERM us. - HTTP_
DRAIN_ πTIMEOUT - How long outstanding HTTP work gets to drain after the shutdown signal
before remaining connections (kernel websockets) are force-closed.
Kept well under
waratah stopβs SIGKILL deadline so the sidecarβs own graceful kernel shutdown (waratah_notebookSHUTDOWN_GRACE) still gets to run. - STARTUP_
TIMEOUT π - How long to wait for a spawned process to accept connections.
FunctionsΒ§
- another_
server_ πusing_ storage - Whether another
waratahserver is already serving THIS data dir: the pidfile there names a live pid that is not ours. The pidfile is the existing cross-process channel (waratah startandstandalonewrite one and remove it on exit), so a live foreign pid is a server on the same storage. A memory backend shares no storage β each process owns its store β soNonefinds nothing to detect. Our own pid is the pidfile this process just wrote, not a peer. - binary π
- data_
dir π - demo_
dataset - Weather/city dataset behind the demo
SELECT, extended with the schema triples the AI-context endpoint demonstrates against: anrdfs:labelon every subject and a two-levelrdfs:subClassOfhierarchy (Person β Agent β Thing,City β Place β Thing). The parent classes deliberately have no instances β they surface only via the transitivesuperClassesclosure, which is exactly the shape the endpoint must get right. - demo_
queries - Built-in query library published under
--load-demowhen no--queries-diris configured. Every query returns rows overdemo_dataset, so the console Query library works out of the box. Entries keep this declaration order on the wire (the(order, id)sort belongs to the directory source, not the inline one). - is_
tmpfs π - Whether
pathsits on a tmpfs mount (Linux only; other platforms report false and skip the check). - log_
spill_ πroot - Log the resolved spill root and warn when spilled pages would stay in RAM.
- pidfile_
dir π - Directory the pidfile lives in: the data dir when one is set, otherwise
the working directory (memory-backend daemons write one there so
waratah stopwithout--data-dircan find them). - pidfile_
path π - Full pidfile path for a data-dir choice:
{data_dir}/waratah-dev.pid, or./waratah-dev.pidfor the memory backend. - print_
query_ πresults - process_
alive π - Whether
pidhas a live process. Signal-0 probe plus a zombie check: an exited-but-unreaped child (its parent has notwaited yet) still answerskill(pid, 0), which would makewaratah stopwait out its whole deadline on a process that is already gone. - remove_
pidfile π - remove_
pidfile_ πif_ names - Remove
pathonly when it still namespidβ never a file that has been overwritten by (or always belonged to) another cluster. A pidfile IS thewaratah stophandle, so deleting someone elseβs leaves their live cluster unstoppable. Returns whether a file was removed. - repl π
- Read one query per line from stdin until EOF,
quit, or shutdown signal. - run_
query π - run_
session π - serve_
http_ πuntil - Serve HTTP on an already-bound listener until the listener fails or shutdown is signalled, then give outstanding requests a bounded drain before force-closing what is left.
- spawn_
compute_ πadmin - start
- Spawn the storage-side processes (unless the
waratah standalonecommand setoptions.standalone), then run compute. - stop
waratah stop [--data-dir DIR]: SIGTERM the orchestrator recorded in{data_dir}/waratah-dev.pid(or./waratah-dev.pidwithout a data dir β where memory-backend daemons put it) β its signal handler kills the storage children and the notebook sidecarβs process group β wait, then SIGKILL as a last resort.- wait_
cluster_ πwarm - Poll every storage childβs
HealthRPC until its cache-warm walk finishes (warm_ready), so the HTTP server β and the benchmarkβs start signal β only comes up after first queries can no longer race the warm pass. - wait_
until_ πlistening - Poll
addruntil the process accepts a connection or the timeout expires. - write_
pidfile π - Claim the pidfile for this process. Refuses the start when the file
already names a LIVE foreign pid: overwriting it would leave that
cluster with no
waratah stophandle. A stale file (dead pid, or our own pid from a restarted run) is overwritten.