From 90396239646013244d80d3b9ba5737dea23baafd Mon Sep 17 00:00:00 2001 From: ryanaoleary Date: Wed, 20 Nov 2024 23:56:46 +0000 Subject: [PATCH 1/6] Add workerGroupSpec.idleTimeoutSeconds to v1 RayCluster CRD Signed-off-by: ryanaoleary --- ray-operator/apis/ray/v1/raycluster_types.go | 3 +++ .../apis/ray/v1/zz_generated.deepcopy.go | 5 ++++ .../config/crd/bases/ray.io_rayclusters.yaml | 3 +++ .../config/crd/bases/ray.io_rayjobs.yaml | 3 +++ .../config/crd/bases/ray.io_rayservices.yaml | 3 +++ .../ray/v1/workergroupspec.go | 25 +++++++++++++------ 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/ray-operator/apis/ray/v1/raycluster_types.go b/ray-operator/apis/ray/v1/raycluster_types.go index 20e69c399a..0ba1f4a882 100644 --- a/ray-operator/apis/ray/v1/raycluster_types.go +++ b/ray-operator/apis/ray/v1/raycluster_types.go @@ -65,6 +65,9 @@ type WorkerGroupSpec struct { // NumOfHosts denotes the number of hosts to create per replica. The default value is 1. // +kubebuilder:default:=1 NumOfHosts int32 `json:"numOfHosts,omitempty"` + // idleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type. + // This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group. + IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"` } // ScaleStrategy to remove workers diff --git a/ray-operator/apis/ray/v1/zz_generated.deepcopy.go b/ray-operator/apis/ray/v1/zz_generated.deepcopy.go index 0756e85545..d3c086ce6b 100644 --- a/ray-operator/apis/ray/v1/zz_generated.deepcopy.go +++ b/ray-operator/apis/ray/v1/zz_generated.deepcopy.go @@ -657,6 +657,11 @@ func (in *WorkerGroupSpec) DeepCopyInto(out *WorkerGroupSpec) { *out = new(int32) **out = **in } + if in.IdleTimeoutSeconds != nil { + in, out := &in.IdleTimeoutSeconds, &out.IdleTimeoutSeconds + *out = new(int32) + **out = **in + } if in.RayStartParams != nil { in, out := &in.RayStartParams, &out.RayStartParams *out = make(map[string]string, len(*in)) diff --git a/ray-operator/config/crd/bases/ray.io_rayclusters.yaml b/ray-operator/config/crd/bases/ray.io_rayclusters.yaml index 8174d48e73..a466e41e62 100644 --- a/ray-operator/config/crd/bases/ray.io_rayclusters.yaml +++ b/ray-operator/config/crd/bases/ray.io_rayclusters.yaml @@ -4116,6 +4116,9 @@ spec: properties: groupName: type: string + idleTimeoutSeconds: + format: int32 + type: integer maxReplicas: default: 2147483647 format: int32 diff --git a/ray-operator/config/crd/bases/ray.io_rayjobs.yaml b/ray-operator/config/crd/bases/ray.io_rayjobs.yaml index f9b06f7a32..d89f4761ad 100644 --- a/ray-operator/config/crd/bases/ray.io_rayjobs.yaml +++ b/ray-operator/config/crd/bases/ray.io_rayjobs.yaml @@ -4128,6 +4128,9 @@ spec: properties: groupName: type: string + idleTimeoutSeconds: + format: int32 + type: integer maxReplicas: default: 2147483647 format: int32 diff --git a/ray-operator/config/crd/bases/ray.io_rayservices.yaml b/ray-operator/config/crd/bases/ray.io_rayservices.yaml index 4a4545280a..09cf34e65b 100644 --- a/ray-operator/config/crd/bases/ray.io_rayservices.yaml +++ b/ray-operator/config/crd/bases/ray.io_rayservices.yaml @@ -4094,6 +4094,9 @@ spec: properties: groupName: type: string + idleTimeoutSeconds: + format: int32 + type: integer maxReplicas: default: 2147483647 format: int32 diff --git a/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go b/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go index b31254d4b9..7d35b86587 100644 --- a/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go +++ b/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go @@ -9,14 +9,15 @@ import ( // WorkerGroupSpecApplyConfiguration represents an declarative configuration of the WorkerGroupSpec type for use // with apply. type WorkerGroupSpecApplyConfiguration struct { - GroupName *string `json:"groupName,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - MinReplicas *int32 `json:"minReplicas,omitempty"` - MaxReplicas *int32 `json:"maxReplicas,omitempty"` - RayStartParams map[string]string `json:"rayStartParams,omitempty"` - Template *v1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` - ScaleStrategy *ScaleStrategyApplyConfiguration `json:"scaleStrategy,omitempty"` - NumOfHosts *int32 `json:"numOfHosts,omitempty"` + GroupName *string `json:"groupName,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + MinReplicas *int32 `json:"minReplicas,omitempty"` + MaxReplicas *int32 `json:"maxReplicas,omitempty"` + IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"` + RayStartParams map[string]string `json:"rayStartParams,omitempty"` + Template *v1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` + ScaleStrategy *ScaleStrategyApplyConfiguration `json:"scaleStrategy,omitempty"` + NumOfHosts *int32 `json:"numOfHosts,omitempty"` } // WorkerGroupSpecApplyConfiguration constructs an declarative configuration of the WorkerGroupSpec type for use with @@ -57,6 +58,14 @@ func (b *WorkerGroupSpecApplyConfiguration) WithMaxReplicas(value int32) *Worker return b } +// WithIdleTimeoutSeconds sets the IdleTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IdleTimeoutSeconds field is set to the value of the last call. +func (b *WorkerGroupSpecApplyConfiguration) WithIdleTimeoutSeconds(value int32) *WorkerGroupSpecApplyConfiguration { + b.IdleTimeoutSeconds = &value + return b +} + // WithRayStartParams puts the entries into the RayStartParams field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the RayStartParams field, From b32e88b3612f6ae9cc1933c7412446f0a67145d7 Mon Sep 17 00:00:00 2001 From: ryanaoleary Date: Thu, 21 Nov 2024 00:00:24 +0000 Subject: [PATCH 2/6] Ran make api-docs Signed-off-by: ryanaoleary --- docs/reference/api.md | 1 + helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml | 3 +++ helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml | 3 +++ helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml | 3 +++ 4 files changed, 10 insertions(+) diff --git a/docs/reference/api.md b/docs/reference/api.md index 9a0f75e18e..8935221ae8 100644 --- a/docs/reference/api.md +++ b/docs/reference/api.md @@ -280,6 +280,7 @@ _Appears in:_ | `template` _[PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#podtemplatespec-v1-core)_ | Template is a pod template for the worker | | | | `scaleStrategy` _[ScaleStrategy](#scalestrategy)_ | ScaleStrategy defines which pods to remove | | | | `numOfHosts` _integer_ | NumOfHosts denotes the number of hosts to create per replica. The default value is 1. | 1 | | +| `idleTimeoutSeconds` _integer_ | idleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type.
This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group. | | | diff --git a/helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml b/helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml index 8174d48e73..a466e41e62 100644 --- a/helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml +++ b/helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml @@ -4116,6 +4116,9 @@ spec: properties: groupName: type: string + idleTimeoutSeconds: + format: int32 + type: integer maxReplicas: default: 2147483647 format: int32 diff --git a/helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml b/helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml index f9b06f7a32..d89f4761ad 100644 --- a/helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml +++ b/helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml @@ -4128,6 +4128,9 @@ spec: properties: groupName: type: string + idleTimeoutSeconds: + format: int32 + type: integer maxReplicas: default: 2147483647 format: int32 diff --git a/helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml b/helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml index 4a4545280a..09cf34e65b 100644 --- a/helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml +++ b/helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml @@ -4094,6 +4094,9 @@ spec: properties: groupName: type: string + idleTimeoutSeconds: + format: int32 + type: integer maxReplicas: default: 2147483647 format: int32 From 93619d79081d1383f0717831de8e17fa3d9c161f Mon Sep 17 00:00:00 2001 From: ryanaoleary Date: Thu, 21 Nov 2024 00:17:27 +0000 Subject: [PATCH 3/6] ran hack/update-codegen.sh and make generate Signed-off-by: ryanaoleary --- .../apis/ray/v1/zz_generated.deepcopy.go | 10 +++++----- .../ray/v1/workergroupspec.go | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ray-operator/apis/ray/v1/zz_generated.deepcopy.go b/ray-operator/apis/ray/v1/zz_generated.deepcopy.go index d3c086ce6b..111c3245c3 100644 --- a/ray-operator/apis/ray/v1/zz_generated.deepcopy.go +++ b/ray-operator/apis/ray/v1/zz_generated.deepcopy.go @@ -657,11 +657,6 @@ func (in *WorkerGroupSpec) DeepCopyInto(out *WorkerGroupSpec) { *out = new(int32) **out = **in } - if in.IdleTimeoutSeconds != nil { - in, out := &in.IdleTimeoutSeconds, &out.IdleTimeoutSeconds - *out = new(int32) - **out = **in - } if in.RayStartParams != nil { in, out := &in.RayStartParams, &out.RayStartParams *out = make(map[string]string, len(*in)) @@ -671,6 +666,11 @@ func (in *WorkerGroupSpec) DeepCopyInto(out *WorkerGroupSpec) { } in.Template.DeepCopyInto(&out.Template) in.ScaleStrategy.DeepCopyInto(&out.ScaleStrategy) + if in.IdleTimeoutSeconds != nil { + in, out := &in.IdleTimeoutSeconds, &out.IdleTimeoutSeconds + *out = new(int32) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerGroupSpec. diff --git a/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go b/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go index 7d35b86587..4511004258 100644 --- a/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go +++ b/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go @@ -13,11 +13,11 @@ type WorkerGroupSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` MinReplicas *int32 `json:"minReplicas,omitempty"` MaxReplicas *int32 `json:"maxReplicas,omitempty"` - IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"` RayStartParams map[string]string `json:"rayStartParams,omitempty"` Template *v1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` ScaleStrategy *ScaleStrategyApplyConfiguration `json:"scaleStrategy,omitempty"` NumOfHosts *int32 `json:"numOfHosts,omitempty"` + IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"` } // WorkerGroupSpecApplyConfiguration constructs an declarative configuration of the WorkerGroupSpec type for use with @@ -58,14 +58,6 @@ func (b *WorkerGroupSpecApplyConfiguration) WithMaxReplicas(value int32) *Worker return b } -// WithIdleTimeoutSeconds sets the IdleTimeoutSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the IdleTimeoutSeconds field is set to the value of the last call. -func (b *WorkerGroupSpecApplyConfiguration) WithIdleTimeoutSeconds(value int32) *WorkerGroupSpecApplyConfiguration { - b.IdleTimeoutSeconds = &value - return b -} - // WithRayStartParams puts the entries into the RayStartParams field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the RayStartParams field, @@ -103,3 +95,11 @@ func (b *WorkerGroupSpecApplyConfiguration) WithNumOfHosts(value int32) *WorkerG b.NumOfHosts = &value return b } + +// WithIdleTimeoutSeconds sets the IdleTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IdleTimeoutSeconds field is set to the value of the last call. +func (b *WorkerGroupSpecApplyConfiguration) WithIdleTimeoutSeconds(value int32) *WorkerGroupSpecApplyConfiguration { + b.IdleTimeoutSeconds = &value + return b +} From 58a160bb94e20dbe6ac89b3366555d4b596346f8 Mon Sep 17 00:00:00 2001 From: ryanaoleary <113500783+ryanaoleary@users.noreply.github.com> Date: Thu, 21 Nov 2024 02:06:37 -0800 Subject: [PATCH 4/6] Update ray-operator/apis/ray/v1/raycluster_types.go Co-authored-by: Kai-Hsun Chen Signed-off-by: ryanaoleary <113500783+ryanaoleary@users.noreply.github.com> --- ray-operator/apis/ray/v1/raycluster_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ray-operator/apis/ray/v1/raycluster_types.go b/ray-operator/apis/ray/v1/raycluster_types.go index 0ba1f4a882..a80345353c 100644 --- a/ray-operator/apis/ray/v1/raycluster_types.go +++ b/ray-operator/apis/ray/v1/raycluster_types.go @@ -65,7 +65,7 @@ type WorkerGroupSpec struct { // NumOfHosts denotes the number of hosts to create per replica. The default value is 1. // +kubebuilder:default:=1 NumOfHosts int32 `json:"numOfHosts,omitempty"` - // idleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type. + // IdleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type. // This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group. IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"` } From bc58ab03ec1e66aab870bfc4cc7b218b96ad9296 Mon Sep 17 00:00:00 2001 From: ryanaoleary Date: Thu, 21 Nov 2024 10:28:07 +0000 Subject: [PATCH 5/6] make api-docs Signed-off-by: ryanaoleary --- docs/reference/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/api.md b/docs/reference/api.md index 8935221ae8..d060146119 100644 --- a/docs/reference/api.md +++ b/docs/reference/api.md @@ -280,7 +280,7 @@ _Appears in:_ | `template` _[PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#podtemplatespec-v1-core)_ | Template is a pod template for the worker | | | | `scaleStrategy` _[ScaleStrategy](#scalestrategy)_ | ScaleStrategy defines which pods to remove | | | | `numOfHosts` _integer_ | NumOfHosts denotes the number of hosts to create per replica. The default value is 1. | 1 | | -| `idleTimeoutSeconds` _integer_ | idleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type.
This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group. | | | +| `idleTimeoutSeconds` _integer_ | IdleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type.
This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group. | | | From d2b31b8d331f67a7329b9b1dbf0f10be8d369dd5 Mon Sep 17 00:00:00 2001 From: ryanaoleary Date: Thu, 21 Nov 2024 10:45:49 +0000 Subject: [PATCH 6/6] Fix lint error Signed-off-by: ryanaoleary --- docs/reference/api.md | 2 +- ray-operator/apis/ray/v1/raycluster_types.go | 6 +++--- .../apis/ray/v1/zz_generated.deepcopy.go | 10 +++++----- .../ray/v1/workergroupspec.go | 18 +++++++++--------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/reference/api.md b/docs/reference/api.md index d060146119..d539fdc1f0 100644 --- a/docs/reference/api.md +++ b/docs/reference/api.md @@ -276,11 +276,11 @@ _Appears in:_ | `replicas` _integer_ | Replicas is the number of desired Pods for this worker group. See https://github.com/ray-project/kuberay/pull/1443 for more details about the reason for making this field optional. | 0 | | | `minReplicas` _integer_ | MinReplicas denotes the minimum number of desired Pods for this worker group. | 0 | | | `maxReplicas` _integer_ | MaxReplicas denotes the maximum number of desired Pods for this worker group, and the default value is maxInt32. | 2147483647 | | +| `idleTimeoutSeconds` _integer_ | IdleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type.
This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group. | | | | `rayStartParams` _object (keys:string, values:string)_ | RayStartParams are the params of the start command: address, object-store-memory, ... | | | | `template` _[PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#podtemplatespec-v1-core)_ | Template is a pod template for the worker | | | | `scaleStrategy` _[ScaleStrategy](#scalestrategy)_ | ScaleStrategy defines which pods to remove | | | | `numOfHosts` _integer_ | NumOfHosts denotes the number of hosts to create per replica. The default value is 1. | 1 | | -| `idleTimeoutSeconds` _integer_ | IdleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type.
This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group. | | | diff --git a/ray-operator/apis/ray/v1/raycluster_types.go b/ray-operator/apis/ray/v1/raycluster_types.go index a80345353c..2e21d24b3a 100644 --- a/ray-operator/apis/ray/v1/raycluster_types.go +++ b/ray-operator/apis/ray/v1/raycluster_types.go @@ -56,6 +56,9 @@ type WorkerGroupSpec struct { // MaxReplicas denotes the maximum number of desired Pods for this worker group, and the default value is maxInt32. // +kubebuilder:default:=2147483647 MaxReplicas *int32 `json:"maxReplicas"` + // IdleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type. + // This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group. + IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"` // RayStartParams are the params of the start command: address, object-store-memory, ... RayStartParams map[string]string `json:"rayStartParams"` // Template is a pod template for the worker @@ -65,9 +68,6 @@ type WorkerGroupSpec struct { // NumOfHosts denotes the number of hosts to create per replica. The default value is 1. // +kubebuilder:default:=1 NumOfHosts int32 `json:"numOfHosts,omitempty"` - // IdleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type. - // This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group. - IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"` } // ScaleStrategy to remove workers diff --git a/ray-operator/apis/ray/v1/zz_generated.deepcopy.go b/ray-operator/apis/ray/v1/zz_generated.deepcopy.go index 111c3245c3..d3c086ce6b 100644 --- a/ray-operator/apis/ray/v1/zz_generated.deepcopy.go +++ b/ray-operator/apis/ray/v1/zz_generated.deepcopy.go @@ -657,6 +657,11 @@ func (in *WorkerGroupSpec) DeepCopyInto(out *WorkerGroupSpec) { *out = new(int32) **out = **in } + if in.IdleTimeoutSeconds != nil { + in, out := &in.IdleTimeoutSeconds, &out.IdleTimeoutSeconds + *out = new(int32) + **out = **in + } if in.RayStartParams != nil { in, out := &in.RayStartParams, &out.RayStartParams *out = make(map[string]string, len(*in)) @@ -666,11 +671,6 @@ func (in *WorkerGroupSpec) DeepCopyInto(out *WorkerGroupSpec) { } in.Template.DeepCopyInto(&out.Template) in.ScaleStrategy.DeepCopyInto(&out.ScaleStrategy) - if in.IdleTimeoutSeconds != nil { - in, out := &in.IdleTimeoutSeconds, &out.IdleTimeoutSeconds - *out = new(int32) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerGroupSpec. diff --git a/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go b/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go index 4511004258..7d35b86587 100644 --- a/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go +++ b/ray-operator/pkg/client/applyconfiguration/ray/v1/workergroupspec.go @@ -13,11 +13,11 @@ type WorkerGroupSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` MinReplicas *int32 `json:"minReplicas,omitempty"` MaxReplicas *int32 `json:"maxReplicas,omitempty"` + IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"` RayStartParams map[string]string `json:"rayStartParams,omitempty"` Template *v1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` ScaleStrategy *ScaleStrategyApplyConfiguration `json:"scaleStrategy,omitempty"` NumOfHosts *int32 `json:"numOfHosts,omitempty"` - IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"` } // WorkerGroupSpecApplyConfiguration constructs an declarative configuration of the WorkerGroupSpec type for use with @@ -58,6 +58,14 @@ func (b *WorkerGroupSpecApplyConfiguration) WithMaxReplicas(value int32) *Worker return b } +// WithIdleTimeoutSeconds sets the IdleTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IdleTimeoutSeconds field is set to the value of the last call. +func (b *WorkerGroupSpecApplyConfiguration) WithIdleTimeoutSeconds(value int32) *WorkerGroupSpecApplyConfiguration { + b.IdleTimeoutSeconds = &value + return b +} + // WithRayStartParams puts the entries into the RayStartParams field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the RayStartParams field, @@ -95,11 +103,3 @@ func (b *WorkerGroupSpecApplyConfiguration) WithNumOfHosts(value int32) *WorkerG b.NumOfHosts = &value return b } - -// WithIdleTimeoutSeconds sets the IdleTimeoutSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the IdleTimeoutSeconds field is set to the value of the last call. -func (b *WorkerGroupSpecApplyConfiguration) WithIdleTimeoutSeconds(value int32) *WorkerGroupSpecApplyConfiguration { - b.IdleTimeoutSeconds = &value - return b -}