Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.json
Framework/*.json
4 changes: 4 additions & 0 deletions Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ add_library(O2QualityControl
src/QCInputsAdapters.cxx
src/QCInputsFactory.cxx
src/UserInputOutput.cxx
src/LateTaskRunner.cxx
src/LateTaskRunnerFactory.cxx
src/LateTaskInterface.cxx
src/Actor.cxx
src/ActorHelpers.cxx
src/DataProcessorAdapter.cxx
Expand Down Expand Up @@ -185,6 +188,7 @@ add_root_dictionary(O2QualityControl
HEADERS
include/QualityControl/CheckInterface.h
include/QualityControl/TaskInterface.h
include/QualityControl/LateTaskInterface.h
include/QualityControl/UserCodeInterface.h
include/QualityControl/AggregatorInterface.h
include/QualityControl/PostProcessingInterface.h
Expand Down
103 changes: 103 additions & 0 deletions Framework/basic-late-task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"qc": {
"config": {
"database": {
"implementation": "CCDB",
"host": "ccdb-test.cern.ch:8080",
"maxObjectSize": "2097152", "": "[Bytes, default=2MB] Maximum size allowed, larger objects are rejected."
},
"Activity": {
"number": "42",
"type": "NONE",
"periodName": "", "": "Period name - e.g. LHC22c, LHC22c1b_test",
"passName": "", "": "Pass type - e.g. spass, cpass1",
"provenance": "qc", "": "Provenance - qc or qc_mc depending whether it is normal data or monte carlo data"
},
"monitoring": {
"url": "infologger:///debug?qc"
},
"consul": {
"url": ""
},
"conditionDB": {
"url": "ccdb-test.cern.ch:8080"
},
"infologger": { "": "Configuration of the Infologger (optional).",
"filterDiscardDebug": "false", "": "Set to true to discard debug and trace messages (default: false)",
"filterDiscardLevel": "12", "": "Message at this level or above are discarded (default: 21 - Trace)",
"filterDiscardFile": "/tmp/_ID_.txt", "": ["If set, the messages discarded because of filterDiscardLevel",
"will go to this file (default: <none>); The keyword _ID_ is replaced by the device id. Discarded Debug ",
"messages won't go there."]
},
"bookkeeping": {
"url": ""
}
},
"tasks": {
"QcTask": {
"active": "true",
"className": "o2::quality_control_modules::skeleton::SkeletonTask",
"moduleName": "QcSkeleton",
"detectorName": "TST",
"cycleDurationSeconds": "10",
"resetAfterCycles": "1",
"dataSource": {
"type": "dataSamplingPolicy",
"name": "tst-raw"
},
"movingWindows": ["example"],
"location": "local"
}
},
"checks": {
"QcCheck": {
"active": "true",
"className": "o2::quality_control_modules::skeleton::SkeletonCheck",
"moduleName": "QcSkeleton",
"policy": "OnAny",
"detectorName": "TST",
"dataSource": [{
"type": "Task",
"name": "QcTask",
"MOs": ["example"]
}],
"extendedCheckParameters": {
"physics": {
"pp": {
"myOwnKey1": "myOwnValue1c"
}
}
}
}
},
"lateTasks": {
"late": {
"active": "true",
"className": "o2::quality_control_modules::skeleton::SkeletonLateTask",
"moduleName": "QcSkeleton",
"detectorName": "TST",
"dataSources": [{
"type": "Task",
"name": "QcTask",
"MOs": ["example", "example2"]
}],
"outputActivityStrategy": "integrated"
}
}
},
"dataSamplingPolicies": [
{
"id": "tst-raw",
"active": "true",
"machines": [],
"query": "data:TST/RAWDATA/0",
"samplingConditions": [
{
"condition": "random",
"fraction": "0.1",
"seed": "1234"
}
]
}
]
}
2 changes: 1 addition & 1 deletion Framework/include/QualityControl/DataProcessorAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct DataProcessorAdapter {
static std::string dataProcessorName(std::string_view userCodeName, std::string_view detectorName)
{
using traits = ActorTraits<ConcreteActor>;
return dataProcessorName(detectorName, userCodeName, traits::sActorTypeKebabCase);
return dataProcessorName(userCodeName, detectorName, traits::sActorTypeKebabCase);
}

/// \brief Produces standardized QC Data Processor name for cases were no user code is ran and it's not detector specific.
Expand Down
2 changes: 1 addition & 1 deletion Framework/include/QualityControl/DataSourceType.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ enum class DataSourceType {
Check,
Aggregator,
PostProcessingTask,
LateTask,
ExternalTask,
Invalid
};

}

#endif // QUALITYCONTROL_DATASOURCETYPE_H
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class InfrastructureGenerator
static void generateAggregator(framework::WorkflowSpec& workflow, const InfrastructureSpec& infrastructureSpec);
static void generatePostProcessing(framework::WorkflowSpec& workflow, const InfrastructureSpec& infrastructureSpec);
static void generateBookkeepingQualitySink(framework::WorkflowSpec& workflow, const InfrastructureSpec& infrastructureSpec);
static void generateLateTasks(framework::WorkflowSpec& workflow, const InfrastructureSpec& infrastructureSpec);
};

} // namespace core
Expand Down
2 changes: 2 additions & 0 deletions Framework/include/QualityControl/InfrastructureSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "QualityControl/AggregatorSpec.h"
#include "QualityControl/PostProcessingTaskSpec.h"
#include "QualityControl/ExternalTaskSpec.h"
#include "QualityControl/LateTaskSpec.h"

#include <vector>

Expand All @@ -37,6 +38,7 @@ struct InfrastructureSpec {
std::vector<checker::AggregatorSpec> aggregators;
std::vector<postprocessing::PostProcessingTaskSpec> postProcessingTasks;
std::vector<ExternalTaskSpec> externalTasks;
std::vector<LateTaskSpec> lateTasks;
};

} // namespace o2::quality_control::core
Expand Down
3 changes: 3 additions & 0 deletions Framework/include/QualityControl/InfrastructureSpecReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "QualityControl/DataSourceSpec.h"
#include "QualityControl/CheckSpec.h"
#include "QualityControl/PostProcessingTaskSpec.h"
#include "QualityControl/LateTaskSpec.h"
#include "QualityControl/RecoRequestSpecs.h"
#include <boost/property_tree/ptree_fwd.hpp>

Expand Down Expand Up @@ -52,6 +53,8 @@ checker::AggregatorSpec readSpecEntry<checker::AggregatorSpec>(const std::string
template <>
postprocessing::PostProcessingTaskSpec readSpecEntry<postprocessing::PostProcessingTaskSpec>(const std::string& entryID, const boost::property_tree::ptree& entryTree, const boost::property_tree::ptree& wholeTree);
template <>
LateTaskSpec readSpecEntry<LateTaskSpec>(const std::string& entryID, const boost::property_tree::ptree& entryTree, const boost::property_tree::ptree& wholeTree);
template <>
ExternalTaskSpec readSpecEntry<ExternalTaskSpec>(const std::string& entryID, const boost::property_tree::ptree& entryTree, const boost::property_tree::ptree& wholeTree);
template <>
GRPGeomRequestSpec readSpecEntry<GRPGeomRequestSpec>(const std::string& entryID, const boost::property_tree::ptree& entryTree, const boost::property_tree::ptree& wholeTree);
Expand Down
36 changes: 36 additions & 0 deletions Framework/include/QualityControl/LateTaskConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef QC_CORE_LATETASKRUNNERCONFIG_H
#define QC_CORE_LATETASKRUNNERCONFIG_H

///
/// \file LateTaskRunnerConfig.h
/// \author Piotr Konopka
///

#include <Framework/DataProcessorSpec.h>

#include "QualityControl/UserCodeConfig.h"
#include "QualityControl/DataSourceSpec.h"
#include "QualityControl/OutputActivityStrategy.h"

namespace o2::quality_control::core
{

struct LateTaskConfig : public UserCodeConfig {
bool critical = true;
OutputActivityStrategy outputActivityStrategy = OutputActivityStrategy::Integrated;
};

} // namespace o2::quality_control::core

#endif // QC_CORE_LATETASKRUNNERCONFIG_H
58 changes: 58 additions & 0 deletions Framework/include/QualityControl/LateTaskFactory.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef LATETASKFACTORY_H
#define LATETASKFACTORY_H

///
/// \file LateTaskFactory.h
/// \author Piotr Konopka
///

#include <memory>

#include "QualityControl/LateTaskConfig.h"
#include "QualityControl/LateTaskInterface.h"
#include "QualityControl/RootClassFactory.h"

namespace o2::quality_control::core
{

class LateTaskInterface;
class ObjectsManager;

/// \brief Factory in charge of creating late tasks
///
/// The factory needs a library name and a class name provided as an object of type LateTaskConfig.
/// The class loaded in the library must inherit from LateTaskInterface.
class LateTaskFactory
{
public:
LateTaskFactory() = default;
virtual ~LateTaskFactory() = default;

/// \brief Create a new instance of a LateTaskInterface.
/// The LateTaskInterface actual class is decided based on the parameters passed.
static LateTaskInterface* create(const LateTaskConfig& taskConfig, std::shared_ptr<ObjectsManager> objectsManager)
{
auto* result = root_class_factory::create<LateTaskInterface>(taskConfig.moduleName, taskConfig.className);
result->setName(taskConfig.name);
result->setObjectsManager(objectsManager);
result->setCustomParameters(taskConfig.customParameters);
result->setCcdbUrl(taskConfig.ccdbUrl);

return result;
}
};

} // namespace o2::quality_control::core

#endif // LATETASKFACTORY_H
Loading
Loading