Skip to content

WIP: Add a small wrapper script around xdaq.sh

Louis Moureaux requested to merge feature/xdaq-wrapper into develop

Description

This is about fixing #15 (closed). The current branch adds a wrapper script to start XDAQ applications, but I need input (for instance, how to install it properly is an interesting question).

The script starts the requested applications in a xdaq process running
on a random port. It does so by first querying the OS for a free port
and then writing a temporary xdaq configuration file.

In order to be usable with the script, applications must define a
.template file with the required <xc:Application> and <xc:Module> tags.
All templates are copied into the temporary configuration with some
minor variable substitution. More advanced templating can be added later
if needed.

cmsgemos must be installed for the script to function correctly, and it
must be called from its location within the build directory. More
thinking is required for the installation step, including for how we
want to support Python modules.

Related Issue

Fixes #15 (closed) (started as a way to check the tabs issues described in 95).

How Has This Been Tested?

Started the gemonlinedb manager at a random port.

Screenshots (if appropriate):

$ python3 -m cmsgemos._build.gemcore.run-xdaq gemonlinedb -v
DEBUG:run-xdaq:Trying: ./gemonlinedb.template
DEBUG:run-xdaq:Trying: ./gemonlinedb/gemonlinedb.template
DEBUG:run-xdaq:Trying: ./gemonlinedb/default.template
DEBUG:run-xdaq:Trying: ./gemgemonlinedb/gemgemonlinedb.template
DEBUG:run-xdaq:Trying: ./gemgemonlinedb/default.template
DEBUG:run-xdaq:Trying: /afs/cern.ch/user/l/lmoureau/GEM/cmsgemos/_build/_install/share/gemonlinedb.template
DEBUG:run-xdaq:Trying: /afs/cern.ch/user/l/lmoureau/GEM/cmsgemos/_build/_install/share/gemonlinedb/gemonlinedb.template
DEBUG:run-xdaq:Trying: /afs/cern.ch/user/l/lmoureau/GEM/cmsgemos/_build/_install/share/gemonlinedb/default.template
DEBUG:run-xdaq:Opening test socket on port 0
INFO:run-xdaq:Using http://gem904daq04.cern.ch:58876
DEBUG:run-xdaq:Creating XDAQ configuration file at /tmp/lmoureau/tmp3lv1ysv7.xml
/opt/xdaq/bin/xdaq.sh: ligne25: /opt/xdaq/config/checkos.sh: Aucun fichier ou dossier de ce type

