Skip to content

[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

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

rueian
Copy link
Contributor

@rueian rueian commented Jul 1, 2024

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-L542

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests

@rueian rueian force-pushed the raycluster-status-conditions branch 2 times, most recently from 5fb664e to be47372 Compare July 1, 2024 14:11
@rueian rueian marked this pull request as ready for review July 1, 2024 14:38
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []RayClusterCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

@kevin85421 kevin85421 self-assigned this Jul 1, 2024
@rueian rueian force-pushed the raycluster-status-conditions branch from be47372 to 31401e0 Compare July 2, 2024 00:01
@@ -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
Copy link
Member

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@rueian rueian force-pushed the raycluster-status-conditions branch from 31401e0 to 2178270 Compare July 2, 2024 12:13
@rueian rueian requested a review from kevin85421 July 2, 2024 14:26
type RayClusterConditionType string

const (
HeadReady RayClusterConditionType = "HeadReady"
Copy link
Member

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

Copy link
Contributor Author

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>
@rueian rueian force-pushed the raycluster-status-conditions branch from 2178270 to 040e810 Compare July 2, 2024 15:54
@andrewsykim
Copy link
Member

@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.

@kevin85421
Copy link
Member

kevin85421 commented Jul 2, 2024

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 HeadReady and RayClusterReplicaFailure only when we implement them? cc @andrewsykim

@andrewsykim
Copy link
Member

Do you mean adding HeadReady and RayClusterReplicaFailure only when we implement them?

Yes, and also the addition of the new conditions field in status. We should avoid changing the CRD / API until there is an working / tested minimum implementation. What do you think?

@andrewsykim
Copy link
Member

@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?

@rueian
Copy link
Contributor Author

rueian commented Jul 3, 2024

I am ok with the feature gate or waiting for the implementation of HeadReady and RayClusterReplicaFailure.

We should avoid changing the CRD / API until there is an working / tested minimum implementation.

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.

@kevin85421
Copy link
Member

@andrewsykim Does #2219 need to be merged before this PR or the order is flexible?

@kevin85421
Copy link
Member

@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 conditions, so this PR is independent from #2219.

@kevin85421 kevin85421 merged commit ea314d7 into ray-project:master Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants