|
20 | 20 | ```bash |
21 | 21 | $ occlib/examples/dummy-process/occexample-dummy-process --control-port <some port> |
22 | 22 | ``` |
| 23 | +or |
| 24 | +```bash |
| 25 | +$ OCC_CONTROL_PORT=<some port> occlib/examples/dummy-process/occexample-dummy-process |
| 26 | +``` |
| 27 | + |
| 28 | +The dummy process now waits for control commands. |
| 29 | + |
| 30 | +## Single process control with `peanut` |
| 31 | + |
| 32 | +`peanut` is the Process Execution And coNtrol UTility for OCClib-based O² processes. Its purpose |
| 33 | +is to be a debugging and development aid for non-FairMQ O² devices, where FairMQ's interactive |
| 34 | +controller is not available. |
| 35 | + |
| 36 | +In aliBuild it is part of the Control-core package. |
| 37 | + |
| 38 | +`peanut` can connect to a running OCClib-based process, query its status, drive its state machine |
| 39 | +and push runtime configuration data. |
| 40 | + |
| 41 | +Peanut is an interactive tool, the only information it picks up from its environment is the |
| 42 | +`OCC_CONTROL_PORT` variable, which is used to connect to a running OCClib-based process. |
| 43 | + |
| 44 | +```bash |
| 45 | +$ OCC_CONTROL_PORT=<some port> peanut |
| 46 | +``` |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +Peanut commands are documented inline. Each transition is applied immediately and |
| 51 | +the state is updated in real time. |
| 52 | + |
| 53 | +Compared to the raw gRPC API, the following limitations apply: |
| 54 | +* It is not possible to perform a `GO_ERROR` transition, as this transition is only triggered from |
| 55 | +user code. |
| 56 | +* The `CONFIGURE` transition may be triggered both with and without runtime configuration data, which |
| 57 | +may or may not be suitable depending on user code. All other transitions send no payload. |
| 58 | + |
| 59 | +The last two commands are **not** transitions: |
| 60 | +* `Load configuration` allows the user to read in a JSON or YAML file containing sample |
| 61 | +configuration data that is then available to be pushed to the controlled process during a future |
| 62 | +`CONFIGURE` transition. On startup, there is no file loaded, so a `CONFIGURE` transition will push |
| 63 | +an empty payload. Once a runtime configuration file is loaded, its title bar reports `NOT PUSHED` |
| 64 | +until the next `CONFIGURE` transition, at which point it becomes `PUSHED`. |
| 65 | +* `Quit` disconnects from the controlled process and quits `peanut`, but it performs no transitions |
| 66 | +or other data exchange with the controlled process. A future instance of `peanut` may reattach itself |
| 67 | +to the same process and continue from there. |
| 68 | + |
| 69 | +## OCC API debugging with `grpcc` |
23 | 70 |
|
24 | | -The dummy process now waits for control commands. We can send them manually with an interactive gRPC client |
| 71 | +We can send gRPC-based OCC commands manually with an interactive gRPC client |
25 | 72 | like [`grpcc`](https://github.com/njpatel/grpcc): |
26 | 73 | ```bash |
27 | 74 | $ sudo yum install http-parser nodejs npm |
|
0 commit comments