Lifecycle
Every session opens and closes with these verbs: stand the daemon up, mount the package folder, check it is healthy, tear it back down.
orca version # sanity check (no daemon needed)
orca start # spawn the daemon, no system loaded
orca topology mount # build the package folder and start the runtime
orca runtime reload # build again after an edit
orca status # daemon + runtime health
orca unload # drop the runtime, keep the daemon
orca shutdown # unload (if needed) and exit the daemon
Run orca start in your package folder, the one holding topology.py and workflows/, or set ORCA_PACKAGE_DIR to it. That folder is what orca topology mount builds.
orca version
Print the installed framework version. No side effects, no daemon required.
$ orca version
orca 3.0.0
orca --json version:
{"version": "3.0.0"}
The version is read from the installed cheshire-orca distribution. If that lookup fails, it prints unknown rather than erroring.
orca start
Spawn the daemon as a detached subprocess. Polls /health until ready, then prints the PID and port.
$ orca start
daemon started (pid=43821, port=51724). No system loaded -- run `orca topology mount` next.
| Flag | Effect |
|---|---|
--port <n> | Bind port. Default 0, which picks a free ephemeral port. |
What happens:
- Refuse with exit 30 if a live daemon is already recorded in the PID file.
- Pick the requested port, or a free one when
--portis 0. - Spawn
python -m orca.daemon --port <port>detached (CREATE_NO_WINDOWplus a new process group on Windows,start_new_sessionon POSIX). - Capture the child's output to
~/.orca/daemon_startup.erruntil the daemon's own logging takes over. - Poll
GET /healthfor up to 60 seconds. A first start on a fresh install compiles every module it imports, which can take 20 seconds. - Read back the PID file the daemon wrote for itself.
If the health probe times out, the CLI stops the daemon it spawned, exits 50, and prints the tail of daemon_startup.err, so an import error or a crashed dependency is visible without re-running the daemon in the foreground.
Pitfalls:
startdoes not load a system. The daemon is up but idle. Runorca topology mountnext.- Stale PID files: if the daemon was killed without
shutdown, the recorded PID points at a dead process.starttreats that as no daemon and re-spawns.statusreportsno daemon runningand exits 10. - The daemon writes its own PID file. If
/healthanswers but no PID file appears,startexits 1 and points you at~/.orca/daemon.log.
orca topology mount
Builds the daemon's package folder and starts the runtime. It takes no argument. The daemon calls build_topology() in topology.py, then build_workflow(topology) in every workflows/<name>.py, and reads the setup files.
$ orca topology mount
mounted the package folder; runtime is RUNNING
The mount does not choose a run mode. Each run chooses its own with --run-mode; see Run a workflow.
Mounting while a package is already mounted exits 30 and tells you to unload first. A mount can take a while, because the daemon imports your code. While it runs, orca status shows mounting: True.
If the build fails, the error names the file and the reason, and orca runtime status shows it again later.
Two environment variables are read when the daemon starts:
| Variable | Meaning |
|---|---|
ORCA_PACKAGE_DIR | The package folder. Unset, it is the folder orca start ran in. |
ORCA_SIM_SPEEDUP | The speed-up a SIM run gets when it names none. Unset is 100. off means no waiting. |
orca runtime reload
Shuts the runtime down and builds it again from the files on disk. Use it after you add or edit topology.py, a workflow file, a deck layout or a devices/<name>.json.
$ orca runtime reload --reason "added the wash step"
reloaded; 1 workflow(s) registered: my_first_workflow
It is refused while a run or a check run is active. --reason is written on the audit row.
orca workflow load does not work on the local daemon. Add the file to workflows/ and reload.
orca status
One-shot health view of the daemon process and the mounted package.
$ orca status
daemon
pid: 43821
port: 51724
uptime: 754s
system_loaded: True
package_dir: /lab/my_lab
runtime_state: RUNNING
mounting: False
With no daemon running it prints error: no daemon running (run orca start first) and exits 10. It exits 0 whenever the daemon answered, whether or not a package is mounted; read system_loaded.
orca runtime status is the companion read. It prints runtime built, or runtime NOT built with the last build failure and a recovery hint. orca --json runtime status also carries blockers, the list of what is stopping the run. The nine blocker kinds are RUNTIME_NOT_BUILT, DEVICE_FAULT, THREAD_ERROR_PAUSE, EXECUTION_PAUSED, WAITING_ON_A_PARKED_HOLDER, MANUAL_PLACE, MANUAL_REMOVE, MANUAL_STEP and DEVICE_EXTERNAL_CONTROL. See Runtime.
orca unload
Tears down the runtime. The daemon keeps running, ready for another orca topology mount.
$ orca unload
topology unloaded; daemon still running
Unload aborts every non-terminal execution. It cancels each execution task, stops the tick loops, and marks the executions aborted. There is no refusal, no prompt and no --force gate on this verb, so check orca execution list before running it.
To drain gracefully instead: execution close each accepting execution, wait for the threads to reach a terminal state, then unload.
Unloading with nothing mounted exits 30.
orca shutdown
Full stop. Unloads the system if one is loaded, then exits the daemon.
$ orca shutdown
daemon stopped (pid=43821)
With no daemon running it prints no daemon running and exits 0.
If the daemon does not acknowledge POST /shutdown within 180 seconds, the CLI warns, sends SIGTERM to the recorded PID, waits, and removes the PID file if the daemon did not clean up after itself.
To leave the daemon up but drop the system, use unload instead.
See also
- CLI overview: global flags, exit codes and backend resolution.
- Inspect the system: what the mounted topology actually contains.
- Run a workflow: the next step once the package is mounted.
- Topology: how
topology.pyis written. - Runtime: what the runtime is and what starting it does.