Skip to content

Commit 710166a

Browse files
committed
[Feature] Support recreate pods for RayCluster using RayClusterSpec
Signed-off-by: win5923 <[email protected]>
1 parent 3626d5c commit 710166a

File tree

16 files changed

+231
-7
lines changed

16 files changed

+231
-7
lines changed

docs/reference/api.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,36 @@ _Appears in:_
277277
| `headGroupSpec` _[HeadGroupSpec](#headgroupspec)_ | HeadGroupSpec is the spec for the head pod | | |
278278
| `rayVersion` _string_ | RayVersion is used to determine the command for the Kubernetes Job managed by RayJob | | |
279279
| `workerGroupSpecs` _[WorkerGroupSpec](#workergroupspec) array_ | WorkerGroupSpecs are the specs for the worker pods | | |
280+
| `upgradeStrategy` _[RayClusterUpgradeStrategy](#rayclusterupgradestrategy)_ | UpgradeStrategy defines the strategy used when upgrading the RayCluster Pods. | | |
281+
282+
283+
#### RayClusterUpgradeStrategy
284+
285+
286+
287+
288+
289+
290+
291+
_Appears in:_
292+
- [RayClusterSpec](#rayclusterspec)
293+
294+
| Field | Description | Default | Validation |
295+
| --- | --- | --- | --- |
296+
| `type` _[RayClusterUpgradeType](#rayclusterupgradetype)_ | Type represents the strategy used when upgrading the RayCluster Pods. Currently supports `Recreate` and `None`. | | |
297+
298+
299+
#### RayClusterUpgradeType
300+
301+
_Underlying type:_ _string_
302+
303+
304+
305+
306+
307+
_Appears in:_
308+
- [RayClusterUpgradeStrategy](#rayclusterupgradestrategy)
309+
280310

281311

282312
#### RayJob

helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ray-operator/apis/ray/v1/raycluster_types.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ import (
99
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
1010
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
1111

12+
type RayClusterUpgradeType string
13+
14+
const (
15+
// Recreate strategy allows deleting old Pods and automatically recreate them with the new spec
16+
Recreate RayClusterUpgradeType = "Recreate"
17+
// No new pod will be created while the strategy is set to None
18+
RayClusterUpgradeNone RayClusterUpgradeType = "None"
19+
)
20+
21+
type RayClusterUpgradeStrategy struct {
22+
// Type represents the strategy used when upgrading the RayCluster Pods. Currently supports `Recreate` and `None`.
23+
// +optional
24+
Type *RayClusterUpgradeType `json:"type,omitempty"`
25+
}
26+
1227
// RayClusterSpec defines the desired state of RayCluster
1328
type RayClusterSpec struct {
1429
// Suspend indicates whether a RayCluster should be suspended.
@@ -44,6 +59,9 @@ type RayClusterSpec struct {
4459
// WorkerGroupSpecs are the specs for the worker pods
4560
// +optional
4661
WorkerGroupSpecs []WorkerGroupSpec `json:"workerGroupSpecs,omitempty"`
62+
// UpgradeStrategy defines the strategy used when upgrading the RayCluster Pods.
63+
// +optional
64+
UpgradeStrategy *RayClusterUpgradeStrategy `json:"upgradeStrategy,omitempty"`
4765
}
4866

4967
// GcsFaultToleranceOptions contains configs for GCS FT

ray-operator/apis/ray/v1/rayservice_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const (
2828
// During upgrade, NewCluster strategy will create new upgraded cluster and switch to it when it becomes ready
2929
NewCluster RayServiceUpgradeType = "NewCluster"
3030
// No new cluster will be created while the strategy is set to None
31-
None RayServiceUpgradeType = "None"
31+
RayServiceUpgradeNone RayServiceUpgradeType = "None"
3232
)
3333

3434
// These statuses should match Ray Serve's application statuses

ray-operator/apis/ray/v1/zz_generated.deepcopy.go

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ray-operator/config/crd/bases/ray.io_rayclusters.yaml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ray-operator/config/crd/bases/ray.io_rayjobs.yaml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ray-operator/config/crd/bases/ray.io_rayservices.yaml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)