Skip to content

Running drunc

Pierre Lasorak edited this page Jun 12, 2024 · 8 revisions

Running drunc

You will need 1 terminal windows open, and have drunc setup (by sourcing the same env.sh from the DAQ dev area explained here).

This shell will be used to run the process manager, the process manager CLI and root controller CLI:

drunc-unified-shell file://<where_drunc_is>/data/process-manager-CERN-kafka.json ## or data/process-manager-no-kafka.json or data/process-manager-pocket-kafka.json
<snip>
ProcessManager was started on 0.0.0.0:10054
drunc-unified-shell >

Now let us start the DAQ processes, it will send a message to the process manager:

drunc-unified-shell > boot test/config/test-sesssion.data.xml test-session # to run the appdal configuration in [here](https://github.com/DUNE-DAQ/appdal/blob/develop/test/config/test-session.data.xml)
drunc-unified-shell > ps
                                            Processes running
┏━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━┓
┃ session      ┃ user     ┃ friendly name   ┃ uuid                                 ┃ alive ┃ exit-code ┃
┑━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━┩
β”‚ session-name β”‚ plasorak β”‚ dataflow0       β”‚ 15f32283-b920-4e0b-9746-ea146f2889ad β”‚ True  β”‚ 0         β”‚
β”‚ session-name β”‚ plasorak β”‚ dfo             β”‚ 498bf1e6-78a5-42a1-a429-2b56c5e942ae β”‚ True  β”‚ 0         β”‚
β”‚ session-name β”‚ plasorak β”‚ fakehsi         β”‚ d9a471da-acde-47ae-abe3-98d7f5c1abaa β”‚ True  β”‚ 0         β”‚
β”‚ session-name β”‚ plasorak β”‚ rulocalhosteth0 β”‚ fc76d990-d32d-44ce-be98-f45c28e1c4cd β”‚ True  β”‚ 0         β”‚
β”‚ session-name β”‚ plasorak β”‚ trigger         β”‚ b3082787-3039-4df9-bcf9-3d137bea8faf β”‚ True  β”‚ 0         β”‚
β”‚ session-name β”‚ plasorak β”‚ root-controller β”‚ 81901dc8-3417-4870-8ea4-d222fd9a9e12 β”‚ True  β”‚ 0         β”‚
β”‚ ...          β”‚ ...      | ...             | ...                                  | ...   | ...       |
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

We have started a couple of processes, the standard DAQ applications, and a root-controller that will control them. The logs and work directory is the ${PWD} where you executed the drunc-unified-shell.

To kill the processes, you can do

drunc-unified-shell > kill --user plasorak
# or
drunc-unified-shell > kill --session test-session
# or
drunc-unified-shell > kill --name dfo

There are many more functionalities to the shell, head over to the process manager CLI documentation to see how to interact with it.

Next, let's send commands to the root-controller. These commands will be propagated by it to other applications, to see which application a controller controls, you can use ls:

drunc-unified-shell > ls
['ru-controller', 'df-controller', 'trg-controller', 'hsi-controller']
drunc-unified-shell > describe
                                                        root-controller.test-session (controller) commands
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name                ┃ input type                 ┃ return type                       ┃ help                                                                ┃
┑━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ describe            β”‚ None                       β”‚ request_response_pb2.Description  β”‚ Describe self (return a list of commands, the type of endpoint, the β”‚
β”‚                     β”‚                            β”‚                                   β”‚ name and session).                                                  β”‚
β”‚ get_children_status β”‚ generic_pb2.PlainText,None β”‚ controller_pb2.ChildrenStatus     β”‚ Get the status of all the children. Only get the status from the    β”‚
β”‚                     β”‚                            β”‚                                   β”‚ child if provided in the request.                                   β”‚
β”‚ get_status          β”‚ None                       β”‚ controller_pb2.Status             β”‚ Get the status of self                                              β”‚
β”‚ ls                  β”‚ None                       β”‚ generic_pb2.PlainTextVector       β”‚ List the children                                                   β”‚
β”‚ describe_fsm        β”‚ None                       β”‚ request_response_pb2.Description  β”‚ List available FSM commands for the current state.                  β”‚
β”‚ execute_fsm_command β”‚ controller_pb2.FSMCommand  β”‚ controller_pb2.FSMCommandResponse β”‚ Execute an FSM command                                              β”‚
β”‚ include             β”‚ None                       β”‚ controller_pb2.FSMCommandResponse β”‚ Include self in the current session, if a children is provided,     β”‚
β”‚                     β”‚                            β”‚                                   β”‚ include it and its eventual children                                β”‚
β”‚ exclude             β”‚ None                       β”‚ controller_pb2.FSMCommandResponse β”‚ Exclude self in the current session, if a children is provided,     β”‚
β”‚                     β”‚                            β”‚                                   β”‚ exclude it and its eventual children                                β”‚
β”‚ take_control        β”‚ None                       β”‚ generic_pb2.PlainText             β”‚ Take control of self and children                                   β”‚
β”‚ surrender_control   β”‚ None                       β”‚ generic_pb2.PlainText             β”‚ Surrender control of self and children                              β”‚
β”‚ who_is_in_charge    β”‚ None                       β”‚ generic_pb2.PlainText             β”‚ Get who is in control of self                                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

