Skip to content
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

[Feature] Add extra_status field in RayCluster CRD #2762

Open
2 tasks done
brucez-anyscale opened this issue Jan 16, 2025 · 5 comments
Open
2 tasks done

[Feature] Add extra_status field in RayCluster CRD #2762

brucez-anyscale opened this issue Jan 16, 2025 · 5 comments
Assignees
Labels
enhancement New feature or request triage

Comments

@brucez-anyscale
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

In Ray cluster CRD, it is good to have another field.

ExtraStatus []byte `json:"extraStatus,omitempty"`

Use case

I want to customize the RayclusterReconciler to store some extra status inside CR.
A []byte field gives the flexibility to store any data.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@andrewsykim
Copy link
Collaborator

We have a new conditions API that was introduced in v1.2 and will be enabled by default in v1.3. It can be easily extended to add arbitrary conditions if you are customizing the reconciler anyways.

// Represents the latest available observations of a RayCluster's current state.
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

Let me know if that would work for you instead

@brucez-anyscale
Copy link
Contributor Author

Do you suggest just use

Message string `json:"message" protobuf:"bytes,6,opt,name=message"`

field in the conditions to record the []bytes?
That could be a workaround.

@andrewsykim
Copy link
Collaborator

What's your use case for putting messages in the status?

@brucez-anyscale
Copy link
Contributor Author

I want to some other actions and persistent in state to remember what are done and the info.
For example, run a raycluster, before starting any pods, I customize ray cluster reconciler to create a record into a mysql db, and then I want to store a dict of metadata of my db row into the Raycluster state.

@andrewsykim
Copy link
Collaborator

I want to some other actions and persistent in state to remember what are done and the info.
For example, run a raycluster, before starting any pods, I customize ray cluster reconciler to create a record into a mysql db, and then I want to store a dict of metadata of my db row into the Raycluster state.

I see, another approach you can take here is just store json payload in an annotation. It's not uncommon to do this for tracking arbitrary data on objects. Conditions can work too but it's not designed for your use-case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

No branches or pull requests

3 participants