forked from ray-project/kuberay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[proto] Add core api definitions as protobuf message (ray-project#93)
* Add protobuf core definitions - Add cluster, config and error api definition * Update protobuf definitions
- Loading branch information
Showing
3 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|