-
Notifications
You must be signed in to change notification settings - Fork 544
[DOCS] KubeRay APIServer V2 document #3594
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
curl -X POST 'localhost:31888/apis/ray.io/v1/namespaces/default/rayclusters' \ | ||
--header 'Content-Type: application/json' \ | ||
--data @docs/api-example/raycluster.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I directly use link to the json file instead of the path here (see below)? Like what Kuberay docs did.
However, this will make this example currently not available to execute, as the file link does not exists yet.
curl -s https://raw.githubusercontent.com/ray-project/kuberay/v1.4.0/apiserversdk/docs/api-example/raycluster.json | \
curl -X POST 'localhost:31888/apis/ray.io/v1/namespaces/default/rayclusters' \
--header 'Content-Type: application/json' \
--data-binary @-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as the file link does not exists yet
You can use a commit link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I directly use link to the json file instead of the path here (see below)? Like what Kuberay docs did.
Current command looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to avoid maintaining new JSON files if possible.
Can we just use the existing yamls https://github.com/ray-project/kuberay/tree/master/ray-operator/config/samples?
curl -s https://raw.githubusercontent.com/ray-project/kuberay/master/ray-operator/config/samples/....yaml | \
curl -X POST localhost:31888/apis/ray.io/v1/namespaces/default/rayclusters \
-H "Content-Type: application/yaml" \
--data-binary @-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rueian
Sure! However, for rayJob, the yaml contains both ConfigMap and RayJob, which we need to use awk
for splitting them. The command will be like so:
# For config map
curl -s https://raw.githubusercontent.com/ray-project/kuberay/v1.3.0/ray-operator/config/samples/ray-job.sample.yaml \
| awk 'BEGIN{d=-1} /^---/{d++; next} d==0' \
| kubectl apply -f -
# for rayjob
curl -s https://raw.githubusercontent.com/ray-project/kuberay/v1.3.0/ray-operator/config/samples/ray-job.sample.yaml \
| awk 'BEGIN{d=-1} /^---/{d++; next} d==-1' \
| curl -X POST http://localhost:31888/apis/ray.io/v1/namespaces/default/rayjobs \
-H "Content-Type: application/yaml" \
--data-binary @-
This makes the command more complex. Do you think this is ok?
apiserversdk/Installation.md
Outdated
helm repo add kuberay https://ray-project.github.io/kuberay-helm/ | ||
helm repo update | ||
# Install KubeRay APIServer SDK | ||
helm install kuberay-apiserver-sdk kuberay/kuberay-apiserver-sdk --version 1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently not working, while we do not have kuberay-apiserver-sdk
helm chart yet. We can modify this afterwards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will use the same chart and the same container image. see #3603 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Then I will use kuberay-apiserver directly then
Thanks for the information!
Hi @dentiny , Would you mind taking a look at this? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick first iteration, will continue later today.
apiserversdk/README.md
Outdated
# KubeRay APIServer SDK | ||
|
||
The KubeRay APIServer SDK is the HTTP proxy to the Kubernetes API server with the same | ||
interface. User can directly use Kubernetes OpenAPI Spec and CRD for create, delete, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mention query
as well? People usually say "CRUD" together
apiserversdk/README.md
Outdated
interface. User can directly use Kubernetes OpenAPI Spec and CRD for create, delete, and | ||
update Ray resources. It contains following highlight features: | ||
|
||
1. Enable creating ComputeTemplate, which support setting default values that can be used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious do we support compute template in v2 for now? I thought it's in stage-2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't. Can we remove this statement for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! I will remove this
apiserversdk/README.md
Outdated
|
||
## When to use APIServer SDK | ||
|
||
KubeRay APIServer SDK featured in simplify Ray resources management by hiding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simplifying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "hiding Kubernetes-specific details" isn't correct. Can we just remove it and only keep "You can consider using APIServer SDK if"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem!
apiserversdk/README.md
Outdated
- You want to interact with Ray clusters via HTTP/REST (e.g., from a UI, SDK, or CLI). | ||
- Your team prefers a simplified, non-Kubernetes-specific API surface to manage resources | ||
lifecycles. | ||
- You want to create templates or defulat values to simplify the configuration setup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default
apiserversdk/README.md
Outdated
interface. User can directly use Kubernetes OpenAPI Spec and CRD for create, delete, and | ||
update Ray resources. It contains following highlight features: | ||
|
||
1. Enable creating ComputeTemplate, which support setting default values that can be used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't. Can we remove this statement for now?
apiserversdk/README.md
Outdated
|
||
## When to use APIServer SDK | ||
|
||
KubeRay APIServer SDK featured in simplify Ray resources management by hiding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "hiding Kubernetes-specific details" isn't correct. Can we just remove it and only keep "You can consider using APIServer SDK if"
apiserversdk/README.md
Outdated
Kubernetes-specific details. You can considering using APIServer SDK if: | ||
|
||
- You want to interact with Ray clusters via HTTP/REST (e.g., from a UI, SDK, or CLI). | ||
- Your team prefers a simplified, non-Kubernetes-specific API surface to manage resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Your team prefers a simplified, non-Kubernetes-specific API surface to manage resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect too.
apiserversdk/README.md
Outdated
For custom resources defined by CRDs (e.g. `RayCluster`, `RayJob`, etc.), the endpoint format is: | ||
|
||
```sh | ||
<baseURL>/apis/<group>/<version>/namespaces/<namespace>/<resourceType>/<resourceName> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<baseURL>/apis/<group>/<version>/namespaces/<namespace>/<resourceType>/<resourceName> | |
<baseURL>/apis/ray.io/v1/namespaces/<namespace>/<resourceType>/<resourceName> |
apiserversdk/README.md
Outdated
- `group` = `ray.io` | ||
- `version` = `v1` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `group` = `ray.io` | |
- `version` = `v1` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just make it simpler by embedding the group and the version to the url.
apiserversdk/README.md
Outdated
#### Core Kubernetes Resources | ||
|
||
For built-in Kubernetes resources (e.g. `ConfigMap`), the endpoint format is: | ||
|
||
```sh | ||
<baseURL>/api/v1/namespaces/<namespace>/<resourceType>/<resourceName> | ||
``` | ||
|
||
- `namespace`: The target namespace | ||
- `resourceType`: Core resource type (e.g. `pods`, `configmaps`, `services`) | ||
- `resourceName`: Name of the resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### Core Kubernetes Resources | |
For built-in Kubernetes resources (e.g. `ConfigMap`), the endpoint format is: | |
```sh | |
<baseURL>/api/v1/namespaces/<namespace>/<resourceType>/<resourceName> | |
``` | |
- `namespace`: The target namespace | |
- `resourceType`: Core resource type (e.g. `pods`, `configmaps`, `services`) | |
- `resourceName`: Name of the resource |
We don't provide access to built-in Kubernetes resources by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Will remove this
@@ -0,0 +1,223 @@ | |||
# RayCluster QuickStart | |||
|
|||
RayService consists of a RayCluster and Ray Serve deployment graphs. It offers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may I ask what's a "deployment graph"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a DAG to describe the deployments. I grab the information from here:
https://docs.ray.io/en/latest/cluster/kubernetes/getting-started.html#custom-resource-definitions-crds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question on this PR's scope: this pr is titled "apiserver v2 doc", so I expect only see "apiserversdk" related changes, but not sure why we have ray job/service/cluster's change here?
I thought they're part of your another doc improve pr: #3564
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Hi @machichima, Can we use https://github.com/ray-project/kuberay/blob/master/ray-operator/config/samples/ray-job.interactive-mode.yaml which has no config map. |
```sh | ||
kubectl get rayclusters | ||
# NAME DESIRED WORKERS AVAILABLE WORKERS CPUS MEMORY GPUS STATUS AGE | ||
# raycluster-kuberay 1 2 3G 0 89s | ||
``` | ||
|
||
The KubeRay operator detects the RayCluster object and starts your Ray cluster by creating head and worker pods. To view | ||
Ray cluster’s pods, run the following command: | ||
|
||
```sh | ||
# View the pods in the RayCluster named "raycluster-kuberay" | ||
kubectl get pods --selector=ray.io/cluster=raycluster-kuberay | ||
|
||
# NAME READY STATUS RESTARTS AGE | ||
# raycluster-kuberay-head-k7rlq 1/1 Running 0 56s | ||
# raycluster-kuberay-workergroup-worker-65zl8 1/1 Running 0 56s | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we really need these kubectl details in this document. I think a curl http://localhost:31888/apis/ray.io/v1/namespaces/default/rayclusters/raycluster-kuberay
example for checking the cluster status is enough.
For other kubectl operations, can we just refer them to the ray-operator document?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! That seems better
I copied some of the content from kuberay operator docs to make the example more complete. I will try to make it minimal and focus only on apiserver curl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rueian
I updated the docs to make it use only curl
commands and avoid kubectl
. Please have a look and see if it looks good to you.
Thanks!
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
@machichima Hmm for these doc related changes, maybe next time we could get copilot / gpt to do a sanity check on spelling and wording. |
Signed-off-by: machichima <[email protected]>
Thanks for the suggestion! I just do the proof reading by copilot to fix the wording issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@kevin85421 for a final look, the failed CI seems to be flaky test, and has nothing to do with this PR (which does no function change). |
In today's sync, I will review this after @troychiu's PR to support API server V2 merged. |
…r-v2-docs Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Added the following to help users follow the example without confusion:
|
…r-v2-docs Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Use the following command for port-forwarding to access the APIServer through port 31888: | ||
|
||
```sh | ||
kubectl port-forward service/kuberay-apiserver-service 31888:8888 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the port-forward here, which requires the changes in PR #3708
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Why are these changes needed?
Adding documents and examples for user to easily follow when using KubeRay APIServer SDK
Related issue number
Checks