Skip to content
Gordon Crone edited this page Dec 1, 2023 · 4 revisions

How to run Request-based listrev configured from OKS

Required packages

First checkout the feature/OKS branch of the following packages

  • DUNE-DAQ/listrev
  • DUNE-DAQ/appfwk
  • DUNE-DAQ/coredal

Building the software

Just run dbt-build as usual. There are no special procedures to follow now.

Running nanorc with the example configuration

The listrev package has an example OKS configuration in the config directory. To tell nanorc how to boot it, create a directory say lr for example and add the following boot.json file to it.

{
    "apps": {
         "listrev": {
            "exec": "daq_application_ssh",
            "host": "listrev",
            "port": 3333
         },
         "listrev-g1": {
            "exec": "daq_application_ssh",
            "host": "listrev",
            "port": 3334
         },
         "listrev-g2": {
            "exec": "daq_application_ssh",
            "host": "listrev",
            "port": 3335
        }
    },
    "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/lrSession.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": "localhost",
                "DETCHANNELMAPS_SHARE": "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": "localhost",
        "listrev": "localhost"
    },
    "hosts-data": {
        "listrev": "localhost"
    },
    "response_listener": {
        "port": 56789
    },
    "services": {
        "connectionservice": {
            "exec": "consvc_ssh",
            "host": "connectionservice",
            "port": 15000,
            "update-env": {
                "CONNECTION_PORT": "{APP_PORT}"
            }
        }
    }
}

Then run nanorc with the command nanorc lr lr-session and proceed as usual.