Skip to content

[feat][CRD] allow RayJob to have RayCluster template #3753

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
12 changes: 12 additions & 0 deletions ray-operator/apis/ray/v1/raycluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions ray-operator/apis/ray/v1/rayjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
Loading