QualityControl  1.5.1
O2 Data Quality Control Framework
InfrastructureGenerator.h
Go to the documentation of this file.
1 // Copyright CERN and copyright holders of ALICE O2. This software is
2 // distributed under the terms of the GNU General Public License v3 (GPL
3 // Version 3), copied verbatim in the file "COPYING".
4 //
5 // See http://alice-o2.web.cern.ch/license for full licensing information.
6 //
7 // In applying this license CERN does not waive the privileges and immunities
8 // granted to it by virtue of its status as an Intergovernmental Organization
9 // or submit itself to any jurisdiction.
10 
15 
16 #ifndef QC_CORE_INFRASTRUCTUREGENERATOR_H
17 #define QC_CORE_INFRASTRUCTUREGENERATOR_H
18 
19 #include <vector>
20 #include <string>
21 
22 namespace o2::framework
23 {
24 class CompletionPolicy;
25 }
26 #include <Framework/WorkflowSpec.h>
27 #include <Framework/DataProcessorSpec.h>
28 
29 namespace o2::quality_control
30 {
31 namespace core
32 {
33 
45 {
46  public:
47  InfrastructureGenerator() = delete;
48 
56  static framework::WorkflowSpec generateStandaloneInfrastructure(std::string configurationSource);
57 
65  static void generateStandaloneInfrastructure(framework::WorkflowSpec& workflow, std::string configurationSource);
66 
75  static framework::WorkflowSpec generateLocalInfrastructure(std::string configurationSource, std::string host);
76 
86  static void generateLocalInfrastructure(framework::WorkflowSpec& workflow, std::string configurationSource, std::string host);
87 
95  static o2::framework::WorkflowSpec generateRemoteInfrastructure(std::string configurationSource);
96 
105  static void generateRemoteInfrastructure(framework::WorkflowSpec& workflow, std::string configurationSource);
106 
118  static void customizeInfrastructure(std::vector<framework::CompletionPolicy>& policies);
119 
120  static void printVersion();
121 
122  private:
123  // Dedicated methods for creating each QC component to hide implementation details.
124 
125  static void generateDataSamplingPolicyLocalProxy(framework::WorkflowSpec& workflow,
126  const std::string& policyName,
127  const framework::Inputs& inputSpecs,
128  const std::string& localPort);
129  static void generateDataSamplingPolicyRemoteProxy(framework::WorkflowSpec& workflow,
130  const framework::Outputs& outputSpecs,
131  const std::string& localMachine,
132  const std::string& localPort);
133  static void generateLocalTaskLocalProxy(framework::WorkflowSpec& workflow,
134  size_t id,
135  std::string taskName,
136  std::string remoteHost,
137  std::string remotePort);
138  static void generateLocalTaskRemoteProxy(framework::WorkflowSpec& workflow,
139  std::string taskName,
140  size_t numberOfLocalMachines,
141  std::string remotePort);
142  static void generateMergers(framework::WorkflowSpec& workflow,
143  std::string taskName,
144  size_t numberOfLocalMachines,
145  double cycleDurationSeconds,
146  std::string mergingMode);
147  static vector<framework::OutputSpec> generateCheckRunners(framework::WorkflowSpec& workflow, std::string configurationSource);
148  static void generateAggregator(framework::WorkflowSpec& workflow, std::string configurationSource, vector<framework::OutputSpec>& checkRunnerOutputs);
149  static void generatePostProcessing(framework::WorkflowSpec& workflow, std::string configurationSource);
150 };
151 
152 } // namespace core
153 
154 // exposing the class above as a main QC interface, syntactic sugar
155 
156 inline framework::WorkflowSpec generateStandaloneInfrastructure(std::string configurationSource)
157 {
158  return core::InfrastructureGenerator::generateStandaloneInfrastructure(configurationSource);
159 }
160 
161 inline void generateStandaloneInfrastructure(framework::WorkflowSpec& workflow, std::string configurationSource)
162 {
163  core::InfrastructureGenerator::generateStandaloneInfrastructure(workflow, configurationSource);
164 }
165 
166 inline framework::WorkflowSpec generateLocalInfrastructure(std::string configurationSource, std::string host)
167 {
168  return core::InfrastructureGenerator::generateLocalInfrastructure(configurationSource, host);
169 }
170 
171 inline void generateLocalInfrastructure(framework::WorkflowSpec& workflow, std::string configurationSource, std::string host)
172 {
173  core::InfrastructureGenerator::generateLocalInfrastructure(workflow, configurationSource, host);
174 }
175 
176 inline framework::WorkflowSpec generateRemoteInfrastructure(std::string configurationSource)
177 {
178  return core::InfrastructureGenerator::generateRemoteInfrastructure(configurationSource);
179 }
180 
181 inline void generateRemoteInfrastructure(framework::WorkflowSpec& workflow, std::string configurationSource)
182 {
183  core::InfrastructureGenerator::generateRemoteInfrastructure(workflow, configurationSource);
184 }
185 
186 inline void customizeInfrastructure(std::vector<framework::CompletionPolicy>& policies)
187 {
188  core::InfrastructureGenerator::customizeInfrastructure(policies);
189 }
190 
191 } // namespace o2::quality_control
192 
193 #endif //QC_CORE_INFRASTRUCTUREGENERATOR_H
Definition: AggregatorRunner.h:27
A factory class which can generate QC topologies given a configuration file.
Definition: InfrastructureGenerator.h:44