111 lines
2.4 KiB
Protocol Buffer
111 lines
2.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package rara.v1;
|
|
|
|
option go_package = "git.toki-labs.com/toki/rara/gen/go/rara/v1;rarav1";
|
|
|
|
import "google/protobuf/struct.proto";
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
service ExecutorService {
|
|
rpc GetCapabilities(CapabilityRequest) returns (ExecutorCapabilities);
|
|
rpc Execute(JobSpec) returns (stream ProgressEvent);
|
|
rpc Cancel(CancelJobRequest) returns (CancelJobResponse);
|
|
}
|
|
|
|
message CapabilityRequest {}
|
|
|
|
message ExecutorCapabilities {
|
|
string executor_id = 1;
|
|
string implementation = 2;
|
|
string implementation_version = 3;
|
|
uint32 contract_version = 4;
|
|
repeated Capability capabilities = 5;
|
|
map<string, string> labels = 6;
|
|
}
|
|
|
|
message Capability {
|
|
string name = 1;
|
|
string version = 2;
|
|
google.protobuf.Struct options = 3;
|
|
}
|
|
|
|
message JobSpec {
|
|
string job_id = 1;
|
|
string project_id = 2;
|
|
string workflow_run_id = 3;
|
|
string step_run_id = 4;
|
|
string idempotency_key = 5;
|
|
string kind = 6;
|
|
uint32 attempt = 7;
|
|
google.protobuf.Timestamp deadline = 8;
|
|
google.protobuf.Struct input = 9;
|
|
repeated ArtifactRef input_artifacts = 10;
|
|
map<string, string> labels = 11;
|
|
}
|
|
|
|
message ArtifactRef {
|
|
string artifact_id = 1;
|
|
string kind = 2;
|
|
string uri = 3;
|
|
string content_hash = 4;
|
|
string schema_version = 5;
|
|
google.protobuf.Struct metadata = 6;
|
|
}
|
|
|
|
message ArtifactManifest {
|
|
string artifact_id = 1;
|
|
string project_id = 2;
|
|
string kind = 3;
|
|
string uri = 4;
|
|
string content_hash = 5;
|
|
int64 size_bytes = 6;
|
|
string media_type = 7;
|
|
string schema_version = 8;
|
|
google.protobuf.Struct metadata = 9;
|
|
repeated string parent_artifact_ids = 10;
|
|
}
|
|
|
|
message JobResult {
|
|
google.protobuf.Struct output = 1;
|
|
repeated ArtifactManifest artifacts = 2;
|
|
}
|
|
|
|
message JobError {
|
|
string code = 1;
|
|
string message = 2;
|
|
bool retryable = 3;
|
|
google.protobuf.Struct details = 4;
|
|
}
|
|
|
|
message ProgressEvent {
|
|
enum Phase {
|
|
PHASE_UNSPECIFIED = 0;
|
|
PHASE_ACCEPTED = 1;
|
|
PHASE_RUNNING = 2;
|
|
PHASE_PROGRESS = 3;
|
|
PHASE_SUCCEEDED = 4;
|
|
PHASE_FAILED = 5;
|
|
PHASE_CANCELLED = 6;
|
|
}
|
|
|
|
string job_id = 1;
|
|
string step_run_id = 2;
|
|
uint64 sequence = 3;
|
|
Phase phase = 4;
|
|
double progress = 5;
|
|
string message = 6;
|
|
google.protobuf.Timestamp occurred_at = 7;
|
|
JobResult result = 8;
|
|
JobError error = 9;
|
|
}
|
|
|
|
message CancelJobRequest {
|
|
string job_id = 1;
|
|
string reason = 2;
|
|
}
|
|
|
|
message CancelJobResponse {
|
|
bool accepted = 1;
|
|
}
|
|
|