DUNE-DAQ / timinglibs

0 stars 1 forks source link

Adding timing database #109

Closed dianaAntic closed 3 months ago

dianaAntic commented 5 months ago

To verify the functionality of the OKS configuration, the testing of nanotimingrc on real hardware was required.

This PR adds the required database file for setting up the minimal OKS configuration for a successful RC run.

To test, I ran the following command on kipper in a recent work env NFD_DEV_240507_C8: nanotimingrc --partition-number 7 timinglibs/test_config/ test-session making sure that the name of the test session matches the name given in this object: <obj class="Session" id="test-session"> in the data file. The folder timinglibs/test_config/ must include a boot.json file which contains the necessary setup for the RC run - the following is the json content I used:

{
    "apps": {
        "thi": {
            "exec": "daq_application_ssh",
            "host": "thi",
            "port": 3333
        },
        "tmc": {
            "exec": "daq_application_ssh",
            "host": "tmc",
            "port": 3334
        }
    },
    "env": {
        "DUNEDAQ_ERS_DEBUG_LEVEL": "getenv_ifset",
        "DUNEDAQ_ERS_ERROR": "erstrace,throttle,lstdout",
        "DUNEDAQ_ERS_FATAL": "erstrace,lstdout",
        "DUNEDAQ_ERS_INFO": "erstrace,throttle,lstdout",
        "DUNEDAQ_ERS_VERBOSITY_LEVEL": "getenv:1",
        "DUNEDAQ_ERS_WARNING": "erstrace,throttle,lstdout"
    },
    "exec": {
        "consvc_ssh": {
            "args": [
                "--bind=0.0.0.0:{APP_PORT}",
                "--workers=1",
                "--worker-class=gthread",
                "--threads=2",
                "--timeout=0",
                "--pid={APP_NAME}_{APP_PORT}.pid",
                "connection-service.connection-flask:app"
            ],
            "cmd": "gunicorn",
            "env": {
                "CONNECTION_FLASK_DEBUG": "getenv:2",
                "PATH": "getenv",
                "PYTHONPATH": "getenv"
            }
        },
        "daq_application_ssh": {
            "args": [
                "--name",
                "{APP_NAME}",
                "-c",
                "{CMD_FAC}",
                "-i",
                "{INFO_SVC}",
                "--configurationService",
                "oksconfig:config/timing.data.xml"
            ],
            "cmd": "daq_application",
            "comment": "Application profile using PATH variables (lower start time)",
            "env": {
                "CET_PLUGIN_PATH": "getenv",
                "CMD_FAC": "rest://localhost:{APP_PORT}",
                "CONNECTION_SERVER": "kipper.phy.bris.ac.uk",
                "DETCHANNELMAPS_SHARE": "getenv",
                "DUNEDAQ_DB_PATH": "getenv",
                "DUNEDAQ_SHARE_PATH": "getenv",
                "INFO_SVC": "file://info_{APP_NAME}_{APP_PORT}.json",
                "LD_LIBRARY_PATH": "getenv",
                "PATH": "getenv",
                "TIMING_SHARE": "getenv",
                "TRACE_FILE": "getenv:/tmp/trace_buffer_{APP_HOST}_{DUNEDAQ_PARTITION}"
            }
        }
    },
    "external_connections": [],
    "hosts-ctrl": {
        "connectionservice": "kipper.phy.bris.ac.uk",
        "thi": "kipper.phy.bris.ac.uk",
        "tmc": "kipper.phy.bris.ac.uk"
    },
    "hosts-data": {
        "thi": "kipper.phy.bris.ac.uk",
        "tmc": "kipper.phy.bris.ac.uk"
    },
    "response_listener": {
        "port": 56789
    },
    "services": {
        "connectionservice": {
            "exec": "consvc_ssh",
            "host": "connectionservice",
            "port": 5000,
            "update-env": {
                "CONNECTION_PORT": "{APP_PORT}"
            }
        }
    }
}

Also, for the TimingHardwareInterface object, a connections_file is required and this is the content of the one whose path I used:

<?xml version="1.0" encoding="UTF-8"?>

<connections>
  <connection id="TEST_CTL"          uri="ipbusudp-2.0://192.168.200.16:50001" address_table="file://${TIMING_SHARE}/config/etc/addrtab/v7xx/master/top.xml" />
  <connection id="TEST_EPT"          uri="ipbusudp-2.0://192.168.200.41:50001" address_table="file://${TIMING_SHARE}/config/etc/addrtab/v7xx/endpoint_fmc/top.xml" />
</connections>

which is a Controller-Endpoint connection that's currently connected and ping-able in the Bristol lab.