Skip to main content
Version: 3.0.0

Code deployment

Use this page when you have added or edited the Python or the setup files that define your lab and want the running daemon to use them.

The daemon builds one package folder: topology.py, one workflows/<name>.py per workflow, and the setup files. There is no push step. You edit the files, then tell the daemon to build again.

Which verb does what​

VerbWhat it does
orca topology mountFirst build of the package folder after orca start.
orca runtime reloadBuild again from the files on disk.
orca runtime statusWhether the runtime is built, and the last build failure.
orca topology getThe topology the runtime is using.
orca workflow list / workflow get <name>The workflows that are loaded.
orca method list / method get <name>The methods that are loaded.

orca workflow load does not work on the local daemon. Add the file to workflows/ and run orca runtime reload.

Change the code​

  1. Edit topology.py, add or edit a file in workflows/, or edit a setup file.
  2. Run orca runtime reload --reason "what changed".
  3. Check the result with orca workflow list.
$ orca runtime reload --reason "added the wash step"
reloaded; 2 workflow(s) registered: my_first_workflow, wash_only

Not every edit needs a reload:

  • A changed teachpoint, access config, move default, grip profile, labware definition or profile applies the next time it is read.
  • A new position, any deck layout change, any devices/<name>.json change and any Python change needs a reload.

Name each workflow file after the workflow it holds, and give it a build_workflow(topology) function that returns the workflow.

Read what is loaded​

orca topology get                   # the topology the runtime is using
orca workflow list
orca workflow get <name> # one workflow's registry summary
orca method get <name> [--workflow <w>]

workflow get and method get return a registry summary, not source. The source is the file in your package folder. method get needs --workflow when the method name exists in more than one workflow, because method names are unique per workflow, not globally. For a readable account of one entity, use orca describe (see Inspect).

Runtime control​

orca runtime reload [--reason "..."]
orca runtime status

reload​

Shuts the runtime down, imports the package again from disk and starts a fresh runtime. The daemon process keeps running. Plates, runs and incidents are kept, because they are in .orca/state.db, not in the runtime.

It is refused while a run or a check run is active, and exits 30 (CONFLICT). Let the runs finish, or close and stop them first with execution close.

status​

$ orca runtime status
runtime built
$ orca runtime status
runtime NOT built
last error type: <exception type>
message: <what failed>
hint: <what to do next>

Call it after any operation that answers runtime_not_ready. The failure shown is the last mount's or reload's.

orca --json runtime status also carries blockers, one list of everything stopping the run, worst first, each entry with the remedies that clear it.

Pitfalls​

  • An edit without a reload does nothing. The runtime holds the modules it imported and will not see a changed Python file until it is told to.
  • A failed reload leaves the runtime not built. The broken file stays on disk. Fix it and reload again. orca runtime status shows what failed.
  • The daemon imports and runs your package at full privilege. Treat the package folder as code you trust.

See also​