Skip to content
Draft
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6961311
Preliminary changes to support user-specified multiple control apps
Jul 26, 2026
1b36890
Merge remote-tracking branch 'origin/kbiery/drunc_output_checking' in…
Jul 26, 2026
0e30dc9
Merge remote-tracking branch 'origin/develop' into kbiery/multi_ctrl_…
Jul 27, 2026
2bba24e
next round of changes for multi-process support.
Jul 27, 2026
9cfeeeb
Merge remote-tracking branch 'origin/kbiery/updated_drunc_debug_logfi…
Jul 28, 2026
65c1fce
Added back support for dunerc_options in the async process startups
Jul 28, 2026
1b38c71
Modified the times displayed in integtest_proc_mgmt messages to be in…
Jul 28, 2026
0938bcd
Removed the obsolete --dunerc-fullprint-watch-string option from inte…
Jul 28, 2026
c8ec130
Renamed some vars and data members associated with the intg_proc_mgmt…
Jul 28, 2026
32a326d
Avoid using process aliases in the intg_proc_mgmt for persistent obje…
Jul 28, 2026
736dec1
Merge remote-tracking branch 'origin/develop' into kbiery/multi_ctrl_…
Jul 29, 2026
bcd2910
Fixed problems when multiple confgens or pm types are requested in an…
Jul 29, 2026
81acad4
Modified the handling of run-control-app options so that they are pas…
Jul 29, 2026
c07c4df
Added excluded logfile strings in the PM logfile when drunc-debug is …
Jul 29, 2026
36fc1f6
Merge remote-tracking branch 'origin/develop' into kbiery/multi_ctrl_…
Aug 4, 2026
45c9f95
Fixed merge errors in log_file_checks.py
Aug 4, 2026
9b88f9a
Fixed the precedence of the daq_session_ingredients variable when cal…
Aug 4, 2026
2f1211c
Fixed the spelling of parameterizations in several locations in integ…
Aug 4, 2026
8719efb
Added document with information about the special variables that are …
Aug 4, 2026
0fe60d9
Added information to the Special Variable document
bieryAtFnal Aug 4, 2026
7e3a36f
Enhance documentation for DAQ session ingredients
bieryAtFnal Aug 5, 2026
be5248f
Added information about placeholder strings in DAQSessionApp startup …
Aug 5, 2026
d4e6511
Added more detail about placeholder strings in InformationAboutSpecia…
Aug 5, 2026
f15cad5
Update documentation for DAQSessionIngredients usage
bieryAtFnal Aug 5, 2026
d3c66c1
Minor edits
bieryAtFnal Aug 5, 2026
a2bebd6
Fixed basic_multiapp_test.py name
Aug 5, 2026
da87d7d
minor change
Aug 5, 2026
df87bfd
Merge remote-tracking branch 'origin/develop' into kbiery/multi_ctrl_…
Aug 6, 2026
30b2df1
Added logic to async_proc_mgmt::read_stream to remove any command pro…
Aug 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions docs/InformationAboutSpecialVariables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Special variables that are used by the integrationtest infrastructure

05-Aug-2026, Kurt Biery

## Introduction

In the Pytest files that we write (our integtests), there are several special variables that are used to communication information about the desired conditions of the testing to the `integrationtest` infrastructure. This information includes things such as configuration parameters and run control commands.

This document describes the special variables that are currently available and how they can, and should, be used.

### Computer resource validation parameters

