Skip to content

Commit d55dfc3

Browse files
authored
[Doc] add ray cluster uv sample yaml (#3720)
1 parent 23d0195 commit d55dfc3

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
apiVersion: ray.io/v1
2+
kind: RayCluster
3+
metadata:
4+
name: raycluster-uv
5+
spec:
6+
rayVersion: '2.46.0' # should match the Ray version in the image of the containers
7+
headGroupSpec:
8+
rayStartParams: {}
9+
template:
10+
spec:
11+
containers:
12+
- name: ray-head
13+
image: rayproject/ray:2.46.0
14+
env:
15+
- name: RAY_RUNTIME_ENV_HOOK
16+
value: ray._private.runtime_env.uv_runtime_env_hook.hook
17+
resources:
18+
limits:
19+
cpu: 1
20+
memory: 2Gi
21+
requests:
22+
cpu: 500m
23+
memory: 2Gi
24+
ports:
25+
- containerPort: 6379
26+
name: gcs-server
27+
- containerPort: 8265 # Ray dashboard
28+
name: dashboard
29+
- containerPort: 10001
30+
name: client
31+
volumeMounts:
32+
- mountPath: /home/ray/samples
33+
name: code-sample
34+
volumes:
35+
- name: code-sample
36+
configMap:
37+
name: ray-uv-code-sample
38+
items:
39+
- key: sample_code.py
40+
path: sample_code.py
41+
42+
---
43+
apiVersion: v1
44+
kind: ConfigMap
45+
metadata:
46+
name: ray-uv-code-sample
47+
data:
48+
sample_code.py: |
49+
import emoji
50+
import ray
51+
52+
@ray.remote
53+
def f():
54+
return emoji.emojize('Python is :thumbs_up:')
55+
56+
# Execute 10 copies of f across a cluster.
57+
print(ray.get([f.remote() for _ in range(10)]))

0 commit comments

Comments
 (0)