Skip to content

Commit

Permalink
feat: optimus window preset (#47)
Browse files Browse the repository at this point in the history
* feat(optimus): add preset under project

* feat: add preset to job spec

* feat: add get interval api to replace get window

* fix: move get interval from job spec to job run

* refactor: mark get window deprecated

* fix: update get interval url to use resourceful url

* feat: add downstream information when getting job run

---------

Co-authored-by: Sandeep Bhardwaj <[email protected]>
  • Loading branch information
irainia and sbchaos authored Sep 12, 2023
1 parent 5c19c25 commit fbba153
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
20 changes: 20 additions & 0 deletions gotocompany/optimus/core/v1beta1/job_run.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ service JobRunService {
body: "*"
};
}

// GetInterval gets interval on specific job given reference time.
rpc GetInterval(GetIntervalRequest) returns (GetIntervalResponse) {
option (google.api.http) = {
get: "/v1beta1/project/{project_name}/job/{job_name}/interval"
};
}
}

message GetIntervalRequest {
google.protobuf.Timestamp reference_time = 1;
string project_name = 2;
string job_name = 3;
}

message GetIntervalResponse {
google.protobuf.Timestamp start_time = 1;
google.protobuf.Timestamp end_time = 2;
}

message UploadToSchedulerRequest {
Expand Down Expand Up @@ -99,6 +117,8 @@ message JobRunRequest {
google.protobuf.Timestamp start_date = 3;
google.protobuf.Timestamp end_date = 4;
repeated string filter = 5;
string downstream_project_name = 6;
string downstream_job_name = 7;
}

message JobRunResponse {
Expand Down
4 changes: 4 additions & 0 deletions gotocompany/optimus/core/v1beta1/job_spec.proto
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ service JobSpecificationService {
// GetWindow provides the start and end dates provided a scheduled date
// of the execution window
rpc GetWindow(GetWindowRequest) returns (GetWindowResponse) {
option deprecated = true;
option (google.api.http) = {
get: "/v1beta1/window"
};
Expand Down Expand Up @@ -331,6 +332,7 @@ message JobSpecification {
string window_size = 11;
string window_offset = 12;
string window_truncate_to = 13;
string window_preset = 23;

repeated JobDependency dependencies = 14; // static dependencies
map<string, string> assets = 15;
Expand Down Expand Up @@ -523,6 +525,7 @@ message JobTask {
}

message GetWindowRequest {
option deprecated = true;
google.protobuf.Timestamp scheduled_at = 1;
string size = 2;
string offset = 3;
Expand All @@ -531,6 +534,7 @@ message GetWindowRequest {
}

message GetWindowResponse {
option deprecated = true;
google.protobuf.Timestamp start = 1;
google.protobuf.Timestamp end = 2;
}
Expand Down
15 changes: 10 additions & 5 deletions gotocompany/optimus/core/v1beta1/project.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ message RegisterProjectRequest {
}

message RegisterProjectResponse {
bool success = 1;
string message = 2;
reserved 1, 2;
}

message ListProjectsRequest {}
Expand All @@ -69,12 +68,18 @@ message GetProjectResponse {
}

message ProjectSpecification {
reserved 3;

string name = 1;
map<string, string> config = 2;

message ProjectSecret {
message ProjectPreset {
string name = 1;
string value = 2;
string description = 2;

string truncate_to = 3;
string offset = 4;
string size = 5;
}
repeated ProjectSecret secrets = 3;
map<string, ProjectPreset> presets = 4;
}

0 comments on commit fbba153

Please sign in to comment.