Skip to content

Commit

Permalink
feat: return result id when creating results in agent service
Browse files Browse the repository at this point in the history
  • Loading branch information
aneojgurhem committed Apr 7, 2023
1 parent 38c913e commit ed470c0
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 40 deletions.
30 changes: 8 additions & 22 deletions Protos/V1/agent_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ message CreateTaskRequest {
}

message CreateTaskReply {
message ResultIdName {
string name = 1; /** Result given name. */
string result_id = 2; /** Result Unique ID. */
}

message TaskInfo {
string task_id = 1; /** The task ID. */
repeated string expected_output_keys = 2; /** The expected output IDs. A task have expected output IDs. */
repeated string data_dependencies = 3; /** The data dependencies IDs (inputs). A task have data dependencies. */
string payload_id = 4; /** Unique ID of the result that will be used as payload. Results are created implicitly. */
repeated ResultIdName id_name = 5; /** List of association between given names and result IDs. */
}

message CreationStatus {
Expand Down Expand Up @@ -110,8 +104,8 @@ message CreateResultsMetaDataRequest {
*/
message ResultMetaData {
string session_id = 1; /** The session ID. */
string name = 2; /** The result name. */
string owner_task_id = 3; /** The owner task ID. */
string result_id = 2; /** The result ID. */
string name = 3; /** The result name. */
result_status.ResultStatus status = 4; /** The result status. */
google.protobuf.Timestamp created_at = 5; /** The result creation date. */
}
Expand Down Expand Up @@ -150,17 +144,11 @@ message SubmitTasksRequest {
* will the client application be able to manage a missing data dependency or expected output ?
*/
message SubmitTasksResponse {
message ResultIdName {
string name = 1; /** Result given name. */
string result_id = 2; /** Result Unique ID. */
}

message TaskInfo {
string task_id = 1; /** The task ID. */
repeated string expected_output_ids = 2; /** The expected output IDs. A task have expected output IDs. */
repeated string data_dependencies = 3; /** The data dependencies IDs (inputs). A task have data dependencies. */
repeated string expected_output_ids = 2; /** The expected output IDs. A task has expected output IDs. */
repeated string data_dependencies = 3; /** The data dependencies IDs (inputs). A task has data dependencies. */
string payload_id = 4; /** Unique ID of the result that will be used as payload. Results are created implicitly. */
repeated ResultIdName id_name = 5; /** List of association between given names and result IDs. */
}

repeated TaskInfo task_infos = 1; /** List of task infos if submission successful, else throw gRPC exception. */
Expand All @@ -170,7 +158,7 @@ message SubmitTasksResponse {
/*
* Request for creating results without data
*/
message CreateResultRequest {
message CreateResultsRequest {
/**
* A result to create.
*/
Expand All @@ -186,7 +174,7 @@ message CreateResultRequest {
/*
* Response for creating results without data
*/
message CreateResultResponse {
message CreateResultsResponse {
ResultMetaData result = 1; /** The raw result that was created. */
string communication_token = 2; /** Communication token received by the worker during task processing */
}
Expand All @@ -209,22 +197,20 @@ message UploadResultDataRequest {
* They should be sent in the following order:
* - id
* - data_chunk (stream can have multiple data_chunk messages that represent data divided in several parts)
* - data_complete
*
* Data chunk cannot exceed the size returned by the GetServiceConfiguration rpc method
*/
oneof type {
ResultIdentifier id = 1; /** The identifier of the result to which add data. */
bytes data_chunk = 2; /** A chunk of data. */
bool data_complete = 3; /** Last message telling the data are complete. */
}
string communication_token = 4; /** Communication token received by the worker during task processing */
}

/*
* Response for creating results without data
* Response for uploading data with stream for result
*/
message UploadResultDataResponse {
ResultMetaData result = 1; /** The raw result that was created. */
string result_id = 1; /** The Id of the result to which data were added */
string communication_token = 2; /** Communication token received by the worker during task processing */
}
2 changes: 1 addition & 1 deletion Protos/V1/agent_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ service Agent {
/**
* Create one result with data included in the request
*/
rpc CreateResult(CreateResultRequest) returns (CreateResultResponse) {}
rpc CreateResults(CreateResultsRequest) returns (CreateResultsResponse) {}

/**
* Upload data for result with stream
Expand Down
2 changes: 1 addition & 1 deletion Protos/V1/objects.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ message TaskRequest {
repeated string expected_output_keys = 1; /** Given names to the expected outputs that will be created implicitly. IDs are returned after task creation */
repeated string data_dependencies = 2; /** IDs of the results that will be used as data dependency. */
bytes payload = 3; /** Content of the payload for the task. */
string payload_name = 4; /** Name that will be associated to the result created for the payload. */
string payload_name = 4; /** Name that will be associated to the result created for the payload. Optionnal */
}

message InitKeyedDataStream {
Expand Down
6 changes: 2 additions & 4 deletions Protos/V1/results_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ message CreateResultsMetaDataResponse {
/*
* Request for creating results without data
*/
message CreateResultRequest {
message CreateResultsRequest {
/**
* A result to create.
*/
Expand All @@ -168,7 +168,7 @@ message CreateResultRequest {
/*
* Response for creating results without data
*/
message CreateResultResponse {
message CreateResultsResponse {
repeated ResultRaw results = 1; /** The raw results that were created. */
}

Expand All @@ -190,14 +190,12 @@ message UploadResultDataRequest {
* They should be sent in the following order:
* - id
* - data_chunk (stream can have multiple data_chunk messages that represent data divided in several parts)
* - data_complete
*
* Data chunk cannot exceed the size returned by the GetServiceConfiguration rpc method
*/
oneof type {
ResultIdentifier id = 1; /** The identifier of the result to which add data. */
bytes data_chunk = 2; /** A chunk of data. */
bool data_complete = 3; /** Last message telling the data are complete. */
}
}

Expand Down
2 changes: 1 addition & 1 deletion Protos/V1/results_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ service Results {
/**
* Create one result with data included in the request
*/
rpc CreateResults(CreateResultRequest) returns (CreateResultResponse) {}
rpc CreateResults(CreateResultsRequest) returns (CreateResultsResponse) {}

/**
* Upload data for result with stream
Expand Down
10 changes: 2 additions & 8 deletions Protos/V1/submitter_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,11 @@ message CreateLargeTaskRequest {
}

message CreateTaskReply {
message ResultIdName {
string name = 1; /** Result given name. */
string result_id = 2; /** Result Unique ID. */
}

message TaskInfo {
string task_id = 1; /** Unique ID of the created task. */
repeated string expected_output_keys = 2; /** Unique ID of the result that will be used as expected output. Results are created implicitly. */
repeated string expected_output_keys = 2; /** Unique ID of the result that will be used as expected output. Results should already exist. */
repeated string data_dependencies = 3; /** Unique ID of the result that will be used as data dependency. Results should already exist. */
string payload_id = 4; /** Unique ID of the result that will be used as payload. Results are created implicitly. */
repeated ResultIdName id_name = 5; /** List of association between given names and result IDs. */
string payload_id = 4; /** Unique ID of the result that will be used as payload. Result associated to the payload is created implicitly. */
}

message CreationStatus {
Expand Down
7 changes: 4 additions & 3 deletions Protos/V1/tasks_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ message CountTasksByStatusResponse {
*/
message SubmitTasksRequest {
message TaskCreation {
repeated string expected_output_keys = 1; /** Unique ID of the results that will be produced by the task. Results are created using ResultsService. */
repeated string data_dependencies = 2; /** Unique ID of the results that will be used as datadependencies. Results are created using ResultsService. */
string payload_id = 3; /** Unique ID of the result that will be used as payload. Results are created using ResultsService. */
repeated string expected_output_keys = 1; /** Unique ID of the results that will be produced by the task. Results should be created using ResultsService. */
repeated string data_dependencies = 2; /** Unique ID of the results that will be used as datadependencies. Results should be created using ResultsService. */
string payload_id = 3; /** Unique ID of the result that will be used as payload. Result should created using ResultsService. */
TaskOptions task_options = 4; /** Optionnal task options. */
}

Expand All @@ -265,6 +265,7 @@ message SubmitTasksResponse {
string task_id = 1; /** The task ID. */
repeated string expected_output_ids = 2; /** The expected output IDs. A task have expected output IDs. */
repeated string data_dependencies = 3; /** The data dependencies IDs (inputs). A task have data dependencies. */
string payload_id = 4; /** Unique ID of the result that will be used as payload. Result should created using ResultsService. */
}

repeated TaskInfo task_infos = 1; /** List of task infos if submission successful, else throw gRPC exception. */
Expand Down

0 comments on commit ed470c0

Please sign in to comment.