Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .buildkite/kuberay.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ steps:
- forge
- raycpubase

- label: ":kubernetes: kuberay doc tests"
tags:
- python
- docker
instance_type: medium
commands:
- bash ci/k8s/run-kuberay-doc-tests.sh
docker_network: "host"
depends_on:
- k8sbuild
- manylinux
- forge
- raycpubase

- label: ":kubernetes: chaos {{matrix.workload}} under {{matrix.fault}}"
key: kuberay_tests
tags:
Expand Down
6 changes: 5 additions & 1 deletion ci/k8s/prep-k8s-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ set -x # Be more verbose now.
# Delete dangling clusters
kind delete clusters --all

# Create the cluster
# Exit directly if SKIP_CREATE_KIND_CLUSTER is set
if [[ -n "${SKIP_CREATE_KIND_CLUSTER:-}" ]]; then
echo "SKIP_CREATE_KIND_CLUSTER is set. Skipping creating kind cluster."
exit 0
fi
kind create cluster --wait 120s --config ci/k8s/kind.config.yaml

# Verify the kubectl works
Expand Down
15 changes: 15 additions & 0 deletions ci/k8s/run-kuberay-doc-tests.sh
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
Copy link
Collaborator

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?

Copy link
Member Author

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 .ipynb files under the current directory and check whether their kernel is bash_kernel to find those that contain doc tests.

27 changes: 27 additions & 0 deletions doc/source/cluster/kubernetes/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}
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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
1 change: 1 addition & 0 deletions doc/source/cluster/kubernetes/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
```{toctree}
:hidden:

getting-started/kuberay-operator-installation
getting-started/raycluster-quick-start
getting-started/rayjob-quick-start
getting-started/rayservice-quick-start
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
(kuberay-operator-deploy)=
Copy link
Member

Choose a reason for hiding this comment

The 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
```
Loading