Skip to content

Commit d7df411

Browse files
rpacholekknopers8
authored andcommitted
Checker 2.0 (QC-121) (#216)
* [WIP] Checker v2.0 * [WIP] Checker 2.0.1 * [WIP] Checker 2.0.2 * [WIP] Grouping checkers with the same input * [WIP] Trigger checker on any monitor object * [WIP] Store quality object * Serialize QualityObject. Refacor Checker. Fix QualityObject creation. Fix MonitorObjectPolicy. * Comment out not compatible test and modules. * Fix warnings. Move qc.check to qc.checks. Remove potencial bug with Monitor object revision number. * Simplify basic.json. Seperate revision update from isReady. * Rename *checkerNames to *checkNames. Log quantity of MOs per input. * Checker caches MO depending on getFullName(). * Separate single Check logic from Checker * Use Check inside Checker * Fix tests. Fix existing modules. Update DatabaseInterface. Add copyright. * Rename Checker to CheckRunner * Comply with the changes from master * Send QualityObject onto Check OutputSpec. Add testCheck. * Change to random name for CheckRunner. * Remove inline keyword. Change adopt to snapshot. Change Inputs to vector<string> for QualityObject::setInputs. * Clang format * Add check module development documentation. * Fix o2-qc-run-advanced * Fix quality printing in runBasic. Store MO after beautify. * Fix shadow map creation. Add and fix workflow test. * Fix testSharedConfig.json * Fix the json * fix the testCheckRunner * one more fix * Fix the path of the QualityObject in the CCDB * Fix testCcdbDatabase and testCheckWorkflow. * Fix formating. * Fix testInfrastructureGenerator. Change testSharedConfig.json and affected tests. * Remove extra print * Add copyright. Fix formating. * Fix skipping of the first MonitorObject in Check * Print message if check is not ready * fix TOC * Move hardcoded check declaration inside task to json config * Fix example module. Remove addCheck in DAQ. * Pass to CheckRunner info which MOs to store
1 parent c64b9d4 commit d7df411

87 files changed

Lines changed: 3229 additions & 827 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Framework/CMakeLists.txt

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ configure_file("include/QualityControl/Version.h.in"
99

1010
add_library(QualityControlTypes
1111
src/MonitorObject.cxx
12+
src/QualityObject.cxx
1213
src/Quality.cxx
1314
)
1415

@@ -27,6 +28,7 @@ target_link_libraries(QualityControlTypes
2728

2829
add_root_dictionary(QualityControlTypes
2930
HEADERS include/QualityControl/MonitorObject.h
31+
include/QualityControl/QualityObject.h
3032
include/QualityControl/Quality.h
3133
LINKDEF include/QualityControl/TypesLinkDef.h
3234
BASENAME QualityControlTypes
@@ -36,8 +38,8 @@ add_root_dictionary(QualityControlTypes
3638

3739
add_library(QualityControl
3840
src/ObjectsManager.cxx
39-
src/Checker.cxx
40-
src/CheckerFactory.cxx
41+
src/CheckRunner.cxx
42+
src/CheckRunnerFactory.cxx
4143
src/CheckInterface.cxx
4244
src/DatabaseFactory.cxx
4345
src/CcdbDatabase.cxx
@@ -48,6 +50,7 @@ add_library(QualityControl
4850
src/RepositoryBenchmark.cxx
4951
src/HistoMerger.cxx
5052
src/InfrastructureGenerator.cxx
53+
src/Check.cxx
5154
src/ServiceDiscovery.cxx
5255
src/Triggers.cxx
5356
src/TriggerHelpers.cxx
@@ -94,17 +97,18 @@ target_compile_definitions(QualityControl PRIVATE
9497
$<$<BOOL:${ENABLE_MYSQL}>:_WITH_MYSQL>)
9598

9699
add_root_dictionary(QualityControl
97-
HEADERS
100+
HEADERS include/QualityControl/Check.h
98101
include/QualityControl/CheckInterface.h
99-
include/QualityControl/Checker.h
100-
include/QualityControl/CheckerFactory.h
102+
include/QualityControl/CheckRunner.h
103+
include/QualityControl/CheckRunnerFactory.h
101104
include/QualityControl/DatabaseInterface.h
102105
include/QualityControl/CcdbDatabase.h
103106
include/QualityControl/ServiceDiscovery.h
104107
include/QualityControl/TaskRunner.h
105108
include/QualityControl/TaskRunnerFactory.h
106109
include/QualityControl/HistoMerger.h
107110
include/QualityControl/InfrastructureGenerator.h
111+
include/QualityControl/InputUtils.h
108112
include/QualityControl/PostProcessingInterface.h
109113
LINKDEF include/QualityControl/LinkDef.h
110114
BASENAME QualityControl)
@@ -209,7 +213,8 @@ set(TEST_SRCS
209213
test/testTaskInterface.cxx
210214
test/testTaskRunner.cxx
211215
test/testCheckInterface.cxx
212-
test/testChecker.cxx
216+
test/testCheckRunner.cxx
217+
test/testCheck.cxx
213218
test/testQuality.cxx
214219
test/testObjectsManager.cxx
215220
test/testCcdbDatabase.cxx
@@ -219,6 +224,7 @@ set(TEST_SRCS
219224
test/testPostProcessingRunner.cxx
220225
test/testPostProcessingInterface.cxx
221226
test/testPostProcessingConfig.cxx
227+
test/testCheckWorkflow.cxx
222228
test/testWorkflow.cxx)
223229

224230
set(TEST_ARGS
@@ -240,6 +246,8 @@ set(TEST_ARGS
240246
""
241247
""
242248
""
249+
""
250+
"-b --run"
243251
"-b --run")
244252

245253
list(LENGTH TEST_SRCS count)
@@ -261,16 +269,18 @@ foreach(i RANGE ${count})
261269
set_tests_properties(${test_name} PROPERTIES TIMEOUT 30)
262270
endforeach()
263271

264-
foreach(t testTaskInterface testWorkflow testTaskRunner
272+
foreach(t testTaskInterface testWorkflow testTaskRunner testCheckWorkflow
265273
testInfrastructureGenerator testPostProcessingConfig testPostProcessingInterface
266-
testPostProcessingRunner)
274+
testPostProcessingRunner testCheck testCheckRunner)
267275
target_sources(${t} PRIVATE
268276
${CMAKE_BINARY_DIR}/getTestDataDirectory.cxx)
269277
target_include_directories(${t} PRIVATE ${CMAKE_SOURCE_DIR})
270278
endforeach()
271279

272280
set_property(TEST testWorkflow PROPERTY TIMEOUT 10)
273281
set_property(TEST testWorkflow PROPERTY LABELS slow)
282+
set_property(TEST testCheckWorkflow PROPERTY TIMEOUT 60)
283+
set_property(TEST testCheckWorkflow PROPERTY LABELS slow)
274284
set_property(TEST testObjectsManager PROPERTY TIMEOUT 20)
275285
set_property(TEST testObjectsManager PROPERTY LABELS slow)
276286
set_property(TEST testCcdbDatabase PROPERTY TIMEOUT 15)
@@ -361,6 +371,7 @@ install(PROGRAMS script/RepoCleaner/1_per_hour.py script/RepoCleaner/Ccdb.py scr
361371

362372
set(TEST_FILES
363373
"testSharedConfig.json"
374+
"testCheckWorkflow.json"
364375
"testWorkflow.json")
365376
set(TEST_FILES_PREFIXED ${TEST_FILES})
366377
list(TRANSFORM TEST_FILES_PREFIXED PREPEND ${CMAKE_BINARY_DIR}/tests/)

Framework/advanced.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@
5353
},
5454
"location": "remote"
5555
}
56+
},
57+
"checks": {
58+
"dataSizeCheck": {
59+
"active": "true",
60+
"className": "o2::quality_control_modules::skeleton::SkeletonCheck",
61+
"moduleName": "QcSkeleton",
62+
"policy": "OnAny",
63+
"dataSource": [{
64+
"type": "Task",
65+
"name": "dataSizeTask",
66+
"MOs": ["example"]
67+
}]
68+
},
69+
"someNumbersCheck": {
70+
"active": "true",
71+
"className": "o2::quality_control_modules::skeleton::SkeletonCheck",
72+
"moduleName": "QcSkeleton",
73+
"policy": "OnAny",
74+
"dataSource": [{
75+
"type": "Task",
76+
"name": "someNumbersTask",
77+
"MOs": ["example"]
78+
}]
79+
}
5680
}
5781
},
5882
"dataSamplingPolicies": [
@@ -74,7 +98,7 @@
7498
"id": "tst2",
7599
"active": "true",
76100
"machines": [],
77-
"query" : "data:TST/RAWDATA",
101+
"query" : "data:TST/DATA",
78102
"samplingConditions": [
79103
{
80104
"condition": "payloadSize",

Framework/basic-no-sampling.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@
3939
},
4040
"location": "remote"
4141
}
42+
},
43+
"checks": {
44+
"QcCheck": {
45+
"active": "true",
46+
"className": "o2::quality_control_modules::skeleton::SkeletonCheck",
47+
"moduleName": "QcSkeleton",
48+
"policy": "OnAny",
49+
"dataSource": [{
50+
"type": "Task",
51+
"name": "QcTask",
52+
"MOs": ["example"]
53+
}]
54+
}
4255
}
4356
},
4457
"dataSamplingPolicies": [

Framework/basic.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@
4040
},
4141
"location": "remote"
4242
}
43+
},
44+
"checks": {
45+
"QcCheck": {
46+
"active": "true",
47+
"className": "o2::quality_control_modules::skeleton::SkeletonCheck",
48+
"moduleName": "QcSkeleton",
49+
"policy": "OnAny",
50+
"dataSource": [{
51+
"type": "Task",
52+
"name": "QcTask",
53+
"MOs": ["example"]
54+
}]
55+
}
4356
}
4457
},
4558
"dataSamplingPolicies": [

Framework/example-default.json

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,86 @@
5959
"o2flp2"
6060
]
6161
}
62+
},
63+
"checks": {
64+
"example/checkMeanIsAbove": {
65+
"active": "true",
66+
"className": "o2::quality_control_modules::common::MeanIsAbove",
67+
"moduleName": "QcCommon",
68+
"policy": "OnAny",
69+
"dataSource": [{
70+
"type": "Task",
71+
"name": "myTask_1",
72+
"MOs": "all"
73+
}]
74+
},
75+
"example/checkNonEmpty": {
76+
"active": "true",
77+
"className": "o2::quality_control_modules::common::MeanIsAbove",
78+
"moduleName": "QcCommon",
79+
"policy": "OnAny",
80+
"dataSource": [{
81+
"type": "Task",
82+
"name": "myTask_1",
83+
"MOs": "all"
84+
}]
85+
},
86+
"example/checkFromExample": {
87+
"active": "true",
88+
"className": "o2::quality_control_modules::example::FakeCheck",
89+
"moduleName": "QcCommon",
90+
"policy": "OnAny",
91+
"dataSource": [{
92+
"type": "Task",
93+
"name": "myTask_1",
94+
"MOs": "all"
95+
}]
96+
},
97+
"daq/checkNonEmpty/payloadSize": {
98+
"active": "true",
99+
"className": "o2::quality_control_modules::common::NonEmpty",
100+
"moduleName": "QcCommon",
101+
"policy": "OnAny",
102+
"dataSource": [{
103+
"type": "Task",
104+
"name": "DaqTask",
105+
"MOs": ["payloadSize"]
106+
}]
107+
},
108+
"daq/checkNonEmpty/IDs": {
109+
"active": "true",
110+
"className": "o2::quality_control_modules::common::NonEmpty",
111+
"moduleName": "QcCommon",
112+
"policy": "OnAny",
113+
"dataSource": [{
114+
"type": "Task",
115+
"name": "DaqTask",
116+
"MOs": ["IDs"]
117+
}]
118+
},
119+
"daq/checkIncreasingIDs": {
120+
"active": "true",
121+
"className": "o2::quality_control_modules::daq::EverIncreasingGraph",
122+
"moduleName": "QcDaq",
123+
"policy": "OnAny",
124+
"dataSource": [{
125+
"type": "Task",
126+
"name": "DaqTask",
127+
"MOs": ["IDs"]
128+
}]
129+
},
130+
"benchmark/fakeCheck_1": {
131+
"active": "true",
132+
"className": "o2::quality_control_modules::common::NonEmpty",
133+
"moduleName": "QcCommon",
134+
"policy": "OnAny",
135+
"dataSource": [{
136+
"type": "Task",
137+
"name": "myTask_1",
138+
"MOs": ["histogram_myTask_1_0"]
139+
}]
140+
}
141+
62142
}
63143
},
64144
"dataSamplingPoliciesFile_comment": "In case that policies are stored in different file, specify its path below. When both dataSamplingPolicies and dataSamplingPoliciesFile are specified, the latter has higher priority",
@@ -92,4 +172,4 @@
92172
]
93173
}
94174
]
95-
}
175+
}

