From c71d43077ed6138f990c49d7cc7b8bc0e786512b Mon Sep 17 00:00:00 2001 From: Vyacheslav1557 Date: Fri, 1 Nov 2024 23:18:45 +0500 Subject: [PATCH] feat: --- runner/v1/runner.proto | 52 ++++++++++++++++++++++-------------------- tester/v1/tester.proto | 18 +++++++++++++++ 2 files changed, 45 insertions(+), 25 deletions(-) create mode 100644 tester/v1/tester.proto diff --git a/runner/v1/runner.proto b/runner/v1/runner.proto index d7a165d..0e8e206 100644 --- a/runner/v1/runner.proto +++ b/runner/v1/runner.proto @@ -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 Instruction { + oneof instruction { + Build build = 1; + Run run = 2; + } } -message Test { - uint32 test_id = 1; - uint32 language_id = 2; - bytes solution_executable = 3; +message Result { + oneof result { + BuildResult build = 1; + RunResult run = 2; + } } message Build { - uint32 solution_id = 1; - uint32 language_id = 2; - bytes solution_code = 3; + int32 solution_id = 1; // FIXME: make private + string binding_key = 2; + int32 language = 3; + string solution = 4; } -message GetWorkResponse { - oneof work { - Test test = 1; - Build build = 2; - bool no_work = 3; - } +message BuildResult { + int32 solution_id = 1; // FIXME: make private + int32 status = 2; } -message TestFinishedRequest { - uint32 test = 1; - uint32 result = 2; +message Run { + int32 solution_id = 1; // FIXME: make private + int32 test_id = 2; + string binding_key = 3; } -message BuildFinishedRequest { - uint32 solution_id = 1; - bytes solution_executable = 2; +message RunResult { + int32 solution_id = 1; // FIXME: make private + int32 test_id = 2; + int32 status = 3; } diff --git a/tester/v1/tester.proto b/tester/v1/tester.proto new file mode 100644 index 0000000..d0a5ea4 --- /dev/null +++ b/tester/v1/tester.proto @@ -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; +} \ No newline at end of file