Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add plugins and project.proto #68

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions gotocompany/optimus/core/v1beta1/project.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ option java_outer_classname = "ProjectServiceManager";
option java_package = "com.gotocompany.proton.optimus";
// These annotations are used when generating the OpenAPI file.
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
version: "0.1";
};
external_docs: {
description: "Optimus Project Service";
}
info: {version: "0.1"};
external_docs: {description: "Optimus Project Service"}
schemes: HTTP;
host: "127.0.0.1:9100";
base_path: "/api";
Expand All @@ -32,15 +28,11 @@ service ProjectService {
}
// ListProjects returns list of registered projects and configurations
rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse) {
option (google.api.http) = {
get: "/v1beta1/project"
};
option (google.api.http) = {get: "/v1beta1/project"};
}
// GetProject returns project details based on project_name
rpc GetProject(GetProjectRequest) returns (GetProjectResponse) {
option (google.api.http) = {
get: "/v1beta1/project/{project_name}"
};
option (google.api.http) = {get: "/v1beta1/project/{project_name}"};
}
}

Expand All @@ -50,7 +42,8 @@ message RegisterProjectRequest {
}

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

message ListProjectsRequest {}
Expand All @@ -68,11 +61,14 @@ message GetProjectResponse {
}

message ProjectSpecification {
reserved 3;

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

message ProjectSecret {
string name = 1;
string value = 2;
}
repeated ProjectSecret secrets = 3;
message ProjectPreset {
string name = 1;
string description = 2;
Expand All @@ -84,4 +80,6 @@ message ProjectSpecification {
string location = 7;
}
map<string, ProjectPreset> presets = 4;


}
98 changes: 98 additions & 0 deletions gotocompany/optimus/plugins/v1beta1/dependency_resolver.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
syntax = "proto3";

package gotocompany.optimus.plugins.v1beta1;

import "google/protobuf/timestamp.proto";

option deprecated = true;
option go_package = "github.com/goto/proton/optimus";
option java_multiple_files = true;
option java_outer_classname = "DependencyResolverModProto";
option java_package = "com.gotocompany.proton.optimus.plugins";

// DependencyResolverModService must be implemented by all plugins want to support automatic
// dependency resolution
service DependencyResolverModService {
// GetName returns name of the plugin
rpc GetName(GetNameRequest) returns (GetNameResponse);

// GenerateDestination derive destination from config and assets
rpc GenerateDestination(GenerateDestinationRequest) returns (GenerateDestinationResponse);

// GenerateDependencies return names of job destination on which this unit
// is dependent on
rpc GenerateDependencies(GenerateDependenciesRequest) returns (GenerateDependenciesResponse);

// CompileAssets overrides the default asset compilation behaviour
rpc CompileAssets(CompileAssetsRequest) returns (CompileAssetsResponse);
}

message GetNameRequest {}

message GetNameResponse {
string name = 1;
}

message GenerateDestinationRequest {
reserved 3;
Configs config = 1;
Assets assets = 2;

PluginOptions options = 40;
}
message GenerateDestinationResponse {
string destination = 1;
string destination_type = 2;
}

message GenerateDependenciesRequest {
reserved 3;
Configs config = 1;
Assets assets = 2;

PluginOptions options = 40;
}
message GenerateDependenciesResponse {
repeated string dependencies = 1;
}

message Configs {
message Config {
string name = 1;
string value = 2;
}
repeated Config configs = 1;
}

message Assets {
message Asset {
string name = 1;
string value = 2;
}
repeated Asset assets = 1;
}

message InstanceData {
string name = 1;
string value = 2;
string type = 3;
}

message CompileAssetsRequest {
reserved 3, 4, 5;
Configs configs = 1;
Assets assets = 2;
repeated InstanceData instance_data = 8;

google.protobuf.Timestamp start_time = 6;
google.protobuf.Timestamp end_time = 7;

PluginOptions options = 40;
}
message CompileAssetsResponse {
Assets assets = 1;
}

message PluginOptions {
bool dry_run = 1;
}
Loading