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

[RayService] Fixed issue where the custom serve port is not reflected in the serve health check for worker Pods #1816

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

Yicheng-Lu-llll
Copy link
Contributor

@Yicheng-Lu-llll Yicheng-Lu-llll commented Jan 9, 2024

Why are these changes needed?

As title.

ray-service.different-port.yaml is used to demonstrate how to set custom serve port. However, the instruction is not complete.

when running ray-service.different-port.yaml, it may appear that everything is functioning correctly. However, the custom serve port is not accurately reflected in the serve health check for worker Pods. The absence of errors is due to the serve app only requiring a minimal amount of CPU resources. Consequently, the worker Pod might not even host a serve replica.

To illustrate this issue, I have created a Ray service similar to ray-service.different-port.yaml, but with a modified serve app configuration ensuring each Pod has one serve replica. As shown in the experiment below, the worker Pod consistently fails the health check because it defaults to using the serve port value of 8000.

kubectl apply -f https://raw.githubusercontent.com/Yicheng-Lu-llll/serve-file/main/ray-service.different-port.bad.example.yaml

# The ray.io/serve label is used to indicate whether a Pod passes the serve health check.
kubectl describe $(kubectl get pods -o=name | grep worker) | grep  "ray.io/serve"
#ray.io/serve=false

This issue occurs because Kuberay determines the serve port by examining the ray container. If the serve port is not set in the worker configuration, it defaults to port 8000.

btw, I am not sure if it is a good idea to change every Rayservice samples to enforce every Ray Pod at least has one replica. This kind of error may occur in future.

Related issue number

Checks

# Add a custom serve port to both head pod and worker Pod.
kubectl apply -f https://raw.githubusercontent.com/Yicheng-Lu-llll/serve-file/main/ray-service.different-port.yaml

# The ray.io/serve label is used to indicate whether a Pod passes the serve health check.
kubectl describe $(kubectl get pods -o=name | grep worker) | grep  "ray.io/serve"
#ray.io/serve=true

Signed-off-by: Yicheng-Lu-llll <luyc58576@gmail.com>
Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

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

LGTM! Would you mind verifying if the RayService documentation in the Ray repository instructs users to add the serve port to both head and worker Pods?

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

Successfully merging this pull request may close these issues.

None yet

2 participants