diff --git a/docs/user_guide/workloads/kuberay/_ray_operator.mdx b/docs/user_guide/workloads/kuberay/_ray_operator.mdx index 55d81b3ba1f..c6664ba9fee 100644 --- a/docs/user_guide/workloads/kuberay/_ray_operator.mdx +++ b/docs/user_guide/workloads/kuberay/_ray_operator.mdx @@ -2,7 +2,7 @@ ``` helm repo add kuberay https://ray-project.github.io/kuberay-helm/ helm repo update -helm install kuberay-operator kuberay/kuberay-operator --version 1.1.1 +helm install kuberay-operator kuberay/kuberay-operator --version 1.2.2 --set batchScheduler.name=yunikorn ``` - The result should be as shown below ![ray_cluster_operator](../../../assets/ray_cluster_operator.png) diff --git a/docs/user_guide/workloads/run_ray_cluster.md b/docs/user_guide/workloads/run_ray_cluster.md index edae78fec1a..ef57e4a9ac7 100644 --- a/docs/user_guide/workloads/run_ray_cluster.md +++ b/docs/user_guide/workloads/run_ray_cluster.md @@ -29,23 +29,138 @@ specific language governing permissions and limitations under the License. --> -:::info[Note] -This example demonstrates how to set up [KubeRay](https://docs.ray.io/en/master/cluster/kubernetes/getting-started.html) and run a [RayCluster](https://docs.ray.io/en/master/cluster/kubernetes/getting-started/raycluster-quick-start.html) with the YuniKorn scheduler. It relies on an admission controller to configure the default applicationId and queue name. If you want more details, please refer to [Yunikorn supported labels](https://yunikorn.apache.org/docs/user_guide/labels_and_annotations_in_yunikorn) and [Yunikorn queue setting](https://yunikorn.apache.org/docs/user_guide/queue_config). +:::note +This example demonstrates how to set up [KubeRay](https://docs.ray.io/en/master/cluster/kubernetes/getting-started.html) and run a [RayCluster](https://docs.ray.io/en/master/cluster/kubernetes/getting-started/raycluster-quick-start.html) with the YuniKorn scheduler. Here're the pre-requisites: +- This tutorial assumes YuniKorn is [installed](../../get_started/get_started.md) under the namespace `yunikorn` +- Use kube-ray version >= 1.2.2 to enable support for YuniKorn gang scheduling ::: - +## Install YuniKorn + +A simple script to install YuniKorn under the namespace `yunikorn`, refer to [Get Started](../../get_started/get_started.md) for more details. + +```shell script +helm repo add yunikorn https://apache.github.io/yunikorn-release +helm repo update +helm install yunikorn yunikorn/yunikorn --create-namespace --namespace yunikorn +``` + -## Create RayCluster +## Create RayCluster with YuniKorn + +In the example, we set the `ray.io/gang-scheduling-enabled` label to `true` to enable gang scheduling. + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +```yaml +cat < + + +```yaml +cat < + + - RayCluster result ![ray_cluster_cluster](../../assets/ray_cluster_cluster.png) - YuniKorn UI ![ray_cluster_on_ui](../../assets/ray_cluster_on_ui.png) - - ## Submit a RayJob to RayCluster ``` @@ -57,10 +172,12 @@ kubectl exec -it $HEAD_POD -- python -c "import ray; ray.init(); print(ray.clust Services in Kubernetes aren't directly accessible by default. However, you can use port-forwarding to connect to them locally. ``` -kubectl port-forward service/raycluster-kuberay-head-svc 8265:8265 +kubectl port-forward service/test-yunikorn-0-head-svc 8265:8265 ``` After port-forward set up, you can access the Ray dashboard by going to `http://localhost:8265` in your web browser. - Ray Dashboard ![ray_cluster_ray_dashborad](../../assets/ray_cluster_ray_dashborad.png) +Have doubts? Check out the [KubeRay integration with Apache YuniKorn](https://docs.ray.io/en/master/cluster/kubernetes/k8s-ecosystem/yunikorn.html) official documents. +