Skip to content

Commit

Permalink
feat(optimus): fetch job task details based on plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Kush <thekushsharma@gmail.com>
  • Loading branch information
kushsharma committed Nov 8, 2021
1 parent f8a9f0a commit 06097f7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package odpf.metadata.optimus;
package odpf.metadata.optimus.v1;

option java_package = "io.odpf.proton.metadata.optimus";
option java_outer_classname = "Optimus";
Expand Down
44 changes: 31 additions & 13 deletions odpf/optimus/runtime_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ service RuntimeService {
};
}

// DumpJobSpecification returns compiled representation of the job in a scheduler
// consumable form
rpc DumpJobSpecification(DumpJobSpecificationRequest) returns (DumpJobSpecificationResponse) {
// GetJobTask provides task details specific to plugin used in a job
rpc GetJobTask(GetJobTaskRequest) returns (GetJobTaskResponse) {
option (google.api.http) = {
get: "/v1/project/{project_name}/job/{job_name}/dump"
get: "/v1/project/{project_name}/namespace/{namespace}/job/{job_name}/task"
};
}

// CheckJobSpecification checks if a job specification is valid
rpc CheckJobSpecification(CheckJobSpecificationRequest) returns (CheckJobSpecificationResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -327,7 +327,7 @@ message InstanceSpec {
google.protobuf.Timestamp executed_at = 5;

enum Type {
UNKNOWN = 0;
UNSPECIFIED = 0;
TASK = 1;
HOOK = 2;
}
Expand All @@ -343,7 +343,7 @@ message InstanceSpecData {

// type of data, could be an env var or file
enum Type {
UNKNOWN = 0;
UNSPECIFIED = 0;
ENV = 1;
FILE = 2;
}
Expand All @@ -362,7 +362,7 @@ message JobStatus {

message JobEvent {
enum Type {
UNKNOWN = 0;
UNSPECIFIED = 0;
SLA_MISS = 1;
FAILURE = 2;
SUCCESS = 3;
Expand Down Expand Up @@ -390,6 +390,25 @@ message ResourceSpecification {
map<string, string> labels = 7;
}

// JobTask is part of a job that dictates main transformation
// each job has exactly one task
message JobTask {
string name = 1;
string description = 2;
string image = 3;

message Destination {
string destination = 1;
string type = 2;
}
Destination destination = 4;

message Dependency {
string dependency = 1;
}
repeated Dependency dependencies = 5;
}

//~~~ rpc req/res

message VersionRequest {
Expand Down Expand Up @@ -426,15 +445,14 @@ message ListJobSpecificationResponse{
repeated JobSpecification jobs = 1;
}

message DumpJobSpecificationRequest {
message GetJobTaskRequest {
string project_name = 1;
string job_name = 2;
string namespace = 3;
string namespace = 2;
string job_name = 3;
}

message DumpJobSpecificationResponse {
bool success = 1;
string content = 2;
message GetJobTaskResponse {
JobTask task = 1;
}

message CheckJobSpecificationRequest {
Expand Down

0 comments on commit 06097f7

Please sign in to comment.