Warning: PLATFORM env. variable not set, guessed to  x86_64_
Warning: OS env. variable not set, guessed to  linux
Run xdaq with options: -p 58876 -c /tmp/lmoureau/tmp3lv1ysv7.xml
LD_LIBRARY_PATH is  /opt/xdaq/lib:/opt/rh/llvm-toolset-7.0/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/httpd24/root/usr/lib64
26 May 2020 16:47:04.591 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - xdaq version: 05.03.01, compiled on Jan  9 2020 at 12:06:04, 64bit
26 May 2020 16:47:04.593 [140710009350336] WARN  ch.cern.gem904daq04.p:58876 <> - Failed to load profile '/etc/default.profile', trying next
26 May 2020 16:47:04.594 [140710009350336] WARN  ch.cern.gem904daq04.p:58876 <> - Failed to load profile '${HOME}/etc/default.profile', trying next
26 May 2020 16:47:04.594 [140710009350336] WARN  ch.cern.gem904daq04.p:58876 <> - Failed to load profile '${XDAQ_ROOT}/share/${XDAQ_ZONE}/profile/default.gem904daq04.cern.ch.profile', trying next
26 May 2020 16:47:04.595 [140710009350336] WARN  ch.cern.gem904daq04.p:58876 <> - Failed to load profile '${XDAQ_ROOT}/share/${XDAQ_ZONE}/profile/default.profile', trying next
26 May 2020 16:47:04.596 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - Loaded profile: ${XDAQ_ROOT}/etc/default.profile
26 May 2020 16:47:04.597 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - core::b2innub version: 02.05.01, compiled on Jan  9 2020 at 12:07:48
26 May 2020 16:47:04.598 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - core::i2outils version: 04.00.00, compiled on Jan  9 2020 at 12:06:36
26 May 2020 16:47:04.601 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - core::executive version: 04.00.06, compiled on Jan  9 2020 at 12:07:24
26 May 2020 16:47:04.607 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - core::pthttp version: 04.05.07, compiled on Jan  9 2020 at 12:06:41
26 May 2020 16:47:04.608 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - core::ptfifo version: 04.03.01, compiled on Jan  9 2020 at 12:07:10
26 May 2020 16:47:04.610 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - core::xrelay version: 04.01.00, compiled on Jan  9 2020 at 12:07:43
26 May 2020 16:47:04.614 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - core::hyperdaq version: 05.02.01, compiled on Jan  9 2020 at 12:07:41
26 May 2020 16:47:04.614 [140710009350336] DEBUG ch.cern.gem904daq04.p:58876 <> - Create application descriptor for class: executive::Application id: 0
26 May 2020 16:47:04.637 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.executive::Application.lid(0) <> - Log URL not set (was already console)
26 May 2020 16:47:04.637 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.executive::Application.lid(0) <> - Changed Log level to INFO
26 May 2020 16:47:04.641 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - Adding header Access-Control-Allow-Origin:*
26 May 2020 16:47:04.641 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - Adding header Access-Control-Allow-Methods:POST, GET, OPTIONS
26 May 2020 16:47:04.641 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - Adding header Access-Control-Allow-Headers:x-requested-with, soapaction
26 May 2020 16:47:04.641 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - Adding expire rule image/png:PT4300H
26 May 2020 16:47:04.641 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - Adding expire rule image/jpg:PT4300H
26 May 2020 16:47:04.641 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - Adding expire rule image/gif:PT4300H
26 May 2020 16:47:04.641 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - Adding expire rule application/x-shockwave-flash:PT120H
26 May 2020 16:47:04.641 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - Adding expire rule application/font-woff:PT8600H
26 May 2020 16:47:04.642 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - Adding expire rule text/css:PT4300H
26 May 2020 16:47:04.642 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.pt::http::PeerTransportHTTP.lid(1) <> - No security policies on this server
26 May 2020 16:47:04.648 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - cmsgemos::onlinedb version: 00.01.00, compiled on May 26 2020 at 15:14:55
26 May 2020 16:47:04.649 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.gem::onlinedb::GEMOnlineDBManager.instance(255) <> - GEMApplication GIT_VERSION:cmsgemos-0.0-38-g81cfe72-dirty
26 May 2020 16:47:04.649 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.gem::onlinedb::GEMOnlineDBManager.instance(255) <> - GEMApplication developer:lmoureau
26 May 2020 16:47:04.649 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.gem::onlinedb::GEMOnlineDBManager.instance(255) <> - GEMInfoSpaceToolBox::Created GEMInfoSpaceToolBox from application gem::onlinedb::GEMOnlineDBManager and existing InfoSpace urn:xdaq-application:lid=255
26 May 2020 16:47:04.649 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.gem::onlinedb::GEMOnlineDBManager.instance(255) <> - GEMInfoSpaceToolBox::Created GEMInfoSpaceToolBox from application gem::onlinedb::GEMOnlineDBManager and existing InfoSpace urn:xdaq-application:lid=255:monitoring-infospace
26 May 2020 16:47:04.649 [140710009350336] INFO  ch.cern.gem904daq04.p:58876.gem::onlinedb::GEMOnlineDBManager.instance(255) <> - GEMInfoSpaceToolBox::Created GEMInfoSpaceToolBox from application gem::onlinedb::GEMOnlineDBManager and existing InfoSpace urn:xdaq-application:lid=255:config-infospace
26 May 2020 16:47:04.649 [140710009350336] INFO  ch.cern.gem904daq04.p:58876 <> - Ready.
^CTerminating...

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project. -> unknown, I probably have some pep8 violations
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Merge request reports