Skip to content

[Feature] REP 54: Add PodName to the HeadInfo #2236

@rueian

Description

@rueian

Search before asking

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

Description

This is one of the tracking items of the REP: RayCluster status improvement, the step 4 in the design doc: https://docs.google.com/document/d/1bRL0cZa87eCX6SI7gqthN68CgmHaB6l3-vJuIse-BrY

We should record the name of the Ray Head Pod in the RayCluster.Status.Head.PodName field and make the getHeadPod function retrieve the pod based on the field.

// TODO: Move this function to util.go and always use this function to retrieve the head Pod.
func (r *RayServiceReconciler) getHeadPod(ctx context.Context, instance *rayv1.RayCluster) (*corev1.Pod, error) {
podList := corev1.PodList{}
if err := r.List(ctx, &podList, common.RayClusterHeadPodsAssociationOptions(instance).ToListOptions()...); err != nil {
return nil, err
}
if len(podList.Items) != 1 {
return nil, fmt.Errorf("Found %d head pods for RayCluster %s in the namespace %s", len(podList.Items), instance.Name, instance.Namespace)
}
return &podList.Items[0], nil
}

Use case

No response

Related issues

ray-project/enhancements#54

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions