Skip to content

Commit

Permalink
[proto] Add core api definitions as protobuf message (ray-project#93)
Browse files Browse the repository at this point in the history
* Add protobuf core definitions

- Add cluster, config and error api definition

* Update protobuf definitions
  • Loading branch information
Jeffwan committed Dec 6, 2021
1 parent 1be5053 commit 873d83b
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
74 changes: 74 additions & 0 deletions proto/cluster.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
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 indicates ray cluster configuration
ClusterSpec cluster_spec = 6;

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

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

message ClusterSpec {
// The head group configuration
HeadGroupSpec head_group_spec = 1;
// The worker group configurations
repeated WorkerGroupSpec worker_group_sepc = 2;
}

message HeadGroupSpec {
// Optional. The computeTemplate of head node group
string compute_template = 1;
// Optional field. This field will be used to retrieve right ray container
string image = 2;
// Optional. The service type (ClusterIP, NodePort, Load balancer) of the head node
string service_type = 3;
// Optional. The ray start parames of head node group
map<string, string> ray_start_params = 4;
}

message WorkerGroupSpec {
// Required. Group name of the current worker group
string group_name = 1;
// Optional. The computeTemplate of head node group
string compute_template = 2;
// Optional field. This field will be used to retrieve right ray container
string image = 3;
// Required. Desired replicas of the worker group
int32 replicas = 4;
// Optional. Min replicas of the worker group
int32 min_replicas = 5;
// Optional. Max replicas of the worker group
int32 max_replicas = 6;
// Optional. The ray start parames of worker node group
map<string, string> ray_start_params = 7;
}
39 changes: 39 additions & 0 deletions proto/config.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 {
// The ID of the image template
string name = 1;
// The base container image to be used for image building
string base_image = 2;
// The pip packages to install
repeated string pip_packages = 3;
// The conda packages to install
repeated string conda_packages = 4;
// The system packages to install
repeated string system_packages = 5;
// The environment variables to set
map<string, string> environment_variables = 6;
// The post install commands to execute
string custom_commands = 7;
// Output. The result image generated
string image = 9;
}
13 changes: 13 additions & 0 deletions proto/error.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

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

import "google/protobuf/any.proto";

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

0 comments on commit 873d83b

Please sign in to comment.