Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions historyserver/config/raycluster-azureblob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ metadata:
name: raycluster-historyserver
namespace: default
spec:
# Enable Ray token authentication. Requires Ray 2.52.0+
# rayVersion: "2.52.0"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# rayVersion: "2.52.0"
# rayVersion: "2.56.0"

Follow the ray image that we use.

# authOptions:
# mode: token
headGroupSpec:
rayStartParams:
dashboard-host: 0.0.0.0
Expand Down Expand Up @@ -72,6 +76,13 @@ spec:
value: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite-service.azurite-dev.svc.cluster.local:10000/devstoreaccount1;"
- name: AZURE_STORAGE_CONTAINER
value: ray-historyserver
# Uncomment when the RayCluster sets `spec.authOptions.mode: token`; the collector
# needs the token to call the Dashboard.
# - name: RAY_AUTH_TOKEN
# valueFrom:
# secretKeyRef:
# name: raycluster-historyserver # defaults to the RayCluster name
# key: auth_token
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
Expand Down Expand Up @@ -146,6 +157,13 @@ spec:
value: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite-service.azurite-dev.svc.cluster.local:10000/devstoreaccount1;"
- name: AZURE_STORAGE_CONTAINER
value: ray-historyserver
# Uncomment when the RayCluster sets `spec.authOptions.mode: token`; the collector
# needs the token to call the Dashboard.
# - name: RAY_AUTH_TOKEN
# valueFrom:
# secretKeyRef:
# name: raycluster-historyserver # defaults to the RayCluster name
# key: auth_token
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
Expand Down
18 changes: 18 additions & 0 deletions historyserver/config/raycluster-gcs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ metadata:
name: raycluster-historyserver
namespace: default
spec:
# Enable Ray token authentication. Requires Ray 2.52.0+
# rayVersion: "2.52.0"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# rayVersion: "2.52.0"
# rayVersion: "2.56.0"

ditto

# authOptions:
# mode: token
headGroupSpec:
rayStartParams:
dashboard-host: 0.0.0.0
Expand Down Expand Up @@ -93,6 +97,13 @@ spec:
value: "gcs"
- name: EVENTS_PORT
value: "8084"
# Uncomment when the RayCluster sets `spec.authOptions.mode: token`; the collector
# needs the token to call the Dashboard.
# - name: RAY_AUTH_TOKEN
# valueFrom:
# secretKeyRef:
# name: ${RAY_CLUSTER} # defaults to the RayCluster name
# key: auth_token
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
Expand Down Expand Up @@ -165,6 +176,13 @@ spec:
value: "gcs"
- name: EVENTS_PORT
value: "8084"
# Uncomment when the RayCluster sets `spec.authOptions.mode: token`; the collector
# needs the token to call the Dashboard.
# - name: RAY_AUTH_TOKEN
# valueFrom:
# secretKeyRef:
# name: ${RAY_CLUSTER} # defaults to the RayCluster name
# key: auth_token
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
Expand Down
262 changes: 262 additions & 0 deletions historyserver/config/raycluster-kubernetes-auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
apiVersion: ray.io/v1
kind: RayCluster
metadata:
labels:
ray.io/cluster: raycluster-historyserver-kubernetes-auth
name: raycluster-historyserver-kubernetes-auth
spec:
# enableK8sTokenAuth requires Ray 2.55.0+. authOptions.secretName must NOT be
# set at the same time.
rayVersion: '2.55.0'
authOptions:
mode: 'token'
enableK8sTokenAuth: true
headGroupSpec:
rayStartParams:
dashboard-host: 0.0.0.0
num-cpus: "0"
template:
spec:
serviceAccountName: raycluster-historyserver-kubernetes-auth
containers:
- name: ray-head
imagePullPolicy: IfNotPresent
image: rayproject/ray:2.55.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ray 2.56.0

