From 88a19a626395364098f49ddd555c1693c1609c45 Mon Sep 17 00:00:00 2001 From: Marco Roda Date: Tue, 10 Sep 2024 16:30:24 +0200 Subject: [PATCH 1/6] Add opmon configuration object to schema --- schema/confmodel/dunedaq.schema.xml | 19 +++++++++++++++++-- src/dalMethods.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/schema/confmodel/dunedaq.schema.xml b/schema/confmodel/dunedaq.schema.xml index cb9a38e..b6424db 100644 --- a/schema/confmodel/dunedaq.schema.xml +++ b/schema/confmodel/dunedaq.schema.xml @@ -80,10 +80,10 @@ - + - + @@ -94,6 +94,7 @@ + @@ -258,10 +259,23 @@ + + + + + + + + + + + + + @@ -345,6 +359,7 @@ + diff --git a/src/dalMethods.cpp b/src/dalMethods.cpp index f5945f1..f5438f7 100644 --- a/src/dalMethods.cpp +++ b/src/dalMethods.cpp @@ -13,6 +13,7 @@ #include "confmodel/DaqApplication.hpp" #include "confmodel/DaqModule.hpp" #include "confmodel/Jsonable.hpp" +#include "confmodel/OpMonURI.hpp" #include "confmodel/PhysicalHost.hpp" #include "confmodel/RCApplication.hpp" #include "confmodel/Resource.hpp" @@ -389,4 +390,31 @@ std::vector DetectorToDaqConnection::get_strea return streams; } + +std::string OpMonURI::get_URI( const std::string & app ) const { + + auto type = get_type(); + if ( type == "file" ) { + auto file_name = get_path(); + auto slash_pos = file_name.find_last_of('/'); + auto dot_pos = slash_pos == std::string::npos ? file_name.find_first_of('.') : file_name.find_first_of('.', slash_pos); + + if (dot_pos == std::string::npos) { + file_name += '_' + app + ".json"; + } + else { + file_name.insert(dot_pos, '_' + app); + } + auto opmon_uri = type + "://" + file_name; + return opmon_uri; + } + + if ( type == "stream" ) { + return type + "://" + get_path(); + } + + return "stdout://"; +} + } + From d0154d274d523d825d7791ec59dade1789fb0cac Mon Sep 17 00:00:00 2001 From: Marco Roda Date: Wed, 11 Sep 2024 16:50:08 +0200 Subject: [PATCH 2/6] Update opmonConf --- schema/confmodel/dunedaq.schema.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/schema/confmodel/dunedaq.schema.xml b/schema/confmodel/dunedaq.schema.xml index b6424db..6c5c065 100644 --- a/schema/confmodel/dunedaq.schema.xml +++ b/schema/confmodel/dunedaq.schema.xml @@ -80,7 +80,7 @@ - + @@ -261,7 +261,10 @@ - + + + + From 08b9dafef03f87ef0eb5c5eac2ef13ae5aa25ea2 Mon Sep 17 00:00:00 2001 From: Marco Roda Date: Thu, 12 Sep 2024 13:41:35 +0200 Subject: [PATCH 3/6] more updates --- schema/confmodel/dunedaq.schema.xml | 2 +- src/dalMethods.cpp | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/schema/confmodel/dunedaq.schema.xml b/schema/confmodel/dunedaq.schema.xml index 6c5c065..2b4b67e 100644 --- a/schema/confmodel/dunedaq.schema.xml +++ b/schema/confmodel/dunedaq.schema.xml @@ -80,7 +80,7 @@ - + diff --git a/src/dalMethods.cpp b/src/dalMethods.cpp index f5438f7..c31802f 100644 --- a/src/dalMethods.cpp +++ b/src/dalMethods.cpp @@ -395,18 +395,7 @@ std::string OpMonURI::get_URI( const std::string & app ) const { auto type = get_type(); if ( type == "file" ) { - auto file_name = get_path(); - auto slash_pos = file_name.find_last_of('/'); - auto dot_pos = slash_pos == std::string::npos ? file_name.find_first_of('.') : file_name.find_first_of('.', slash_pos); - - if (dot_pos == std::string::npos) { - file_name += '_' + app + ".json"; - } - else { - file_name.insert(dot_pos, '_' + app); - } - auto opmon_uri = type + "://" + file_name; - return opmon_uri; + return type + "://" + get_path(); } if ( type == "stream" ) { From 8e658a10c87dab4b109f64ab209b89e7cf317cc0 Mon Sep 17 00:00:00 2001 From: Marco Roda Date: Thu, 12 Sep 2024 15:35:02 +0200 Subject: [PATCH 4/6] Getting rid of session specification --- include/confmodel/util.hpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/include/confmodel/util.hpp b/include/confmodel/util.hpp index 1a1fbbb..a277eba 100644 --- a/include/confmodel/util.hpp +++ b/include/confmodel/util.hpp @@ -114,31 +114,15 @@ const std::vector construct_commandline_parameters_appfwk( if (opmon_app == nullptr) throw NoOpmonInfrastructure(ERS_HERE, session->UID()); - const dunedaq::confmodel::Service *opmon_service = - opmon_app->get_exposes_service()[0]; - std::string opmon_uri = opmon_service->get_protocol() + "://" + - opmon_app->get_runs_on()->get_runs_on()->UID() + ":" + - std::to_string(opmon_service->get_port()) + - opmon_service->get_path(); - - if (opmon_service->get_protocol() == "file") { - auto file_name = opmon_service->get_path(); - auto dot_pos = file_name.find('.'); - if (dot_pos == std::string::npos) - throw InvalidOpMonFile(ERS_HERE, file_name); - file_name.insert(dot_pos, '_' + app->UID()); - opmon_uri = opmon_service->get_protocol() + "://" + file_name; - } - const std::string configuration_uri = confdb.get_impl_spec(); return { + "-s", + session->UID(), "--name", app->UID(), "-c", control_uri, - "-i", - opmon_uri, "--configurationService", configuration_uri, }; From f8f41453645e18f85fb5b27f41d8c02851562813 Mon Sep 17 00:00:00 2001 From: Marco Roda Date: Fri, 13 Sep 2024 10:16:13 +0200 Subject: [PATCH 5/6] remove OpMonService --- schema/confmodel/dunedaq.schema.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/schema/confmodel/dunedaq.schema.xml b/schema/confmodel/dunedaq.schema.xml index 2b4b67e..96a28fd 100644 --- a/schema/confmodel/dunedaq.schema.xml +++ b/schema/confmodel/dunedaq.schema.xml @@ -80,7 +80,7 @@ - + @@ -267,10 +267,6 @@ - - - - From 1c6dd9ac3723f5e69b1f58fc92dee948cdd16dba Mon Sep 17 00:00:00 2001 From: Marco Roda Date: Fri, 13 Sep 2024 11:58:55 +0200 Subject: [PATCH 6/6] Remove last trace of OpMonService --- include/confmodel/util.hpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/confmodel/util.hpp b/include/confmodel/util.hpp index a277eba..d7f661c 100644 --- a/include/confmodel/util.hpp +++ b/include/confmodel/util.hpp @@ -106,14 +106,6 @@ const std::vector construct_commandline_parameters_appfwk( ":" + std::to_string(control_service->get_port()); - const dunedaq::confmodel::Application *opmon_app = nullptr; - for (auto const *ia : session->get_infrastructure_applications()) - if (ia->castable("OpMonService")) - opmon_app = ia; - - if (opmon_app == nullptr) - throw NoOpmonInfrastructure(ERS_HERE, session->UID()); - const std::string configuration_uri = confdb.get_impl_spec(); return {