-
Notifications
You must be signed in to change notification settings - Fork 3
Setting up a dunedaq v5.1.0 Development Area
20-June-2024 - Work in progress (the following steps have been verified to NOT work) (Thanks to Kurt for making a wonderful "getting started" template)
Reference links:
- general development: software development workflow, DUNE DAQ Software Style Guide
- suggested Spack commands to learn about the characteristics of an existing software area are available here
- an introduction to the "assets" system, which we use to store files that are not code, is here
- testing: NP04 computer inventory
- other: Working Group task lists, List of DUNE-DAQ GitHub teams and repos
- Main grafana dashboard
- Tag Collector
- OKS System Description
- DBE Editor Documentation
-
create a new software area based on the latest nightly build (see step 1.iv for the exact
dbt-create
command to use)-
The steps for this are based on the latest instructions for daq-buildtools
-
As always, you should verify that your computer has access to /cvmfs/dunedaq.opensciencegrid.org
-
If you are using one of the np04daq computers, and need to clone packages, add the following lines to your .gitconfig file (once you do this, there will be no need to activate the web proxy each time you log in, and this means that you won't forget to disable it...):
[http] proxy = http://np04-web-proxy.cern.ch:3128 sslVerify = false
-
Here are the steps for creating the new software area:
cd <directory_above_where_you_want_the_new_software_area> source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh setup_dbt latest dbt-create -q -n NFD_DEV_240620_A9 <work_dir> cd <work_dir>
-
Please note that if you are following these instructions on a computer on which the DUNE-DAQ software has never been run before, there are several system packages that may need to be installed on that computer. These are mentioned in this script. To check whether a particular one is already installed, you can use a command like
yum list libzstd
and check whether the package is listed underInstalled Packages
.
-
-
add the needed repositories to the /sourcecode area.
-
decide if you want the very latest code, or a more stable set of packages that has been verified to work.
Run this command to select the very latest code
export use_very_latest_dunedaq_code=1
-
clone the repositories (the following block has some extra directory checking; it can all be copy/pasted into your shell window)
# change directory to the "sourcecode" subdir, if possible and needed if [[ -d "sourcecode" ]]; then cd sourcecode fi # double-check that we're in the correct subdir current_subdir=`echo ${PWD} | xargs basename` if [[ "$current_subdir" != "sourcecode" ]]; then echo "" echo "*** Current working directory is not \"sourcecode\", skipping repo clones" else # finally, do the repo clone(s) # We always get appmodel so that we can look at the configurations # If you want to run the dfmodules unit tests, clone dfmodules as well #if [ ${use_very_latest_dunedaq_code:-0} -eq 1 ]; then git clone https://github.com/DUNE-DAQ/appmodel.git -b develop git clone https://github.com/DUNE-DAQ/dfmodules.git -b develop #else #fi cd .. fi
-
-
setup the work area, possibly install the latest nanorc version, and build the software
source env.sh dbt-build -j 20 dbt-workarea-env
-
dfmodules
contains unit tests which have been updated to use OKS, they can be run withdbt-unittest-summary.sh
-
When you return to working with the software area after logging out, the steps that you'll need to redo are the following:
cd <work_dir>
source ./env.sh dbt-build # if needed dbt-workarea-env # if needed
-
We still need a configuration "boot.json" file to instantiate applications in NanoRC. Create a configuration directory (e.g.
test_config
) and create a link to the sample boot.json:mkdir test_config && cd test_config if [ -f ../sourcecode/appmodel/test/boot.json ];then ln -s ../sourcecode/appmodel/test/boot.json else wget https://github.com/DUNE-DAQ/appmodl/raw/develop/test/boot.json fi cd ..
A few notes on the sample file:
- Since this is a pre-generated boot.json, it defaults to starting the Connectivity Service on port 15000.
- This configuration starts the ru-01, ru-02, ru-03, df-01, df-02, df-03, dfo-01, and ta-01 apps defined in the OKS database
- The OKS "database" file is in
sourcecode/appmodel/test/config
and contains the rest of the configuration information. - You can test the SmartDaqApplication generation of modules and connections using
listApps test-session sourcecode/appmodel/test/config/test-session.data.xml generate_modules_test test-session <app_name> sourcecode/appmodel/test/config/test-session.data.xml # <app_name> is one of the apps listed by listApps
-
nanorc --partition-number <num> <config name> test-session boot conf wait 10 start_run <run number> wait 60 stop_run scrap terminate
- e.g.
nanorc --partition-number 2 test_config test-session boot conf wait 10 start_run 111 wait 60 stop_run scrap terminate
- or, you can simply invoke
nanorc --partition-number 2 test_config test-session
by itself and input the commands individually - Note that the session name "test-session" refers to the OKS configuration database https://github.com/DUNE-DAQ/appmodel/blob/develop/test/config/test-session.data.xml
- e.g.
- The current example configuration is here: https://github.com/DUNE-DAQ/appmodel/blob/develop/test/config/test-session.data.xml
- It consists of several files in both appmodel/test/config (configuration-specific) and appmodel/config/appmodel (somewhat more generic)
-
test-session.data.xml
is the main entry point for this configuration; it includes the other data files and defines the high-level objects like the Session, the DetectorConfig, and some of the Service entries. -
hosts.data.xml
defines the hosts and processing resources -
wiecconfs.data.xml
defines the "front end" electronics configuration -
ru-segment.data.xml
defines the readout applications (ru-01, ru-02, ru-03) -
df-segment.data.xml
defines the dataflow applications (df-01, df-02, df-03 and dfo-01) and their module configurations except -
trigger-segment.data.xml
defines the trigger applications (tc-maker-1, mlt and hsi-to-tc-app) and its module configurations -
data-store-params.data.xml
defines the output file configuration for the dataflow apps -
fsm.data.xml
defines the state machine and the supported transition commands -
connections.data.xml
defines the Network and Queue connection rules used to generate appropriate endpoints in the SmartDaqApplications -
moduleconfs.data.xml
contains DAQ Module configuration objects for readout, dataflow, and trigger
-
- These files are placed in the
install/appmodel/share/test/config
directory upon build (via thedaq_install()
CMake command, based on their location inappmodel/test/config
), where OKS can find them - To create a new configuration, we are currently limited to copying files from an existing configuration, but tools are in development to generate the readout map from an existing one.
- The data and schema XML files can be edited manually or by running the graphical dbe editors
dbe_main
andschemaeditor
. To enable use of the dbe editors, you must first run the commandspack load dbe
thendbe_main -f /path/to/file
for editing data files orschemaeditor -f /path/to/file
for editing schema files.
- Log into the EHN1 DAQ cluster.
- setup a work area with a fresh nightly (NFD_DEV_240621_A9++)
- Clone appmodel (develop) and build it in your work area.
- Copy into the directory from where you want to run the directory
appmodel/test/test-crp4
. - Launch nanorc using the command:
nanorc ./test-crp4 crp4-oks-session
- You will be able to look at monitoring metrics and errors using grafana (v5 dashboards).
-
dbt-release-info
# prints out the release type and name, and the base release name (version) -
dbt-pkg-info <dunedaq_package_name>
# prints out the package version and commit hash used by the release -
dbt-src-status
# prints out the branch names of source repos under sourcecode, and marks those with local changes with "*" -
spack find --loaded -N <external_package_name>
, e.g.spack find --loaded -N boost
# prints out the version of the specified external package that is in use in the current software area -
spack info fddaq
# prints out the packages that are included in thefddaq
bundle for the current software area -
spack info dunedaq
# prints out the packages that are included in thedunedaq
(common) bundle for the current software area
Also see here.
When running with nanorc, metrics reports appear in the info_*.json
files that are produced (e.g. info_dataflow_<portno>.json
). We can collate these, grouped by metric name, using python -m opmonlib.info_file_collator info_*.json
(default output file is opmon_collated.json
).
It is also possible to monitor the system using a graphic interface.
Here are suggested steps for enabling and viewing debug messages in the TRACE memory buffer:
- set up your software area, if needed (e.g.
cd <work_dir>; source ./dbt-env.sh ; dbt-workarea-env
) -
export TRACE_FILE=$DBT_AREA_ROOT/log/${USER}_dunedaq.trace
- this tells TRACE which file on disk to use for its memory buffer, and in this way, enables TRACE in your shell environment and in subsequent runs of the system with
nanorc
.
- this tells TRACE which file on disk to use for its memory buffer, and in this way, enables TRACE in your shell environment and in subsequent runs of the system with
- run the application using the
nanorc
commands described above- this populates the list of already-enabled TRACE levels so that you can view them in the next step
- run
tlvls
- this command outputs a list of all the TRACE names that are currently known, and which levels are enabled for each name
- TRACE names allow us to group related messages, and these names typically correspond to the name of the C++ source file
- the bitmasks that are relevant for the TRACE memory buffer are the ones in the "maskM" column
- enable levels with
tonM -n <TRACE NAME> <level>
- for example,
tonM -n DataWriter DEBUG+5
(where "5" is the level that you see in theTLOG_DEBUG
statement in the C++ code)
- for example,
- re-run
tlvls
to confirm that the expected level is now set - re-run the application
- view the TRACE messages using
tshow | tdelta -ct 1 | more
- note that the messages are displayed in reverse time order
A couple of additional notes:
- For debug statements in our code that look like
TLOG_DEBUG(5) << "test, test";
, we would enable the output of those messages using a shell command liketonM -n <TRACE_NAME> DEBUG+5
. A couple of notes on this...- when we look at the output of the bitmasks with the
tlvls
command, bit #5 is going to be offset by the number of bits that TRACE and ERS reserve for ERROR, WARNING, INFO, etc. messages. At the moment, the offset appears to be 8, so the setting of bit "DEBUG+5" corresponds to setting bit #13. - when we view the messages with
tshow
, one of the columns in its output shows the level associated with the message (the column heading is abbreviated as "lvl"). Debug messages are prefaced with the letter "D", and they include the number that was specified in the C++ code. So, for our example of level 5, we would see "D05" in thetshow
output for the "test, test" messages.
- when we look at the output of the bitmasks with the
- There are many other TRACE 'commands' that allow you to enable and disable messages. For example,
-
tonMg <level>
enables the specified level for all TRACE names (the "g" means global in this context) -
toffM -n <TRACE NAME> <level>
disables the specified level for the specified TRACE name -
toffMg <level>
disables the specified level for all TRACE names -
tlvlM -n <TRACE name> <mask>
explicitly sets (and un-sets) the levels specified in the bitmask
-