commit 73994327de890590eede353c8131f3f7c1e8aaa3 Author: Ian Roddis <gitlab@ie2r.com> Date: Wed Aug 25 13:38:29 2021 -0300 - Fixing up checks for individual dag runs commit f20e3a3dec8c063111cf60f2bec2b8f84c8a4100 Author: Ian Roddis <gitlab@ie2r.com> Date: Wed Aug 25 10:49:43 2021 -0300 - Finishing serialization of DAGRun - Checkpointing work. commit b490abadf93e3085e4204003de7eaa8183b4e1d5 Author: Ian Roddis <gitlab@ie2r.com> Date: Wed Aug 25 10:34:08 2021 -0300 - Consolidating struct definitions into Defines.hpp - Renaming DAGRunRecord member runStates to taskRunStates commit 050346ec1fd10d1091f261905c6175ffe0bcf001 Author: Ian Roddis <gitlab@ie2r.com> Date: Wed Aug 25 09:27:05 2021 -0300 - Adding additional tests for server endpoints
59 lines
1.6 KiB
C++
59 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <unordered_set>
|
|
#include <variant>
|
|
#include <vector>
|
|
|
|
namespace daggy {
|
|
// Commands and parameters
|
|
using ParameterValue = std::variant<std::string, std::vector<std::string>>;
|
|
using ParameterValues = std::unordered_map<std::string, ParameterValue>;
|
|
using Command = std::vector<std::string>;
|
|
|
|
// Time
|
|
using Clock = std::chrono::system_clock;
|
|
using TimePoint = std::chrono::time_point<Clock>;
|
|
|
|
// DAG Runs
|
|
using DAGDefID = int16_t;
|
|
using DAGRunID = size_t;
|
|
using TaskID = size_t;
|
|
|
|
enum class RunState : uint32_t {
|
|
QUEUED = 0,
|
|
RUNNING = 1,
|
|
RETRY = 1 << 1,
|
|
ERRORED = 1 << 2,
|
|
KILLED = 1 << 3,
|
|
COMPLETED = 1 << 4
|
|
};
|
|
|
|
struct Task {
|
|
std::string name;
|
|
std::vector<std::string> command;
|
|
uint32_t maxRetries;
|
|
uint32_t retryIntervalSeconds; // Time to wait between retries
|
|
std::unordered_set<std::string> children;
|
|
|
|
bool operator==(const Task &other) const {
|
|
return (name == other.name)
|
|
and (maxRetries == other.maxRetries)
|
|
and (retryIntervalSeconds == other.retryIntervalSeconds)
|
|
and (command == other.command)
|
|
and (children == other.children);
|
|
}
|
|
};
|
|
|
|
struct AttemptRecord {
|
|
TimePoint startTime;
|
|
TimePoint stopTime;
|
|
int rc; // RC from the task
|
|
std::string executorLog; // Logs from the dag_executor
|
|
std::string outputLog; // stdout from command
|
|
std::string errorLog; // stderr from command
|
|
};
|
|
}
|