feat(worker): add the vbs remote-execution worker client
This commit is contained in:
1 parent
1ae72e4d07
commit
0674b7f9fe
10 files changed
+423
-1
No files matched your search
@@ -49,6 +49,33 @@ struct TokenInfo {
|
||||
[[nodiscard]] Void::Result::Result<std::vector<TokenInfo>, Void::Result::Error>
|
||||
fetch_tokens(std::string_view registry_url, const RegistryAuth &auth = {});
|
||||
|
||||
// Remote execution worker protocol (registry-side lease/result endpoints).
|
||||
struct WorkerRegistration {
|
||||
std::string worker_id;
|
||||
std::int64_t registered_epoch{0};
|
||||
};
|
||||
|
||||
struct LeasedAction {
|
||||
std::string action_key;
|
||||
std::string worker_id;
|
||||
std::string lease_token;
|
||||
std::int64_t expires_epoch{0};
|
||||
std::string record_json;
|
||||
};
|
||||
|
||||
[[nodiscard]] Void::Result::Result<WorkerRegistration, Void::Result::Error>
|
||||
register_worker(std::string_view registry_url, std::string_view platform,
|
||||
const RegistryAuth &auth = {});
|
||||
|
||||
[[nodiscard]] Void::Result::Result<LeasedAction, Void::Result::Error>
|
||||
lease_action(std::string_view registry_url, std::string_view action_key, std::string_view worker_id,
|
||||
std::int64_t lease_seconds, const RegistryAuth &auth = {});
|
||||
|
||||
[[nodiscard]] Void::Result::Result<void, Void::Result::Error>
|
||||
submit_action_result(std::string_view registry_url, std::string_view action_key,
|
||||
std::string_view lease_token, std::string_view record_json,
|
||||
const RegistryAuth &auth = {});
|
||||
|
||||
// Marks a release yanked or unyanked via POST .../<version>/yank (bearer tokens are exempt
|
||||
// from CSRF; owner or admin authority required). Returns the resulting yank state.
|
||||
[[nodiscard]] Void::Result::Result<bool, Void::Result::Error>
|
||||
|
||||
@@ -132,6 +132,10 @@ class StateStore {
|
||||
|
||||
[[nodiscard]] std::size_t recorded_action_count() const;
|
||||
|
||||
// Serialized registry-form action record for `action_key` (for worker/result upload).
|
||||
[[nodiscard]] Void::Result::Result<std::string, Void::Result::Error>
|
||||
export_action_record_json(std::string_view action_key) const;
|
||||
|
||||
private:
|
||||
struct DatabaseSnapshot {
|
||||
int schema_version{kStateSchemaVersion};
|
||||
|
||||
Reference in new issue
Block a user