Framework/include/QualityControl/CcdbDatabase.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,15 @@ class CcdbDatabase : public DatabaseInterface
5555

5656
void connect(std::string host, std::string database, std::string username, std::string password) override;
5757
void connect(const std::unordered_map<std::string, std::string>& config) override;
58-
void store(std::shared_ptr<o2::quality_control::core::MonitorObject> mo) override;
59-
core::MonitorObject* retrieve(std::string path, std::string objectName, long timestamp = 0) override;
60-
std::string retrieveJson(std::string path, std::string objectName) override;
58+
// MonitorObject
59+
void storeMO(std::shared_ptr<o2::quality_control::core::MonitorObject> q) override;
60+
std::shared_ptr<o2::quality_control::core::MonitorObject> retrieveMO(std::string taskName, std::string objectName, long timestamp = 0) override;
61+
std::string retrieveMOJson(std::string taskName, std::string objectName) override;
62+
// QualityObject
63+
void storeQO(std::shared_ptr<o2::quality_control::core::QualityObject> q) override;
64+
std::shared_ptr<o2::quality_control::core::QualityObject> retrieveQO(std::string checkerName, long timestamp = 0) override;
65+
std::string retrieveQOJson(std::string checkName) override;
66+
6167
void disconnect() override;
6268
void prepareTaskDataContainer(std::string taskName) override;
6369
std::vector<std::string> getPublishedObjectNames(std::string taskName) override;

0 commit comments

Comments
 (0)