This is communicated by the `resource_validator` special variable. It should point to an instance of the `ResourceValidator` class. This class is defined in [integrationtest/src/integrationtest/resource_validation.py](https://github.com/DUNE-DAQ/integrationtest/blob/develop/src/integrationtest/resource_validation.py).

(More details coming soon.)

### Integrationtest and DAQ system configuration parameters

This is communicated by the `confgen_arguments` special variable.

(More details coming soon.)

### Run control process manager type(s)

This is communicated by the `process_manager_choices` special variable.

(More details coming soon.)

### Run control commands or full DAQ session ingredients

These are communicated either by the `dunerc_command_list` or the `daq_session_ingredients` special variable. Only one of these two variables should be specified in a single integtest file, but if both of them happen to be specified in the same integtest, the `daq_session_ingredients` takes precedence.

The purposes of these two variables are similar - both provide commands that should be run by one or more run control applications - but the `daq_session_ingredients` variable is more powerful in that it allows users to specify one or more applications that should be run, instead of simply using the `drunc-unified-shell`.

Information about `dunerc_command_list`:

* this is the variable that has been used historically, and many of our existing integtests use it.
* it is expected to contain a Python list of the commands (strings) that are passed to run control in "batch" mode
* some examples:
* `dunerc_command_list = ("boot conf start --run-number 101 wait 1 enable-triggers wait ".split() + [str(run_duration)] + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop scrap terminate".split())`
* `dunerc_command_list = ["boot", "conf", "start", "--run-number", "101", "wait", str(1), "enable-triggers", "wait", str(20), "disable-triggers", "stop-run", "shutdown"]`
* in addition to containing a single list of commands (as shown above), this variable can contain a dictionary of one or more lists of commands. With this functionality, multiple DAQ sessions with different sets of commands can be run from an single integtest.
* here is an example of this type declaration:
* `dunerc_command_list = {"DAQ_Session_1": ["boot", "conf", "start", "--run-number", "101", "wait", str(1), "enable-triggers", "wait", str(20), "disable-triggers", "stop-run", "shutdown"], "DAQ Session 2": ["boot", "conf", "start", "--run-number", "101", "wait", str(3), "enable-triggers", "wait", str(20), "disable-triggers", "stop-run", "scrap", "terminate"]}`

Information about `daq_session_ingredients`:
* this variable was recently introduced so that developers of integtests can specify multiple control applications to be run in a given (integtest) DAQ session
* at the moment, this variable needs to contain a dictionary with one or more elements, and each element should contain a string key (with a word or phrase that describes the DAQ session) and an instance of the `DAQSessionIngredients` class as the value. The `DAQSessionIngredients` class is defined in [integrationtest/src/integrationtest/data_classes.py](https://github.com/DUNE-DAQ/integrationtest/blob/0fe60d9b1c1aa697ec9524c4aaf1507aaa3c6b2a/src/integrationtest/data_classes.py#L139).
* the `DAQSessionIngredients` class has data members that allow developers to specify the applications that should be run and the commands that should be sent to the applications. In this class, applications are represented by instances of the `DAQSessionApp` class and commands are listed in instances of the `DAQCommandSet` class. The `DAQCommandSet` has a field that specifies the application that we want to send the commands to.
* the [basic_multiapp_test.py](https://github.com/DUNE-DAQ/drunc/blob/kbiery/multi_ctrl_proc_support/src/drunc/integtest/basic_multiapp_test.py) regression test in the `drunc` repo has an example of specifying three applications to be run in the DAQ session and specifying commands that are sent to two of those applications.
* For reference, the relevant lines from `basic_multiapp_test.py` are copied below.
* There are several strings that are dynamically determined by the `integrationtest` infrastructure that we may want to include in the `startup_strings` field in our `DAQSessionApp` declarations. To take this into account, placeholder strings have been defined. These placeholder strings can be used in `DAQSessionApp` declarations and the `integrationtest` infrastructure will substitute the appropriate value at runtime. The placeholders that are currently available are the following:
* `<proc_mgr_choice>` - the process manager type that should be used in the DAQ session
* recall that the `integrationtest` infrastructure has support for user-specified (dynamic) process manager types. If we don't want to make use of that functionality, we can hard-code the process manager type in our `DAQSessionApp.startup_strings`. Of course, that reduces flexibility, but there may be cases where it would make sense.
* `<config_data_file>` - the configuration data file that the infrastructure has created for the integtest
* this placeholder string should always be used since the `integrationtest` infrastructure creates a new, temporary config data file for each running of an integtest
* `<config_session_name>` - the name of the configuration session that should be used for the DAQ session
* this could be hard-coded, but it is safer to let it get filled in dynamically
* `<daq_session_name>` - the name that should be used to identify the DAQ session
* this placeholder can be used, or the name of the DAQ session could be hard-coded in the `startup_strings`
* when an integration test is run with verbosity level of 4 or greater, the command lines that are used to start the applications are printed on the console, and this output can be used to check if the desired substitutions were made

Here is a snippet of code from the `basic_multapp_test.py` that shows how the `DAQSessionIngredients` are constructed in that integtest:

```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going through the docs (very complete and well written btw, thanks!) and a minor suggestion:

Suggested change
```
```python

As this bit of code is Python, flavoring this codeblock with the programming language will allow GitHub to do the linting so it looks more legible.

Example

# The commands to run in dunerc and the process manager shell
dunerc_commands_1 = (
    "boot conf start --run-number 101 wait 1 enable-triggers wait ".split()
    + [str(run_duration)] + ["disable-triggers"]
)
dunerc_commands_2 = (
    "drain-dataflow stop-trigger-sources stop wait 2 scrap terminate".split()
)
pmshell_command = ["ps"]

vs

# The commands to run in dunerc and the process manager shell
dunerc_commands_1 = (
    "boot conf start --run-number 101 wait 1 enable-triggers wait ".split()
    + [str(run_duration)] + ["disable-triggers"]
)
dunerc_commands_2 = (
    "drain-dataflow stop-trigger-sources stop wait 2 scrap terminate".split()
)
pmshell_command = ["ps"]

# The commands to run in dunerc and the process manager shell
dunerc_commands_1 = (
"boot conf start --run-number 101 wait 1 enable-triggers wait ".split()
+ [str(run_duration)] + ["disable-triggers"]
)
dunerc_commands_2 = (
"drain-dataflow stop-trigger-sources stop wait 2 scrap terminate".split()
)
pmshell_command = ["ps"]

# Find a free network port to use for the process manager
pm_port = find_free_port(50020, 52000)

# The command lines that should be used to start the applications
procmsg_startup_commands = ["drunc-process-manager", "<proc_mgr_choice>", str(pm_port)]
pmapp = DAQSessionApp("pm", procmsg_startup_commands)

pmshell_startup_commands = ["drunc-process-manager-shell", f"grpc://localhost:{pm_port}"]
pmshellapp = DAQSessionApp("pmshell", pmshell_startup_commands)

drunc_startup_commands = ["drunc-unified-shell", f"grpc://localhost:{pm_port}", "<config_data_file>", "<config_session_name>", "<daq_session_name>"]
druncapp = DAQSessionApp("drunc", drunc_startup_commands)

# Packaging up the commands into DAQCommandSets
cmd_set_1 = DAQCommandSet("drunc", dunerc_commands_1, CommandWaitParameters(style=CommandWaitStyle.ECHO))
cmd_set_2 = DAQCommandSet("pmshell", pmshell_command, CommandWaitParameters(style=CommandWaitStyle.TIME))
cmd_set_3 = DAQCommandSet("drunc", dunerc_commands_2, CommandWaitParameters(style=CommandWaitStyle.ECHO))
Comment on lines +90 to +92

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you say a few words in the docs about what DAQCommandSet does and what CommandWaitParaameters refer to and their purpose? the command set looks quite self explanatory from the example but I'm still not sure what the CommandWaitParameters are for, especially the difference between ECHO and TIME


# Putting everything together into a DAQSessionIngredients object
app_list = [ pmapp, pmshellapp, druncapp ]
cmd_set_list = [ cmd_set_1, cmd_set_2, cmd_set_3 ]
dsi = DAQSessionIngredients(app_list, cmd_set_list)

# Declare the special variable that tells the integrationtest infrastructure what we want to run
daq_session_ingredients = {"MultiRCAppSession": dsi}
```
Loading