Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions proto/agynio/api/runners/v1/runners.proto
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ enum WorkloadStatus {
WORKLOAD_STATUS_FAILED = 5;
}

enum WorkloadFailureReason {
WORKLOAD_FAILURE_REASON_UNSPECIFIED = 0;
WORKLOAD_FAILURE_REASON_START_FAILED = 1;
WORKLOAD_FAILURE_REASON_IMAGE_PULL_FAILED = 2;
WORKLOAD_FAILURE_REASON_CONFIG_INVALID = 3;
WORKLOAD_FAILURE_REASON_CRASHLOOP = 4;
WORKLOAD_FAILURE_REASON_RUNTIME_LOST = 5;
}

enum ContainerRole {
CONTAINER_ROLE_UNSPECIFIED = 0;
CONTAINER_ROLE_MAIN = 1;
Expand Down Expand Up @@ -207,6 +216,13 @@ message Workload {
optional google.protobuf.Timestamp removed_at = 12;
int32 allocated_cpu_millicores = 13;
int64 allocated_ram_bytes = 14;
// Machine-readable reason for failures when status is WORKLOAD_STATUS_FAILED.
// When status is not FAILED, this value may be unset or stale.
optional WorkloadFailureReason failure_reason = 15;
Comment thread
noa-lucent marked this conversation as resolved.
// Human-readable failure detail for failed workloads; not intended for
// programmatic parsing. When status is not FAILED, this value may be unset
// or stale.
optional string failure_message = 16;
}

message CreateWorkloadRequest {
Expand All @@ -233,12 +249,18 @@ message UpdateWorkloadRequest {
optional string instance_id = 4;
optional google.protobuf.Timestamp removed_at = 5;
optional google.protobuf.Timestamp last_metering_sampled_at = 6;
// Use this RPC to set or update failure details.
optional WorkloadFailureReason failure_reason = 7;
Comment thread
noa-lucent marked this conversation as resolved.
// Human-readable failure detail; not intended for programmatic parsing.
optional string failure_message = 8;
}

message UpdateWorkloadResponse {
Workload workload = 1;
}

// Updates status and containers only. Use UpdateWorkload to set failure
// details such as failure_reason and failure_message.
message UpdateWorkloadStatusRequest {
string id = 1;
WorkloadStatus status = 2;
Expand Down Expand Up @@ -273,9 +295,13 @@ message ListWorkloadsByThreadRequest {
string thread_id = 1;
int32 page_size = 2;
string page_token = 3;
optional string agent_id = 4;
// Optional status filter. An empty list returns workloads for all statuses.
repeated WorkloadStatus statuses = 5;
}

message ListWorkloadsByThreadResponse {
// Ordered by created_at DESC, id DESC for stable pagination.
repeated Workload workloads = 1;
string next_page_token = 2;
}
Expand Down
Loading