-
Notifications
You must be signed in to change notification settings - Fork 538
[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
The docs for ray job/service/cluster in this PR provides the way to setup those Ray Resources with "APIServer V2", where the request url and request json body follows the k8s server interface, which I think is different from V1. |
Signed-off-by: machichima <[email protected]>
apiserversdk/README.md
Outdated
``` | ||
|
||
- `namespace` = your target Kubernetes namespace (e.g., `default`) | ||
- `resourceType` = Custom resource type (e.g., `rayclusters`, `rayjobs`, `rayserve`) |
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.
- `resourceType` = Custom resource type (e.g., `rayclusters`, `rayjobs`, `rayserve`) | |
- `resourceType` = Custom resource type (e.g., `rayclusters`, `rayjobs`, `rayservices`) |
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.
we will use the same chart and the same container image. see #3603 (review)
apiserversdk/README.md
Outdated
@@ -0,0 +1,76 @@ | |||
# KubeRay APIServer SDK | |||
|
|||
The KubeRay APIServer SDK is the HTTP proxy to the Kubernetes API server with the same |
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.
The KubeRay APIServer SDK is the HTTP proxy to the Kubernetes API server with the same | |
The KubeRay APIServer SDK provides an HTTP proxy to the Kubernetes API server with the same |
apiserversdk/README.md
Outdated
update, and delete Ray resources. It contains following highlight features: | ||
|
||
1. Compatible with Existing Kubernetes Clients and API Interface, where users can use | ||
existing Kubernetes clients to interact with the APIServer SDK. |
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.
existing Kubernetes clients to interact with the APIServer SDK. | |
existing Kubernetes clients to interact with the proxy provided by APIServer SDK. |
apiserversdk/README.md
Outdated
|
||
1. Compatible with Existing Kubernetes Clients and API Interface, where users can use | ||
existing Kubernetes clients to interact with the APIServer SDK. | ||
2. Provide APIServer SDK Go library for user to build custom HTTP middleware functions. |
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.
2. Provide APIServer SDK Go library for user to build custom HTTP middleware functions. | |
2. Provide APIServer SDK as a Go library for users to build their proxies with custom HTTP middleware functions. |
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, query, |
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.
interface. User can directly use Kubernetes OpenAPI Spec and CRD for create, query, | |
interface. Users can directly use Kubernetes OpenAPI Spec and KubeRay CRD to create, query, |
apiserversdk/README.md
Outdated
|
||
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). |
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.
- You want to interact with Ray clusters via HTTP/REST (e.g., from a UI, SDK, or CLI). | |
- You want to manage Ray clusters in Kubernetes via HTTP/REST (e.g., from a UI, SDK, or CLI). |
Signed-off-by: machichima <[email protected]>
@machichima Feel free to ping me on github / slack when you're ready! (please re-request review if PR ready) |
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!
apiserversdk/README.md
Outdated
interface. Users can directly use Kubernetes OpenAPI Spec and KubeRay CRD to create, query, | ||
update, and delete Ray resources. It contains following highlight features: | ||
|
||
1. Compatible with Existing Kubernetes Clients and API Interface, where users can use |
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.
why uppercase for "Existing" and "Clients"?
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.
They should be lower case. Just fixed! Thanks!
apiserversdk/README.md
Outdated
|
||
## When to use APIServer SDK | ||
|
||
You can considering 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.
You can considering using APIServer SDK if: | |
You can consider using APIServer SDK if: |
apiserversdk/README.md
Outdated
|
||
## Usage | ||
|
||
The KubeRay ApiServer exposes a RESTful API that mirrors the Kubernetes API Server. You |
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.
The KubeRay ApiServer exposes a RESTful API that mirrors the Kubernetes API Server. You | |
The KubeRay APIServer exposes a RESTful API that mirrors the Kubernetes API Server. You |
let's be consistent on wording
|
||
The guidance on managing the Ray clusters with Kubernetes can be found | ||
[here](https://docs.ray.io/en/latest/cluster/kubernetes/getting-started/raycluster-quick-start.html). This guide goes | ||
through how to manage and interact with Ray clusters with KubeRay APIServer. |
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.
through how to manage and interact with Ray clusters with KubeRay APIServer. | |
through how to manage and interact with Ray clusters via KubeRay APIServer. |
Follow [Installation Guide](../Installation.md) to install the latest stable KubeRay operator and API Server | ||
SDK from the Helm repository. | ||
|
||
## Important: Switch directory to `apiserversdk/` |
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.
Would it be better if we use doc?
> [!NOTICE]
> All the following guidance require you to switch your working directory to the `apiserversdk/`.
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 use IMPORTANT here so that github can render different color and icon for it
Important
something here
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.
as the file link does not exists yet
You can use a commit link?
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.
Current command looks good to me
Signed-off-by: machichima <[email protected]>
I made some changes:
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 @- If this is ok, then I will remove all json files here then |
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]>
Why are these changes needed?
Adding documents and examples for user to easily follow when using KubeRay APIServer SDK
Related issue number
Checks