-
Notifications
You must be signed in to change notification settings - Fork 7k
[Test][KubeRay] Add doctest for RayCluster Quickstart doc #51249
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| echo "--- Setup k8s environment" | ||
| SKIP_CREATE_KIND_CLUSTER=1 bash ci/k8s/prep-k8s-environment.sh | ||
|
|
||
| echo "--- Install Python dependencies" | ||
| pip install -c python/requirements_compiled.txt pytest nbval bash_kernel | ||
| python -m bash_kernel.install | ||
| pip install "ray[default]==2.41.0" | ||
|
|
||
| echo "--- Run doc tests" | ||
| cd doc/source/cluster/kubernetes | ||
| py.test --nbval getting-started/raycluster-quick-start.ipynb --nbval-kernel-name bash --sanitize-with doc_sanitize.cfg | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| [kuberay-operator-pod-name] | ||
| regex: kuberay-operator-[a-z0-9]{10}-[a-z0-9]{5} | ||
| replace: KUBERAY-OPERATOR-POD-NAME | ||
|
|
||
| [raycluster-head-pod-name] | ||
| regex: raycluster-kuberay-workergroup-worker-[a-z0-9]{5} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For KubeRay v1.4.0, the naming changes a bit. This may require some updates in the future.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes we need to go back to change this doc after 1.4.0 release. But for now let's keep the naming here. |
||
| replace: RAYCLUSTER-HEAD-POD-NAME | ||
|
|
||
| [raycluster-worker-pod-name] | ||
| regex: raycluster-kuberay-head-[a-z0-9]{5} | ||
| replace: RAYCLUSTER-WORKER-POD-NAME | ||
|
|
||
| [rayjob-submit-name] | ||
| regex: raysubmit_[a-zA-Z0-9]{16} | ||
| replace: RAYJOB-SUBMIT-NAME | ||
|
|
||
| [time-duration] | ||
| regex: \d+m\d+s|\d+m|\d+s | ||
| replace: TIME-DURATION | ||
|
|
||
| [python-logger-prefix] | ||
| regex: \d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2},\d{3}\s+[A-Z]+\s+[\w\.]+:\d+\s+-- | ||
| replace: PYTHON-LOGGER-PREFIX | ||
|
|
||
| [ray-cluster-resources-object-store-memory] | ||
| regex: 'object_store_memory'\s*:\s*\d+(?:\.\d+)?\} | ||
| replace: RAY-CLUSTER-RESOURCES-OBJECT-STORE-MEMORY | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| (kuberay-operator-deploy)= | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doc requires doc team to review cc @angelinalg. |
||
|
|
||
| # KubeRay Operator Installation | ||
|
|
||
| ## Step 1: Create a Kubernetes cluster | ||
|
|
||
| This step creates a local Kubernetes cluster using [Kind](https://kind.sigs.k8s.io/). If you already have a Kubernetes cluster, you can skip this step. | ||
|
|
||
| ```sh | ||
| kind create cluster --image=kindest/node:v1.26.0 | ||
| ``` | ||
|
|
||
| ## Step 2: Install KubeRay operator | ||
|
|
||
| ### Method 1: Helm (Recommended) | ||
|
|
||
| ```sh | ||
| helm repo add kuberay https://ray-project.github.io/kuberay-helm/ | ||
| helm repo update | ||
| # Install both CRDs and KubeRay operator v1.3.0. | ||
| helm install kuberay-operator kuberay/kuberay-operator --version 1.3.0 | ||
| ``` | ||
|
|
||
| ### Method 2: Kustomize | ||
|
|
||
| ```sh | ||
| # Install CRD and KubeRay operator. | ||
| kubectl create -k "github.com/ray-project/kuberay/ray-operator/config/default?ref=v1.3.0" | ||
| ``` | ||
|
|
||
| ## Step 3: Validate Installation | ||
|
|
||
| Confirm that the operator is running in the namespace `default`. | ||
|
|
||
| ```sh | ||
| kubectl get pods | ||
| ``` | ||
|
|
||
| ```text | ||
| NAME READY STATUS RESTARTS AGE | ||
| kuberay-operator-6bc45dd644-gwtqv 1/1 Running 0 24s | ||
| ``` | ||
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.
What's the test plan for kuberay doc test? Are we going to manually add each doc file to this?
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.
Currently, yes. I haven't found a good way to identify which files contain doc tests yet. Maybe we can search all
.ipynbfiles under the current directory and check whether their kernel isbash_kernelto find those that contain doc tests.