env:
- name: RAY_TMP_ROOT
value: &rayTmpRoot /tmp/ray
- name: RAY_enable_ray_event
value: "true"
- name: RAY_enable_core_worker_ray_event_to_aggregator
value: "true"
- name: RAY_DASHBOARD_AGGREGATOR_AGENT_EVENTS_EXPORT_ADDR
value: "http://localhost:8084/v1/events"
- name: RAY_DASHBOARD_AGGREGATOR_AGENT_PUBLISHER_HTTP_ENDPOINT_EXPOSABLE_EVENT_TYPES
value: &eventTypes "TASK_DEFINITION_EVENT,TASK_LIFECYCLE_EVENT,ACTOR_TASK_DEFINITION_EVENT,
TASK_PROFILE_EVENT,DRIVER_JOB_DEFINITION_EVENT,DRIVER_JOB_LIFECYCLE_EVENT,
ACTOR_DEFINITION_EVENT,ACTOR_LIFECYCLE_EVENT,NODE_DEFINITION_EVENT,NODE_LIFECYCLE_EVENT"
resources:
limits:
cpu: "5"
memory: "10Gi"
requests:
cpu: "50m"
memory: "1Gi"
ports:
- containerPort: 6379
name: gcs-server
- containerPort: 8265
name: dashboard
- containerPort: 10001
name: client
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
- name: collector
image: collector:v0.1.0
imagePullPolicy: IfNotPresent
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: FQ_RAY_IP
value: raycluster-historyserver-kubernetes-auth-head-svc.default.svc.cluster.local
- name: RAY_TMP_ROOT
value: *rayTmpRoot
# RAY_DASHBOARD_ADDRESS is used by the head collector to fetch endpoints' results
# (e.g., /api/v0/cluster_metadata) from the Ray Dashboard running in the same pod.
# Only the head collector uses this; worker collectors do not need it.
- name: RAY_DASHBOARD_ADDRESS
value: "http://localhost:8265"
- name: RAY_AUTH_MODE
value: "token"
- name: RAY_ENABLE_K8S_TOKEN_AUTH
value: "true"
- name: AWS_ACCESS_KEY_ID
value: minioadmin
- name: AWS_SECRET_ACCESS_KEY
value: minioadmin
- name: AWS_SESSION_TOKEN
value: ""
- name: S3_BUCKET
value: "ray-historyserver"
- name: S3_ENDPOINT
value: "minio-service.minio-dev:9000"
- name: S3_REGION
value: "test"
- name: S3FORCE_PATH_STYLE
value: "true"
- name: S3DISABLE_SSL
value: "true"
command:
- collector
- --role=Head
- --runtime-class-name=s3
- --ray-cluster-name=raycluster-historyserver-kubernetes-auth
- --ray-root-dir=log
- --events-port=8084
resources:
limits:
cpu: "200m"
memory: "256Mi"
requests:
cpu: "50m"
memory: "64Mi"
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
- name: ray-token
mountPath: /var/run/secrets/ray.io/serviceaccount
readOnly: true
volumes:
- name: historyserver
emptyDir: {}
workerGroupSpecs:
- replicas: 1
minReplicas: 1
maxReplicas: 5
groupName: workergroup
rayStartParams: {}
template:
spec:
serviceAccountName: raycluster-historyserver-kubernetes-auth
containers:
- name: ray-worker
imagePullPolicy: IfNotPresent
image: rayproject/ray:2.55.0
env:
- name: RAY_TMP_ROOT
value: *rayTmpRoot
- name: RAY_enable_ray_event
value: "true"
- name: RAY_enable_core_worker_ray_event_to_aggregator
value: "true"
- name: RAY_DASHBOARD_AGGREGATOR_AGENT_EVENTS_EXPORT_ADDR
value: "http://localhost:8084/v1/events"
- name: RAY_DASHBOARD_AGGREGATOR_AGENT_PUBLISHER_HTTP_ENDPOINT_EXPOSABLE_EVENT_TYPES
value: *eventTypes
resources:
limits:
cpu: "2"
memory: "2Gi"
requests:
cpu: "50m"
memory: "1Gi"
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
- name: collector
image: collector:v0.1.0
imagePullPolicy: IfNotPresent
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: FQ_RAY_IP
value: raycluster-historyserver-kubernetes-auth-head-svc.default.svc.cluster.local
- name: RAY_TMP_ROOT
value: *rayTmpRoot
- name: RAY_AUTH_MODE
value: "token"
- name: RAY_ENABLE_K8S_TOKEN_AUTH
value: "true"
- name: AWS_ACCESS_KEY_ID
value: minioadmin
- name: AWS_SECRET_ACCESS_KEY
value: minioadmin
- name: AWS_SESSION_TOKEN
value: ""
- name: S3_BUCKET
value: "ray-historyserver"
- name: S3_ENDPOINT
value: "minio-service.minio-dev:9000"
- name: S3_REGION
value: "test"
- name: S3FORCE_PATH_STYLE
value: "true"
- name: S3DISABLE_SSL
value: "true"
command:
- collector
- --role=Worker
- --runtime-class-name=s3
- --ray-cluster-name=raycluster-historyserver-kubernetes-auth
- --ray-root-dir=log
- --events-port=8084
resources:
limits:
cpu: "200m"
memory: "256Mi"
requests:
cpu: "50m"
memory: "64Mi"
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
- name: ray-token
mountPath: /var/run/secrets/ray.io/serviceaccount
readOnly: true
volumes:
- name: historyserver
emptyDir: {}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: raycluster-historyserver-kubernetes-auth
---
# The Ray Dashboard runs TokenReview/SubjectAccessReview to validate incoming
# tokens, so the cluster's ServiceAccount needs permission to create them.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ray-authenticator
rules:
- apiGroups: ["authentication.k8s.io"]
resources:
- 'tokenreviews'
verbs: ["create"]
- apiGroups: ["authorization.k8s.io"]
resources:
- 'subjectaccessreviews'
verbs: ["create"]
---
# Grants the caller ray:write on rayclusters, which is what the Dashboard
# authorizes the presented token against.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ray-writer
rules:
- apiGroups: ["ray.io"]
resources:
- 'rayclusters'
verbs: ["ray:write"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ray-authenticator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ray-authenticator
subjects:
- kind: ServiceAccount
name: raycluster-historyserver-kubernetes-auth
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: raycluster-historyserver-kubernetes-auth
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ray-writer
subjects:
- kind: ServiceAccount
name: raycluster-historyserver-kubernetes-auth
namespace: default
14 changes: 14 additions & 0 deletions historyserver/config/raycluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ spec:
value: "s3"
- name: RAY_ROOT_DIR
value: "log"
# Uncomment when the RayCluster sets `spec.authOptions.mode: token`; the collector
# needs the token to call the Dashboard.
# - name: RAY_AUTH_TOKEN
# valueFrom:
# secretKeyRef:
# name: raycluster-historyserver # defaults to the RayCluster name
# key: auth_token
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
Expand Down Expand Up @@ -193,6 +200,13 @@ spec:
value: "s3"
- name: RAY_ROOT_DIR
value: "log"
# Uncomment when the RayCluster sets `spec.authOptions.mode: token`; the collector
# needs the token to call the Dashboard.
# - name: RAY_AUTH_TOKEN
# valueFrom:
# secretKeyRef:
# name: raycluster-historyserver # defaults to the RayCluster name
# key: auth_token
volumeMounts:
- name: historyserver
mountPath: *rayTmpRoot
Expand Down
1 change: 1 addition & 0 deletions historyserver/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Sample configs are in the `config/` directory:
| `azurite.yaml` | Azurite deployment for Azure Blob Storage emulation |
| `raycluster.yaml` | Ray cluster with collector sidecar (S3/MinIO) |
| `raycluster-azureblob.yaml` | Ray cluster with collector sidecar (Azure Blob) |
| `raycluster-kubernetes-auth.yaml` | Ray cluster with collector sidecar using Kubernetes token authentication (S3/MinIO) |
| `rayjob.yaml` | Sample Ray job for testing |
| `historyserver.yaml` | History Server deployment (S3/MinIO) |
| `historyserver-azureblob.yaml` | History Server deployment (Azure Blob) |
Expand Down
Loading
Loading