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

[proto] Add core api definitions as protobuf message #93

Merged
merged 2 commits into from
Dec 6, 2021
Merged
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
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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our downsteam version, we expose a service endpoint here. However, I feel it's kind of hard to write an endpoint since service expose dashboard, client, redis port. What's your opinion? @chenk008

Copy link
Contributor

@chenk008 chenk008 Nov 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is required to expose head service endpoint. The devops platform will show the information.

google.protobuf.Timestamp created_at = 7;

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

message ClusterSpec {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There're only HeadGroupSpec and WorkerGroupSpec object under ClusterSpec, do you think this is helpful? We can also move HeadGroupSpec and WorkerGroupSpec directly to message Cluster. I am ok with both way @chenk008

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ,we can simplify it to move HeadGroupSpec and WorkerGroupSpec into Cluster.

// 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 {
Jeffwan marked this conversation as resolved.
Show resolved Hide resolved
// Required. Group name of the current worker group
string group_name = 1;
// Optional. The computeTemplate of head node group
string compute_template = 2;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chenk008 I change to string instead. WDYT? We can make this concept persisted and resuable. If we use message ComputeTemplate, user need to fetch the object as well and they may modified the fields. I feel using reference key is easier

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to me.

// 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;
chenk008 marked this conversation as resolved.
Show resolved Hide resolved
int32 code = 2;
repeated google.protobuf.Any details = 3;
}