-
Notifications
You must be signed in to change notification settings - Fork 606
[refactor][operator]: make RayStartParams
optional
#3202
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
[refactor][operator]: make RayStartParams
optional
#3202
Conversation
a8efa58
to
a1e53d9
Compare
omitempty
on RayStartParams
c9781e1
to
80eb350
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the important changes are in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update tests
// TODO: Look for better workaround/fixes for RayStartParams. Currently using `WithRayStartParams()` requires | ||
// a non-empty map with valid key value pairs and will not populate the field with empty/nil values. This | ||
// isn't ideal as it forces the generated RayCluster yamls to use those parameters. | ||
headRayStartParams := map[string]string{ | ||
"dashboard-host": "0.0.0.0", | ||
} | ||
workerRayStartParams := map[string]string{ | ||
"metrics-export-port": "8080", | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this now since the map can be empty
98625b2
to
973af72
Compare
aa3243a
to
8b0650b
Compare
omitempty
on RayStartParams
RayStartParams
optional
8b0650b
to
6359479
Compare
expectedWorkerRayStartParams := map[string]string{ | ||
"metrics-export-port": "8080", | ||
} | ||
maps.Copy(expectedWorkerRayStartParams, testRayClusterYamlObject.WorkerRayStartParams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the hard-coded metrics-export-port
now.
rayStartParams: | ||
metrics-export-port: "8080" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shows that when rayStartParams
aren't set in the RayClusterApplyConfiguration
, the field is absent from the serialized YAML.
05f6a13
to
557b90a
Compare
* `RayClusters` with `rayStartParams: {}` will continue to be serialized with the empty map. * `RayClusters` without `rayStartParams` will be serialized without the field. This prevents a backwards-incompatible change with RayClusters that use the autoscaler with Ray versions earlier than 2.45.0 which lack this change ray-project/ray#51954. Signed-off-by: David Xia <david@davidxia.com>
e940dbe
to
b1c0d28
Compare
@kevin85421 I think b1c0d28 makes backwards compatible. |
Open a follow up issue: #3580 |
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
No longer needed after ray-project#3202 Signed-off-by: David Xia <david@davidxia.com>
in example YAMLs and tests. `rayStartParams` is optional after ray-project#3202 released in 1.4.0. We comment out with an explanation instead of removing entirely so users with older RayCluster CRD versions have a hint about the incompatibility. Signed-off-by: David Xia <david@davidxia.com>
in example YAMLs and tests. `rayStartParams` is optional after ray-project#3202 released in 1.4.0. We comment out with an explanation instead of removing entirely so users with older RayCluster CRD versions have a hint about the incompatibility. Signed-off-by: David Xia <david@davidxia.com>
in
RayCluster
CRD by marking it with// +optional
.Make it not serialized when empty with
omitempty
.This change is backwards compatible on K8s clusters with existing
RayCluster CRD and RayCluster CRs.
before this change.
before this change: as an empty map,
{}
in YAML.kubectl create|apply
RayClusters that lackRayStartParams in both head and worker groups. Previously the K8s API
would return validation errors requiring this field to be present.
When we get these RayClusters back with
kubectl get raycluster -o yaml
, there's norayStartParams
field present.See Optional vs. Required in K8s API Conventions doc.
The required changes to the RayCluster CRD YAML can be achieved with only
omitempty
, but we also add// +optional
as recommended by the doc above.Signed-off-by: David Xia david@davidxia.com