Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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.43.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use the same version as the Ray images in the Ray documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to 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
Loading