Skip to content

Commit

Permalink
Add templated Ray cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2b3bfa0 authored Aug 16, 2023
1 parent a56a772 commit 5630521
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/helm-lint-and-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- name: Add external repositories
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add kuberay https://ray-project.github.io/kuberay-helm
- name: Run chart-testing (list-changed)
id: list-changed
Expand Down
7 changes: 5 additions & 2 deletions charts/studio/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 11.9.13
digest: sha256:17b45dd98206bc3856d787b7399053996e6039ec8b52c9e00a501e7fcd896765
generated: "2023-07-28T20:11:07.578307878Z"
- name: kuberay-operator
repository: https://ray-project.github.io/kuberay-helm
version: 0.6.0
digest: sha256:3b2dc8c1ca3e1841605034aca0e0dd7119c1fbcf17eecc47c997bf4510bce4cf
generated: "2023-08-16T00:49:28.269211675Z"
4 changes: 4 additions & 0 deletions charts/studio/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ dependencies:
condition: postgresql.enabled
version: "11.9.13"
repository: "https://charts.bitnami.com/bitnami"
- name: kuberay-operator
condition: ray.enabled
version: "0.6.0"
repository: "https://ray-project.github.io/kuberay-helm"
3 changes: 3 additions & 0 deletions charts/studio/templates/configmap-studio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ data:
DQL_UDF_ENABLED: {{ $dvcx.udfEnabled | default "False" | quote }}
DVCX_ENABLED: {{ $dvcx.enabled | default "False" | quote }}
DVCX_UDF_ENABLED: {{ $dvcx.udfEnabled | default "False" | quote }}
{{- if .Values.ray.enabled }}
DVCX_RAY_URL: "http://{{ .Values.ray.fullnameOverride }}-head-svc.{{ .Release.Namespace }}.svc.cluster.local:8265"
{{- end }}

DQL_ROOT_DIR: {{ $dvcx.rootDir | default "/tmp" | quote }}
DQL_CH_HOST: {{ $dvcxClickhouse.host | default "" | quote }}
Expand Down
70 changes: 70 additions & 0 deletions charts/studio/templates/raycluster-studio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{{- if .Values.ray.enabled }}
apiVersion: ray.io/v1alpha1
kind: RayCluster
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: {{ .Release.Name }}-ray
spec:
rayVersion: {{ .Values.ray.version }}
enableInTreeAutoscaling: true
autoscalerOptions:
upscalingMode: Default
idleTimeoutSeconds: 60
imagePullPolicy: IfNotPresent
resources:
resources:
cpu: 500m
memory: 500M
resources:
cpu: 500m
memory: 500M
headGroupSpec:
rayStartParams:
dashboard-host: 0.0.0.0
template:
spec:
containers:
- name: head
image: {{ .Values.ray.image }}
resources:
requests:
cpu: {{ .Values.ray.head.resources.cpu }}
memory: {{ .Values.ray.head.resources.memory }}
limits:
cpu: {{ .Values.ray.head.resources.cpu }}
memory: {{ .Values.ray.head.resources.memory }}
ports:
- containerPort: 6379
name: gcs
- containerPort: 8265
name: dashboard
- containerPort: 10001
name: client
lifecycle:
preStop:
exec:
command: ["/bin/sh","-c","ray stop"]
workerGroupSpecs:
- replicas: {{ .Values.ray.worker.replicas.minimum }}
minReplicas: {{ .Values.ray.worker.replicas.minimum }}
maxReplicas: {{ .Values.ray.worker.replicas.maximum }}
groupName: workers
rayStartParams: {}
template:
spec:
containers:
- name: worker
image: {{ .Values.ray.image }}
resources:
requests:
cpu: {{ .Values.ray.worker.resources.cpu }}
memory: {{ .Values.ray.worker.resources.memory }}
limits:
cpu: {{ .Values.ray.worker.resources.cpu }}
memory: {{ .Values.ray.worker.resources.memory }}
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "ray stop"]
{{- end }}
28 changes: 28 additions & 0 deletions charts/studio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,34 @@ postgresql:
# -- Postgres database
database: iterativeai

ray:
# -- Ray enabled
enabled: false
# -- Ray name override
fullnameOverride: {{ .Release.Name }}-ray

# -- Container image used for Ray nodes
image: rayproject/ray:2.4.0-py310-cpu

# -- Ray version
version: 2.4.0

# Recommendation: adjust resources (i.e. requests & limits) so a single
# head or worker is scheduled on each Kubernetes node.

head:
resources:
cpu: 2
memory: 8G

worker:
resources:
cpu: 2
memory: 8G
replicas:
minimum: 1
maximum: 4

# -- Studio UI settings group
studioUi:
# -- Additional environment variables for ui pods
Expand Down

0 comments on commit 5630521

Please sign in to comment.