diff --git a/ray-operator/apis/ray/v1/raycluster_types.go b/ray-operator/apis/ray/v1/raycluster_types.go index 285b88618b5..8ba51ba869a 100644 --- a/ray-operator/apis/ray/v1/raycluster_types.go +++ b/ray-operator/apis/ray/v1/raycluster_types.go @@ -9,6 +9,18 @@ import ( // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. +// RayClusterTemplateSpec describes the data a RayCluster should have when created from a template +type RayClusterTemplateSpec struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Specification of the desired behavior of the RayCluster. + // +optional + Spec RayClusterSpec `json:"spec,omitempty"` +} + // RayClusterSpec defines the desired state of RayCluster type RayClusterSpec struct { // Suspend indicates whether a RayCluster should be suspended. diff --git a/ray-operator/apis/ray/v1/rayjob_types.go b/ray-operator/apis/ray/v1/rayjob_types.go index 1f9f58d238d..4beb737870f 100644 --- a/ray-operator/apis/ray/v1/rayjob_types.go +++ b/ray-operator/apis/ray/v1/rayjob_types.go @@ -120,6 +120,9 @@ type RayJobSpec struct { // +kubebuilder:default:=0 // +optional BackoffLimit *int32 `json:"backoffLimit,omitempty"` + // Template describes the RayCluster that will be created. + // +optional + Template RayClusterTemplateSpec `json:"template,omitempty"` // RayClusterSpec is the cluster template to run the job RayClusterSpec *RayClusterSpec `json:"rayClusterSpec,omitempty"` // SubmitterPodTemplate is the template for the pod that will run `ray job submit`.