drunc-unified-shell > describe --command fsm
                           root-controller.test-session (controller) commands
┏━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━━━┓
┃ name ┃ input type                ┃ return type                       ┃ help ┃ Command arguments ┃
┑━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━━━━━━┩
β”‚ conf β”‚ controller_pb2.FSMCommand β”‚ controller_pb2.FSMCommandResponse β”‚      β”‚                   β”‚
β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
drunc-unified-shell > fsm conf
<snip>
                   conf execution report
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Name                 ┃ Command execution ┃ FSM transition ┃
┑━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
β”‚ root-controller      β”‚ success           β”‚ success        β”‚
β”‚   hsi-controller     β”‚ success           β”‚ success        β”‚
β”‚     hsi-01           β”‚ success           β”‚ success        β”‚
β”‚   ru-controller      β”‚ success           β”‚ success        β”‚
β”‚     ru-01            β”‚ success           β”‚ success        β”‚
β”‚   trg-controller     β”‚ success           β”‚ success        β”‚
β”‚     tc-maker-1       β”‚ success           β”‚ success        β”‚
β”‚     mlt              β”‚ success           β”‚ success        β”‚
β”‚     hsi-to-tc-app    β”‚ success           β”‚ success        β”‚
β”‚   df-controller      β”‚ success           β”‚ failed         β”‚
β”‚     tp-stream-writer β”‚ success           β”‚ success        β”‚
β”‚     df-01            β”‚ success           β”‚ success        β”‚
β”‚     df-02            β”‚ success           β”‚ success        β”‚
β”‚     dfo-01           β”‚ failed            β”‚ failed         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
drunc-unified-shell > describe --command fsm
                                                topcontroller.session-name (controller) commands
┏━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name  ┃ input type                ┃ return type                       ┃ help ┃ Command arguments                                          ┃
┑━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ start β”‚ controller_pb2.FSMCommand β”‚ controller_pb2.FSMCommandResponse β”‚      β”‚ run_number (INT OPTIONAL) default: 1 help:                 β”‚
β”‚       β”‚                           β”‚                                   β”‚      β”‚ disable_data_storage (BOOL OPTIONAL) default: False help:  β”‚
β”‚       β”‚                           β”‚                                   β”‚      β”‚ trigger_rate (FLOAT OPTIONAL) default: 1.0 help:           β”‚
β”‚ scrap β”‚ controller_pb2.FSMCommand β”‚ controller_pb2.FSMCommandResponse β”‚      β”‚                                                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
drunc-unified-shell > fsm start

Etc.

Let's take the DAQ for a spin:

drunc-unified-shell > fsm enable_triggers
[...we wait for a bit of time, to get a file...]
drunc-unified-shell > fsm disable_triggers
drunc-unified-shell > fsm drain_dataflow
drunc-unified-shell > fsm stop_trigger_sources
drunc-unified-shell > fsm stop
drunc-unified-shell > fsm scrap

Several things to note:

  • There is a profusion of logging that happens. This is coming from the asynchronous logging from the controller. If someone tries to connect at the same time or to execute a command you will see it appearing on your shell too (you can try it yourself in a different shell). Unfortunately CLIs do not lend itself very well with this, and one needs a better UI for the logs to be rendered better and to not distract.
  • The describe command describes the endpoint NOT the shell. This means that there are some commands that are not directly available in the shell (for example get_children_status). However if you do status is the shell, you will get the children statuses because the shell calls get_children_status under the hood.
  • The sequence commands (start_run, shutdown etc.) are not available (yet). This means if you start the run, you will need to manually drain_dataflow, stop_trigger_sources and stop.

You can now head to the controller CLI documentation for more information.

Shutting down

drunc-unified-shell > kill --session test-session
drunc-unified-shell > quit
Clone this wiki locally