43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
#include <iostream>
|
|
#include <fstream>
|
|
|
|
#include <argparse.hpp>
|
|
|
|
#include <daggy/Server.hpp>
|
|
|
|
// Add executors here
|
|
#include <daggy/executors/task/ForkingTaskExecutor.hpp>
|
|
|
|
// Add loggers here
|
|
#include <daggy/loggers/dag_run/OStreamLogger.hpp>
|
|
#include <daggy/loggers/dag_run/FileSystemLogger.hpp>
|
|
|
|
struct Options {
|
|
Pistache::IP listenAddress = Pistache::Ipv4::any();
|
|
uint16_t listenPort = 2503;
|
|
size_t webThreads = 50;
|
|
size_t dagThreads = 20;
|
|
|
|
// Pool name -> Executor Type + nWorkers
|
|
std::unordered_map<std::string, std::pair<std::string, size_t>> executors;
|
|
|
|
// Logger Config
|
|
std::vector<std::unique_ptr<daggy::loggers::dag_run::DAGRunLogger>> loggers;
|
|
};
|
|
|
|
int main(int argc, char **argv) {
|
|
argparse::ArgumentParser args("Daggy");
|
|
|
|
args.add_argument("-v", "--verbose");
|
|
args.add_argument("-c", "--config")
|
|
.help("Config file");
|
|
args.add_argument("--ip")
|
|
.help("IP address to listen to");
|
|
args.add_argument("--port")
|
|
.help("Port to listen to")
|
|
.action([](const std::string &value) { return std::stoi(value); });
|
|
|
|
// Set some defaults
|
|
|
|
// daggy::Server endpoint(10);
|
|
} |