feat(registry): add the remote worker lease and result protocol
This commit is contained in:
1 parent
c2b80416a5
commit
1ae72e4d07
7 files changed
+336
-1
No files matched your search
@@ -82,6 +82,23 @@ struct AuditEntry {
|
||||
std::string detail; // Always secret-redacted!
|
||||
};
|
||||
|
||||
// Remote execution worker (in-memory; workers are ephemeral registrations).
|
||||
struct WorkerRecord {
|
||||
std::string worker_id;
|
||||
std::string username;
|
||||
std::string platform;
|
||||
std::int64_t registered_epoch{0};
|
||||
std::int64_t last_seen_epoch{0};
|
||||
};
|
||||
|
||||
// Lease of one CAS action key by a worker.
|
||||
struct ActionLeaseRecord {
|
||||
std::string action_key;
|
||||
std::string worker_id;
|
||||
std::string lease_token;
|
||||
std::int64_t expires_epoch{0};
|
||||
};
|
||||
|
||||
struct RegistryConfig {
|
||||
std::filesystem::path data_dir;
|
||||
std::filesystem::path web_root;
|
||||
@@ -159,6 +176,9 @@ class RegistryService {
|
||||
std::map<std::string, ApiTokenRecord, std::less<>> tokens_;
|
||||
std::map<std::string, SessionRecord, std::less<>> sessions_;
|
||||
std::map<std::string, PackageMeta, std::less<>> packages_;
|
||||
std::map<std::string, WorkerRecord, std::less<>> workers_;
|
||||
std::map<std::string, ActionLeaseRecord, std::less<>> action_leases_; // action_key -> lease
|
||||
std::uint64_t worker_sequence_{0};
|
||||
std::vector<AuditEntry> audits_;
|
||||
HttpServer server_;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user