From f79a9a720807ae7d50fd99d8b801627bbaba7cf9 Mon Sep 17 00:00:00 2001 From: Yicheng-Lu-llll <51814063+Yicheng-Lu-llll@users.noreply.github.com> Date: Mon, 4 Mar 2024 16:28:56 -0600 Subject: [PATCH] [Doc][KubeRay] Update RayCluster and RayJob's Quickstart Doc to v1.1.0-rc.0 Signed-off-by: Yicheng-Lu-llll --- .../getting-started/raycluster-quick-start.md | 10 +++--- .../getting-started/rayjob-quick-start.md | 31 +++++++------------ 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/doc/source/cluster/kubernetes/getting-started/raycluster-quick-start.md b/doc/source/cluster/kubernetes/getting-started/raycluster-quick-start.md index 09d533a55dbe..38ffb0dfd220 100644 --- a/doc/source/cluster/kubernetes/getting-started/raycluster-quick-start.md +++ b/doc/source/cluster/kubernetes/getting-started/raycluster-quick-start.md @@ -26,8 +26,8 @@ Deploy the KubeRay operator with the [Helm chart repository](https://github.com/ helm repo add kuberay https://ray-project.github.io/kuberay-helm/ helm repo update -# Install both CRDs and KubeRay operator v1.0.0. -helm install kuberay-operator kuberay/kuberay-operator --version 1.0.0 +# Install both CRDs and KubeRay operator v1.1.0-rc.0. +helm install kuberay-operator kuberay/kuberay-operator --version 1.1.0-rc.0 # Confirm that the operator is running in the namespace `default`. kubectl get pods @@ -43,13 +43,13 @@ Once the KubeRay operator is running, we are ready to deploy a RayCluster. To do ```sh # Deploy a sample RayCluster CR from the KubeRay Helm chart repo: -helm install raycluster kuberay/ray-cluster --version 1.0.0 +helm install raycluster kuberay/ray-cluster --version 1.1.0-rc.0 # Once the RayCluster CR has been created, you can view it by running: kubectl get rayclusters -# NAME DESIRED WORKERS AVAILABLE WORKERS STATUS AGE -# raycluster-kuberay 1 1 ready 72s +# NAME DESIRED WORKERS AVAILABLE WORKERS CPUS MEMORY GPUS STATUS AGE +# raycluster-kuberay 1 1 2 3G 0 ready 95s ``` The KubeRay operator will detect the RayCluster object. The operator will then start your Ray cluster by creating head and worker pods. To view Ray cluster's pods, run the following command: diff --git a/doc/source/cluster/kubernetes/getting-started/rayjob-quick-start.md b/doc/source/cluster/kubernetes/getting-started/rayjob-quick-start.md index e56f830d0137..6563dfbc7f85 100644 --- a/doc/source/cluster/kubernetes/getting-started/rayjob-quick-start.md +++ b/doc/source/cluster/kubernetes/getting-started/rayjob-quick-start.md @@ -61,11 +61,7 @@ Follow the [RayCluster Quickstart](kuberay-operator-deploy) to install the lates ## Step 3: Install a RayJob ```sh -# Step 3.1: Download `ray-job.sample.yaml` -curl -LO https://raw.githubusercontent.com/ray-project/kuberay/ray-operator/v1.1.0-alpha.0/ray-operator/config/samples/ray-job.sample.yaml - -# Step 3.2: Create a RayJob -kubectl apply -f ray-job.sample.yaml +kubectl apply -f https://raw.githubusercontent.com/ray-project/kuberay/v1.1.0-rc.0/ray-operator/config/samples/ray-job.sample.yaml ``` ## Step 4: Verify the Kubernetes cluster status @@ -75,8 +71,8 @@ kubectl apply -f ray-job.sample.yaml kubectl get rayjob # [Example output] -# NAME AGE -# rayjob-sample 7s +# NAME JOB STATUS DEPLOYMENT STATUS START TIME END TIME AGE +# rayjob-sample Running 2024-03-02T19:09:15Z 96s # Step 4.2: List all RayCluster custom resources in the `default` namespace. kubectl get raycluster @@ -145,21 +141,19 @@ The Python script `sample_code.py` used by `entrypoint` is a simple Ray script t ## Step 6: Delete the RayJob ```sh -kubectl delete -f ray-job.sample.yaml +kubectl delete -f https://raw.githubusercontent.com/ray-project/kuberay/v1.1.0-rc.0/ray-operator/config/samples/ray-job.sample.yaml ``` ## Step 7: Create a RayJob with `shutdownAfterJobFinishes` set to true ```sh -# Step 7.1: Download `ray-job.shutdown.yaml` -curl -LO https://raw.githubusercontent.com/ray-project/kuberay/ray-operator/v1.1.0-alpha.0/ray-operator/config/samples/ray-job.shutdown.yaml - -# Step 7.2: Create a RayJob -kubectl apply -f ray-job.shutdown.yaml +kubectl apply -f https://raw.githubusercontent.com/ray-project/kuberay/v1.1.0-rc.0/ray-operator/config/samples/ray-job.shutdown.yaml ``` The `ray-job.shutdown.yaml` defines a RayJob custom resource with `shutdownAfterJobFinishes: true` and `ttlSecondsAfterFinished: 10`. -Hence, the KubeRay operator deletes the RayCluster and the submitter 10 seconds after the Ray job finishes. +Hence, the KubeRay operator deletes the RayCluster 10 seconds after the Ray job finishes. Note that the submitter job is not deleted +because it contains the ray job logs and does not use any cluster resources once completed. In addition, the submitter job will always +be cleaned up when the RayJob is eventually deleted due to its owner reference back to the RayJob. ## Step 8: Check the RayJob status @@ -169,20 +163,19 @@ kubectl get rayjobs.ray.io rayjob-sample-shutdown -o jsonpath='{.status.jobDeplo kubectl get rayjobs.ray.io rayjob-sample-shutdown -o jsonpath='{.status.jobStatus}' ``` -## Step 9: Check if the KubeRay operator deletes the RayCluster and the submitter +## Step 9: Check if the KubeRay operator deletes the RayCluster ```sh -# List the RayCluster custom resources in the `default` namespace. The RayCluster and the submitter Kubernetes -# Job associated with the RayJob `rayjob-sample-shutdown` should be deleted. +# List the RayCluster custom resources in the `default` namespace. The RayCluster +# associated with the RayJob `rayjob-sample-shutdown` should be deleted. kubectl get raycluster -kubectl get jobs ``` ## Step 10: Clean up ```sh # Step 10.1: Delete the RayJob -kubectl delete -f ray-job.shutdown.yaml +kubectl delete -f https://raw.githubusercontent.com/ray-project/kuberay/v1.1.0-rc.0/ray-operator/config/samples/ray-job.shutdown.yaml # Step 10.2: Delete the KubeRay operator helm uninstall kuberay-operator