This commit is contained in:
Vyacheslav1557 2024-11-01 23:18:45 +05:00
parent c6824ea56a
commit c71d43077e
2 changed files with 45 additions and 25 deletions

View file

@ -1,42 +1,44 @@
syntax = "proto3";
package runner.v1;
option go_package = "/runner/v1;runnerv1";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/duration.proto";
service RunnerService {
rpc GetWork (google.protobuf.Empty) returns (stream GetWorkResponse);
rpc BuildFinished (stream BuildFinishedRequest) returns (google.protobuf.Empty);
rpc TestFinished (stream TestFinishedRequest) returns (google.protobuf.Empty);
}
message Test {
uint32 test_id = 1;
uint32 language_id = 2;
bytes solution_executable = 3;
}
message Build {
uint32 solution_id = 1;
uint32 language_id = 2;
bytes solution_code = 3;
}
message GetWorkResponse {
oneof work {
Test test = 1;
Build build = 2;
bool no_work = 3;
message Instruction {
oneof instruction {
Build build = 1;
Run run = 2;
}
}
message TestFinishedRequest {
uint32 test = 1;
uint32 result = 2;
message Result {
oneof result {
BuildResult build = 1;
RunResult run = 2;
}
}
message BuildFinishedRequest {
uint32 solution_id = 1;
bytes solution_executable = 2;
message Build {
int32 solution_id = 1; // FIXME: make private
string binding_key = 2;
int32 language = 3;
string solution = 4;
}
message BuildResult {
int32 solution_id = 1; // FIXME: make private
int32 status = 2;
}
message Run {
int32 solution_id = 1; // FIXME: make private
int32 test_id = 2;
string binding_key = 3;
}
message RunResult {
int32 solution_id = 1; // FIXME: make private
int32 test_id = 2;
int32 status = 3;
}

18
tester/v1/tester.proto Normal file
View file

@ -0,0 +1,18 @@
syntax = "proto3";
package tester.v1;
option go_package = "/tester/v1;testerv1";
service TesterService {
rpc CreateSolution (CreateSolutionRequest) returns (stream TestingState);
}
message CreateSolutionRequest {
int32 task_id = 1;
int32 language = 2;
string solution = 3;
}
message TestingState {
string msg = 1;
}