Skip to content

Commit d2a5811

Browse files
authored
[QC-230] Allow to specify a full path of a library (#225)
* Allow to specify a full path of a library * Add link in the documentation * One needs to have matching ROOT, O2 and GCC versions * fix a merge leftover * Delete duplicated entries in TOC in README * Delete duplicated content in Advanced.md * retrigger the build tests
1 parent 82e6c82 commit d2a5811

4 files changed

Lines changed: 33 additions & 2 deletions

File tree

Framework/src/Checker.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "QualityControl/Checker.h"
1818

19+
// Boost
20+
#include <boost/filesystem/path.hpp>
1921
// ROOT
2022
#include <TClass.h>
2123
#include <TSystem.h>
@@ -37,6 +39,7 @@ using namespace o2::configuration;
3739
using namespace o2::monitoring;
3840
using namespace o2::quality_control::core;
3941
using namespace o2::quality_control::repository;
42+
namespace bfs = boost::filesystem;
4043

4144
namespace o2::quality_control::checker
4245
{
@@ -204,7 +207,7 @@ void Checker::loadLibrary(const std::string libraryName)
204207
return;
205208
}
206209

207-
std::string library = "lib" + libraryName;
210+
std::string library = bfs::path(libraryName).is_absolute() ? libraryName : "lib" + libraryName;
208211
// if vector does not contain -> first time we see it
209212
if (std::find(mLibrariesLoaded.begin(), mLibrariesLoaded.end(), library) == mLibrariesLoaded.end()) {
210213
mLogger << "Loading library " << library << AliceO2::InfoLogger::InfoLogger::endm;

Framework/src/TaskFactory.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
#include <TClass.h>
2020
#include <TROOT.h>
2121
#include <TSystem.h>
22+
// Boost
23+
#include <boost/filesystem/path.hpp>
24+
25+
namespace bfs = boost::filesystem;
2226

2327
namespace o2::quality_control::core
2428
{
@@ -29,7 +33,7 @@ TaskInterface* TaskFactory::create(TaskConfig& taskConfig, std::shared_ptr<Objec
2933
QcInfoLogger& logger = QcInfoLogger::GetInstance();
3034

3135
// Load the library
32-
std::string library = "lib" + taskConfig.moduleName;
36+
std::string library = bfs::path(taskConfig.moduleName).is_absolute() ? taskConfig.moduleName : "lib" + taskConfig.moduleName;
3337
logger << "Loading library " << library << AliceO2::InfoLogger::InfoLogger::endm;
3438
int libLoaded = gSystem->Load(library.c_str(), "", true);
3539
if (libLoaded < 0) {

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ For a general overview of our (O2) software, organization and processes, please
4040
* [Use MySQL as QC backend](doc/Advanced.md#use-mysql-as-qc-backend)
4141
* [Local CCDB setup](doc/Advanced.md#local-ccdb-setup)
4242
* [Local QCG (QC GUI) setup](doc/Advanced.md#local-qcg-qc-gui-setup)
43+
* [Developing QC modules on a machine with FLP suite](doc/Advanced.md#developing-qc-modules-on-a-machine-with-flp-suite)
4344
* [Information Service](doc/Advanced.md#information-service)
4445
* [Configuration files details](doc/Advanced.md#configuration-files-details)
4546
* [Frequently Asked Questions](doc/FAQ.md)

doc/Advanced.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* [Use MySQL as QC backend](#use-mysql-as-qc-backend)
1717
* [Local CCDB setup](#local-ccdb-setup)
1818
* [Local QCG (QC GUI) setup](#local-qcg-qc-gui-setup)
19+
* [Developing QC modules on a machine with FLP suite](#developing-qc-modules-on-a-machine-with-flp-suite)
1920
* [Information Service](#information-service)
2021
* [Usage](#usage)
2122
* [Configuration files details](#configuration-files-details)
@@ -165,6 +166,28 @@ At the moment, the description of the REST api can be found in this document : h
165166

166167
To install and run the QCG locally, and its fellow process tobject2json, please follow these instructions : https://github.com/AliceO2Group/WebUi/tree/dev/QualityControl#run-qcg-locally
167168

169+
## Developing QC modules on a machine with FLP suite
170+
171+
To load a development library in a setup with FLP suite, specify its full
172+
path in the config file (e.g. `/etc/flp.d/qc/readout.json`):
173+
```
174+
"tasks": {
175+
"QcTask": {
176+
"active": "true",
177+
"className": "o2::quality_control_modules::skeleton::SkeletonTask",
178+
"moduleName": "/home/myuser/alice/sw/BUILD/QualityControl-latest/QualityControl/libQcTstLibrary",
179+
...
180+
```
181+
Make sure that:
182+
- The name "QcTask" stays the same, as changing it might break the
183+
workflow specification for AliECS
184+
- The library is compiled with the same QC, O2, ROOT and GCC version as the
185+
ones which are installed with the FLP suite. Especially, the task and check
186+
interfaces have to be identical.
187+
- If there are checks applied to MonitorObjects, update the library path in
188+
the addCheck() functions as well. This will not be necessary when checks are
189+
configured inside config files.
190+
168191
## Information Service
169192

170193
The information service publishes information about the tasks currently

0 commit comments

Comments
 (0)