You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, Ray usage statistics collection is **disabled** in Ray Clusters created with the Codeflare SDK. This prevents statistics from being captured and sent externally. If you want to enable usage statistics collection, you can simply set the ``enable_usage_stats`` parameter to ``True`` in your cluster configuration:
49
+
By default, Ray usage statistics collection is **disabled** in Ray Clusters created with the CodeFlare SDK. This prevents statistics from being captured and sent externally. If you want to enable usage statistics collection, you can simply set the ``enable_usage_stats`` parameter to ``True`` in your cluster configuration:
51
50
52
51
.. code:: python
53
52
54
-
from codeflare_sdk importCluster, ClusterConfiguration
53
+
from codeflare_sdk.ray.rayclustersimportRayCluster
55
54
56
-
cluster =Cluster(ClusterConfiguration(
55
+
cluster =RayCluster(
57
56
name='ray-example',
58
57
namespace='default',
59
58
enable_usage_stats=True
60
-
))
59
+
)
61
60
62
61
This will automatically set the ``RAY_USAGE_STATS_ENABLED`` environment variable to ``1`` for all Ray pods in the cluster. If you do not set this parameter, usage statistics will remain disabled (``RAY_USAGE_STATS_ENABLED=0``).
63
62
64
63
The ``labels={"exampleLabel": "example"}`` parameter can be used to
65
64
apply additional labels to the RayCluster resource.
66
65
67
-
After creating their ``cluster``, a user can call ``cluster.apply()`` and
68
-
``cluster.down()`` to respectively create or remove the Ray Cluster.
66
+
After creating your ``cluster``, call ``cluster.apply()`` to deploy it and
67
+
``cluster.down()`` to remove it:
68
+
69
+
.. code:: python
70
+
71
+
# Deploy the cluster
72
+
cluster.apply()
73
+
74
+
# Wait for cluster to be ready
75
+
cluster.wait_ready()
76
+
77
+
# Check cluster status
78
+
cluster.status()
79
+
80
+
# Remove the cluster when done
81
+
cluster.down()
69
82
70
83
Custom Volumes/Volume Mounts
71
84
----------------------------
72
-
|To add custom Volumes and Volume Mounts to your Ray Cluster you need to create two lists ``volumes`` and ``volume_mounts``. The lists consist of ``V1Volume`` and ``V1VolumeMount`` objects respectively.
73
-
|Populating these parameters will create Volumes and Volume Mounts for the head and each worker pod.
85
+
86
+
To add custom Volumes and Volume Mounts to your Ray Cluster you need to create two lists ``volumes`` and ``volume_mounts``. The lists consist of ``V1Volume`` and ``V1VolumeMount`` objects respectively.
87
+
Populating these parameters will create Volumes and Volume Mounts for the head and each worker pod.
74
88
75
89
.. code:: python
76
90
77
-
from kubernetes.client import V1Volume, V1VolumeMount, V1EmptyDirVolumeSource, V1ConfigMapVolumeSource, V1KeyToPath, V1SecretVolumeSource
78
-
# In this example we are using the Config Map, EmptyDir and Secret Volume types
|For more information on creating Volumes and Volume Mounts with Python check out the Python Kubernetes docs (`Volumes <https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1Volume.md>`__, `Volume Mounts <https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1VolumeMount.md>`__).
115
-
|You can also find further information on Volumes and Volume Mounts by visiting the Kubernetes `documentation <https://kubernetes.io/docs/concepts/storage/volumes/>`__.
91
+
from kubernetes.client import V1Volume, V1VolumeMount, V1EmptyDirVolumeSource, V1ConfigMapVolumeSource, V1KeyToPath, V1SecretVolumeSource
92
+
93
+
# In this example we are using the Config Map, EmptyDir and Secret Volume types
For more information on creating Volumes and Volume Mounts with Python check out the Python Kubernetes docs (`Volumes <https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1Volume.md>`__, `Volume Mounts <https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1VolumeMount.md>`__).
137
+
You can also find further information on Volumes and Volume Mounts by visiting the Kubernetes `documentation <https://kubernetes.io/docs/concepts/storage/volumes/>`__.
116
138
117
139
GCS Fault Tolerance
118
-
------------------
140
+
-------------------
141
+
119
142
By default, the state of the Ray cluster is transient to the head Pod. Whatever triggers a restart of the head Pod results in losing that state, including Ray Cluster history. To make Ray cluster state persistent you can enable Global Control Service (GCS) fault tolerance with an external Redis storage.
120
143
121
144
To configure GCS fault tolerance you need to set the following parameters:
@@ -139,9 +162,9 @@ Example configuration:
139
162
140
163
.. code:: python
141
164
142
-
from codeflare_sdk importCluster, ClusterConfiguration
165
+
from codeflare_sdk.ray.rayclustersimportRayCluster
143
166
144
-
cluster =Cluster(ClusterConfiguration(
167
+
cluster =RayCluster(
145
168
name='ray-cluster-with-persistence',
146
169
num_workers=2,
147
170
enable_gcs_ft=True,
@@ -150,8 +173,8 @@ Example configuration:
150
173
"name": "redis-password-secret",
151
174
"key": "password"
152
175
},
153
-
# external_storage_namespace="my-custom-namespace" # Optional: Custom namespace for GCS data in Redis
0 commit comments