ray-project / kuberay

A toolkit to run Ray applications on Kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] REP 54: Add PodName to the HeadInfo

rueian opened this issue · comments

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!

I will take this.