Skip to content

Commit 1d3f537

Browse files
authored
[Feature] Run config tests with the latest release of KubeRay operator (ray-project#858)
Currently, we only run config tests with the nightly KubeRay operator. However, we also need to keep the compatibility of the current sample YAML files with the latest KubeRay operator release. If not, some bugs may happen (e.g. ray-project#856).
1 parent 3aebd8c commit 1d3f537

14 files changed

+47
-13
lines changed

.github/workflows/actions/configuration/action.yaml

+16-6
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,22 @@ runs:
4848
docker images ls -a
4949
shell: bash
5050

51-
- name: Run configuration tests for sample YAML files.
52-
# Depends on the KubeRay operator image built in previous steps.
51+
- name: Run tests for sample YAML files with the nightly operator.
52+
# Depends on the KubeRay operator image built in previous steps
53+
env:
54+
GITHUB_ACTIONS: true
55+
RAY_IMAGE: rayproject/ray:${{ inputs.ray_version }}
56+
OPERATOR_IMAGE: kuberay/operator:${{ steps.vars.outputs.sha_short }}
57+
run: |
58+
python tests/test_sample_raycluster_yamls.py
59+
shell: bash
60+
61+
- name: Run tests for sample YAML files with the latest KubeRay release.
62+
# Depends on latest KubeRay release.
63+
env:
64+
GITHUB_ACTIONS: true
65+
RAY_IMAGE: rayproject/ray:${{ inputs.ray_version }}
66+
OPERATOR_IMAGE: kuberay/operator:v0.4.0 # The operator image in the latest KubeRay release.
5367
run: |
54-
echo "Using Ray image ${{ inputs.ray_version }}"
55-
GITHUB_ACTIONS=true \
56-
RAY_IMAGE="rayproject/ray:${{ inputs.ray_version }}" \
57-
OPERATOR_IMAGE="kuberay/operator:${{ steps.vars.outputs.sha_short }}" \
5868
python tests/test_sample_raycluster_yamls.py
5969
shell: bash

.github/workflows/test-job.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -378,3 +378,4 @@ jobs:
378378
- uses: ./.github/workflows/actions/configuration
379379
with:
380380
ray_version: 2.1.0
381+

docs/guidance/volcano-integration.md

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ metadata:
4444
spec:
4545
rayVersion: '2.2.0'
4646
headGroupSpec:
47+
serviceType: ClusterIP
4748
rayStartParams:
4849
block: 'true'
4950
replicas: 1
@@ -107,6 +108,7 @@ metadata:
107108
spec:
108109
rayVersion: '2.2.0'
109110
headGroupSpec:
111+
serviceType: ClusterIP
110112
rayStartParams:
111113
block: 'true'
112114
replicas: 1
@@ -220,6 +222,7 @@ metadata:
220222
spec:
221223
rayVersion: '2.2.0'
222224
headGroupSpec:
225+
serviceType: ClusterIP
223226
rayStartParams:
224227
block: 'true'
225228
replicas: 1

helm-chart/ray-cluster/values.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,6 @@ additionalWorkerGroups:
200200
sidecarContainers: []
201201

202202
# Configuration for Head's Kubernetes Service
203-
service: {}
204-
# type: ClusterIP # The default type is ClusterIP.
203+
service:
204+
# This is optional, and the default is ClusterIP.
205+
type: ClusterIP

ray-operator/config/samples/ray-cluster.autoscaler.large.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ spec:
5757
memory: "512Mi"
5858
# Ray head pod template
5959
headGroupSpec:
60+
serviceType: ClusterIP # optional
6061
# the following params are used to complete the ray start: ray start --head --block --port=6379 ...
6162
rayStartParams:
6263
# Flag "no-monitor" will be automatically set when autoscaling is enabled.

ray-operator/config/samples/ray-cluster.autoscaler.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ spec:
4949
memory: "512Mi"
5050
# Ray head pod template
5151
headGroupSpec:
52+
serviceType: ClusterIP # optional
5253
# the following params are used to complete the ray start: ray start --head --block ...
5354
rayStartParams:
5455
dashboard-host: '0.0.0.0'

ray-operator/config/samples/ray-cluster.external-redis.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ metadata:
7979
spec:
8080
rayVersion: '2.2.0'
8181
headGroupSpec:
82+
serviceType: ClusterIP # optional
8283
replicas: 1
8384
rayStartParams:
8485
dashboard-host: '0.0.0.0'

ray-operator/config/samples/ray-cluster.getting-started.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ spec:
1313
rayVersion: '2.2.0' # should match the Ray version in the image of the containers
1414
# Ray head pod template
1515
headGroupSpec:
16+
serviceType: ClusterIP # optional
1617
# the following params are used to complete the ray start: ray start --head --block ...
1718
rayStartParams:
1819
dashboard-host: '0.0.0.0'

ray-operator/config/samples/ray-cluster.heterogeneous.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spec:
3838
######################headGroupSpecs#################################
3939
# Ray head pod template
4040
headGroupSpec:
41+
serviceType: ClusterIP # optional
4142
# the following params are used to complete the ray start: ray start --head --block ...
4243
rayStartParams:
4344
dashboard-host: '0.0.0.0'

ray-operator/config/samples/ray-cluster.mini.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ spec:
1313
rayVersion: '2.2.0' # should match the Ray version in the image of the containers
1414
# Ray head pod template
1515
headGroupSpec:
16+
serviceType: ClusterIP # optional
1617
# the following params are used to complete the ray start: ray start --head --block --redis-port=6379 ...
1718
rayStartParams:
1819
dashboard-host: '0.0.0.0'

ray-operator/config/samples/ray_v1alpha1_rayjob.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ spec:
1818
rayVersion: '2.2.0' # should match the Ray version in the image of the containers
1919
# Ray head pod template
2020
headGroupSpec:
21+
serviceType: ClusterIP # optional
2122
# the following params are used to complete the ray start: ray start --head --block --redis-port=6379 ...
2223
rayStartParams:
2324
dashboard-host: '0.0.0.0'

ray-operator/config/samples/ray_v1alpha1_rayservice.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
######################headGroupSpecs#################################
4747
# Ray head pod template.
4848
headGroupSpec:
49+
serviceType: ClusterIP # optional
4950
# the following params are used to complete the ray start: ray start --head --block --redis-port=6379 ...
5051
rayStartParams:
5152
port: '6379' # should match container port named gcs-server

ray-operator/config/security/ray-cluster.pod-security.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ spec:
1313
rayVersion: '2.2.0'
1414
# Ray head pod configuration
1515
headGroupSpec:
16+
serviceType: ClusterIP # optional
1617
# for the head group, replicas should always be 1.
1718
# headGroupSpec.replicas is deprecated in KubeRay >= 0.3.0.
1819
replicas: 1

tests/framework/utils.py

+15-5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class CONST:
1717
# Docker images
1818
OPERATOR_IMAGE_KEY = "kuberay-operator-image"
1919
RAY_IMAGE_KEY = "ray-image"
20+
KUBERAY_LATEST_RELEASE = "kuberay/operator:v0.4.0"
2021

2122
# Kubernetes API clients
2223
K8S_CR_CLIENT_KEY = "k8s-cr-api-client"
@@ -109,12 +110,21 @@ def download_images():
109110

110111
def __install_crd_and_operator(self):
111112
"""Install both CRD and KubeRay operator by kuberay-operator chart"""
112-
logger.info("Install both CRD and KubeRay operator by kuberay-operator chart")
113113
repo, tag = self.docker_image_dict[CONST.OPERATOR_IMAGE_KEY].split(':')
114-
shell_subprocess_run(
115-
f"helm install kuberay-operator {CONST.HELM_CHART_ROOT}/kuberay-operator/ "
116-
f"--set image.repository={repo},image.tag={tag}"
117-
)
114+
if f"{repo}:{tag}" == CONST.KUBERAY_LATEST_RELEASE:
115+
logger.info("Install both CRD and KubeRay operator with the latest release.")
116+
shell_subprocess_run(
117+
"helm repo add kuberay https://ray-project.github.io/kuberay-helm/"
118+
)
119+
shell_subprocess_run(
120+
f"helm install kuberay-operator kuberay/kuberay-operator --version {tag[1:]}"
121+
)
122+
else:
123+
logger.info("Install both nightly CRD and KubeRay operator by kuberay-operator chart")
124+
shell_subprocess_run(
125+
f"helm install kuberay-operator {CONST.HELM_CHART_ROOT}/kuberay-operator/ "
126+
f"--set image.repository={repo},image.tag={tag}"
127+
)
118128

119129
def shell_subprocess_run(command, check = True):
120130
"""

0 commit comments

Comments
 (0)