-
Notifications
You must be signed in to change notification settings - Fork 603
[Feat][RayCluster] Introduce the RayClusterStatus.Conditions field #2214
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
[Feat][RayCluster] Introduce the RayClusterStatus.Conditions field #2214
Conversation
5fb664e
to
be47372
Compare
// +patchStrategy=merge | ||
// +listType=map | ||
// +listMapKey=type | ||
Conditions []RayClusterCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` |
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.
Why not use metav1.Condition
instead? https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Condition
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.
I missed that. Thank you for reminding me.
be47372
to
31401e0
Compare
@@ -140,6 +140,14 @@ type RayClusterStatus struct { | |||
Head HeadInfo `json:"head,omitempty"` | |||
// Reason provides more information about current State | |||
Reason string `json:"reason,omitempty"` | |||
|
|||
// Represents the latest available observations of a deployment's current state. | |||
// +patchMergeKey=type |
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.
Why do we need these?
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 is used by strategic merge patch: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#notes-on-the-strategic-merge-patch.
This is also used by server-side apply, when listType=map
and listMapKey
are not specified: https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy.
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.
Yes! Thank you @astefanutti for helping me clarify those markers.
@@ -140,6 +140,14 @@ type RayClusterStatus struct { | |||
Head HeadInfo `json:"head,omitempty"` | |||
// Reason provides more information about current State | |||
Reason string `json:"reason,omitempty"` | |||
|
|||
// Represents the latest available observations of a deployment's current state. | |||
// +patchMergeKey=type |
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 is used by strategic merge patch: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#notes-on-the-strategic-merge-patch.
This is also used by server-side apply, when listType=map
and listMapKey
are not specified: https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy.
@@ -140,6 +140,14 @@ type RayClusterStatus struct { | |||
Head HeadInfo `json:"head,omitempty"` | |||
// Reason provides more information about current State | |||
Reason string `json:"reason,omitempty"` | |||
|
|||
// Represents the latest available observations of a deployment's current state. |
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 line does not seem specific to the conditions field. It can probably be removed.
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.
Updated to // Represents the latest available observations of a RayCluster's current state.
31401e0
to
2178270
Compare
type RayClusterConditionType string | ||
|
||
const ( | ||
HeadReady RayClusterConditionType = "HeadReady" |
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.
nit: Add a comment for HeadReady
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.
Added.
Signed-off-by: Rueian <rueiancsie@gmail.com>
2178270
to
040e810
Compare
@rueian @kevin85421 can we have the API change and implementation in the same PR if possible? Otherwise, if we release v1.2 before the implementation we'd have to revert this PR. |
Do you mean adding |
Yes, and also the addition of the new |
@kevin85421 on second thought, I think incremental PRs is fine as long as it's feature gated. I added initial feature gate implementation in #2219, what do you think? |
I am ok with the feature gate or waiting for the implementation of HeadReady and RayClusterReplicaFailure.
Hi @andrewsykim, do we still need to keep the old CRD / API if the gate is disabled? I thought that could only be achieved by introducing a new CRD version. |
@andrewsykim Does #2219 need to be merged before this PR or the order is flexible? |
@rueian I have synchronized with @andrewsykim today. If the feature flag is off, we will still generate conditions for the CRD, but we will not write anything to conditions. This PR doesn't write anything to |
Why are these changes needed?
This is the first part of the process to refine the Ready/Failed status in RayClusterStatus https://docs.google.com/document/d/1bRL0cZa87eCX6SI7gqthN68CgmHaB6l3-vJuIse-BrY
In this first PR, we introduce the new
RayClusterStatus.Conditions
field, borrowed from the idea of k8s Deployment https://github.com/kubernetes/api/blob/857a946a225f212b64d42c68a7da0dc44837636f/apps/v1/types.go#L532-L542Related issue number
Checks