Skip to content

Commit

Permalink
Add protobuf core definitions
Browse files Browse the repository at this point in the history
- Add cluster, config and error api definition
  • Loading branch information
Jeffwan committed Nov 2, 2021
1 parent 23faa55 commit 9ee55e2
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 0 deletions.
78 changes: 78 additions & 0 deletions proto/cluster.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
syntax = "proto3";

option go_package = "github.com/ray-project/kuberay/proto/go_client";
package proto;

import "google/protobuf/timestamp.proto";


message Cluster {
// Required input field. Unique Cluster name provided by user.
string name = 1;

// Required input field. Cluster's namespace provided by user
string namespace = 2;

// Required field. This field indicates the user who owns the cluster.
string user = 3;

// Optional input field. Ray cluster version
string version = 4;

// Optional field.
enum Environment {
DEV = 0;
TESTING = 1;
STAGING = 2;
PRODUCTION = 3;
}
Environment environment = 5;

// Required field. This field will be used to retrieve right ray container
string image = 6;

// Required field. This field indicates ray cluster configuration
ClusterSpec cluster_spec = 7;

// Output. The time that the Cluster created.
google.protobuf.Timestamp created_at = 8;

// Output. The time that the Cluster deleted.
google.protobuf.Timestamp deleted_at = 9;
}

message ClusterSpec {
// The name of the cluster spec
string name = 1;
// The head group configuration
HeadGroupSpec head_group_spec = 2;
// The worker group configurations
repeated WorkerGroupSpec worker_group_sepc = 3;
}

message HeadGroupSpec {
// Optional. The computeTemplate of head node group
ComputeTemplate resource = 1;
// Optional. The ray start parames of head node group
map<string, string> ray_start_params = 2;
// Optional. The service type (ClusterIP, NodePort, Load balancer) of the head node
string service_type = 3;
// Output: internal/external service endpoint
string service_address = 4;
}

message WorkerGroupSpec {
// Required. Group name of the current worker group
string group_name = 1;
// Required. Desired replicas of the worker group
int32 replicas = 2;
// Optional. Min replicas of the worker group
int32 min_replicas = 3;
// Optional. Max replicas of the worker group
int32 max_replicas = 4;
// Optional. The computeTemplate of head node group
ComputeTemplate resource = 5;
// Optional. The ray start parames of worker node group
map<string, string> ray_start_params = 6;
}

33 changes: 33 additions & 0 deletions proto/config.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
syntax = "proto3";

option go_package = "github.com/ray-project/kuberay/proto/go_client";
package proto;

// ComputeTemplate can be reused by any compute units like worker group, workspace, image build job, etc
message ComputeTemplate {
// The ID of the compute template
string name = 1;
// Number of cpus
uint32 cpu = 2;
// Number of memory
uint32 memory = 3;
// Number of gpus
uint32 gpu = 4;
// The detail gpu accelerator type
string gpu_accelerator = 5;
}

// ImageTemplate can be used by worker group and workspce.
// They can be distinguish by different entrypoints
message ImageTemplate {
string id = 1;
string name = 2;
string base_image = 3;
repeated string pip_packages = 4;
repeated string conda_packages = 5;
repeated string system_packages = 6;
map<string, string> environment_variables = 7;
string custom_commands = 8;
// Output
string image = 9;
}
18 changes: 18 additions & 0 deletions proto/error.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

option go_package = "github.com/ray-project/kuberay/proto/go_client";
package proto;

import "google/protobuf/any.proto";

message Error {
string error_message = 1;
string error_details = 2;
}

message Status {
string error = 1;
int32 code = 2;
repeated google.protobuf.Any details = 3;
}

0 comments on commit 9ee55e2

Please sign in to comment.