-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Test] Use GcsFaultToleranceOptions in test and backward compatibility #2972
Merged
kevin85421
merged 3 commits into
ray-project:master
from
fscnick:test-use-gcsftoptions-and-backward-compatibility
Feb 7, 2025
+240
−46
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
198 changes: 198 additions & 0 deletions
198
ray-operator/config/samples/ray-cluster.deprecate-gcs-ft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
apiVersion: ray.io/v1 | ||
kind: RayCluster | ||
metadata: | ||
annotations: | ||
ray.io/ft-enabled: "true" # enable Ray GCS FT | ||
# In most cases, you don't need to set `ray.io/external-storage-namespace` because KubeRay will | ||
# automatically set it to the UID of RayCluster. Only modify this annotation if you fully understand | ||
# the behaviors of the Ray GCS FT and RayService to avoid misconfiguration. | ||
# [Example]: | ||
# ray.io/external-storage-namespace: "my-raycluster-storage" | ||
name: raycluster-external-redis | ||
spec: | ||
rayVersion: '2.41.0' | ||
headGroupSpec: | ||
# The `rayStartParams` are used to configure the `ray start` command. | ||
# See https://github.com/ray-project/kuberay/blob/master/docs/guidance/rayStartParams.md for the default settings of `rayStartParams` in KubeRay. | ||
# See https://docs.ray.io/en/latest/cluster/cli.html#ray-start for all available options in `rayStartParams`. | ||
rayStartParams: | ||
# Setting "num-cpus: 0" to avoid any Ray actors or tasks being scheduled on the Ray head Pod. | ||
num-cpus: "0" | ||
# redis-password should match "requirepass" in redis.conf in the ConfigMap above. | ||
# Ray 2.3.0 changes the default redis password from "5241590000000000" to "". | ||
redis-password: $REDIS_PASSWORD | ||
# Pod template | ||
template: | ||
spec: | ||
containers: | ||
- name: ray-head | ||
image: rayproject/ray:2.41.0 | ||
resources: | ||
limits: | ||
cpu: "1" | ||
requests: | ||
cpu: "1" | ||
env: | ||
# Ray will read the RAY_REDIS_ADDRESS environment variable to establish | ||
# a connection with the Redis server. In this instance, we use the "redis" | ||
# Kubernetes ClusterIP service name, also created by this YAML, as the | ||
# connection point to the Redis server. | ||
- name: RAY_REDIS_ADDRESS | ||
value: redis:6379 | ||
# This environment variable is used in the `rayStartParams` above. | ||
- name: REDIS_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: redis-password-secret | ||
key: password | ||
ports: | ||
- containerPort: 6379 | ||
name: redis | ||
- containerPort: 8265 | ||
name: dashboard | ||
- containerPort: 10001 | ||
name: client | ||
volumeMounts: | ||
- mountPath: /tmp/ray | ||
name: ray-logs | ||
- mountPath: /home/ray/samples | ||
name: ray-example-configmap | ||
volumes: | ||
- name: ray-logs | ||
emptyDir: {} | ||
- name: ray-example-configmap | ||
configMap: | ||
name: ray-example | ||
defaultMode: 0777 | ||
items: | ||
- key: detached_actor.py | ||
path: detached_actor.py | ||
- key: increment_counter.py | ||
path: increment_counter.py | ||
workerGroupSpecs: | ||
# the pod replicas in this group typed worker | ||
- replicas: 1 | ||
minReplicas: 1 | ||
maxReplicas: 10 | ||
groupName: small-group | ||
# The `rayStartParams` are used to configure the `ray start` command. | ||
# See https://github.com/ray-project/kuberay/blob/master/docs/guidance/rayStartParams.md for the default settings of `rayStartParams` in KubeRay. | ||
# See https://docs.ray.io/en/latest/cluster/cli.html#ray-start for all available options in `rayStartParams`. | ||
rayStartParams: {} | ||
# Pod template | ||
template: | ||
spec: | ||
containers: | ||
- name: ray-worker | ||
image: rayproject/ray:2.41.0 | ||
volumeMounts: | ||
- mountPath: /tmp/ray | ||
name: ray-logs | ||
resources: | ||
limits: | ||
cpu: "1" | ||
requests: | ||
cpu: "1" | ||
volumes: | ||
- name: ray-logs | ||
emptyDir: {} | ||
--- | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: redis-config | ||
labels: | ||
app: redis | ||
data: | ||
redis.conf: |- | ||
dir /data | ||
port 6379 | ||
bind 0.0.0.0 | ||
appendonly yes | ||
protected-mode no | ||
requirepass 5241590000000000 | ||
pidfile /data/redis-6379.pid | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: redis | ||
labels: | ||
app: redis | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: redis | ||
port: 6379 | ||
selector: | ||
app: redis | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: redis | ||
labels: | ||
app: redis | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: redis | ||
template: | ||
metadata: | ||
labels: | ||
app: redis | ||
spec: | ||
containers: | ||
- name: redis | ||
image: redis:7.4.0 | ||
command: | ||
- "sh" | ||
- "-c" | ||
- "redis-server /usr/local/etc/redis/redis.conf" | ||
ports: | ||
- containerPort: 6379 | ||
volumeMounts: | ||
- name: config | ||
mountPath: /usr/local/etc/redis/redis.conf | ||
subPath: redis.conf | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: redis-config | ||
--- | ||
# Redis password | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: redis-password-secret | ||
type: Opaque | ||
data: | ||
# echo -n "5241590000000000" | base64 | ||
password: NTI0MTU5MDAwMDAwMDAwMA== | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: ray-example | ||
data: | ||
detached_actor.py: | | ||
import ray | ||
|
||
@ray.remote(num_cpus=1) | ||
class Counter: | ||
def __init__(self): | ||
self.value = 0 | ||
|
||
def increment(self): | ||
self.value += 1 | ||
return self.value | ||
|
||
ray.init(namespace="default_namespace") | ||
Counter.options(name="counter_actor", lifetime="detached").remote() | ||
increment_counter.py: | | ||
import ray | ||
|
||
ray.init(namespace="default_namespace") | ||
counter = ray.get_actor("counter_actor") | ||
print(ray.get(counter.increment.remote())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this file to test to ensure the change works.