Add Ray cluster log persistence (proto + collector sidecar + log_url)#1124
Open
Add Ray cluster log persistence (proto + collector sidecar + log_url)#1124
Conversation
|
|
🔍 Go Lint & TODO Tracking Results
|
badcount
reviewed
Apr 29, 2026
| }, | ||
| { | ||
| Name: "RAY_DASHBOARD_AGGREGATOR_AGENT_EVENTS_EXPORT_ADDR", | ||
| Value: fmt.Sprintf("http://localhost:%d/events", collectorPort), |
Contributor
There was a problem hiding this comment.
Can we put the localhost into a configurable prefix?
Contributor
Author
There was a problem hiding this comment.
I think we don't need to make it configurable, this is inside the sidecar and the Ray container and the collector share the network, so localhost is the only correct address. I can extract the string into a constant though.
badcount
approved these changes
Apr 29, 2026
b616436 to
292d38b
Compare
🔍 Go Lint & TODO Tracking Results
|
Go Coverage Report (Bazel)Total Coverage: 63.1% Coverage Policy:
|
292d38b to
4cdc4c2
Compare
🔍 Go Lint & TODO Tracking Results
|
Proto:
- Add LogPersistenceSpec message and log_url to RayClusterStatus
(proto/api/v2/ray_cluster.proto)
Mapper (go/components/jobs/client/k8sengine):
- Load LogPersistenceConfig from controllers.rayCluster.logPersistence
via FX
- injectCollectorSidecar(): inject the KubeRay History Server collector
into Ray pod templates with env-var S3 config (no ConfigMap), reuse an
existing /tmp/ray volume when present, set ImagePullPolicy: IfNotPresent,
add the postStart raylet-node-id hook
- Wire sidecar injection into mapRayCluster() when logPersistence.enabled
- buildLogURL() and MapLocalClusterStatusToGlobal(): compute the
human-browsable log URL during local→global status translation
(mapper owns the formula since it knows config + local cluster name +
compute-cluster Ray namespace = RayLocalNamespace)
Format: {LogUrlBaseUrl}/{Bucket}/{PathPrefix}/{cluster}_{rayLocalNamespace}/
Controller (go/components/ray/cluster):
- applyRayClusterStatus(): copy clusterStatus.Ray.LogUrl onto
rayCluster.Status.LogUrl so callers see the value the mapper computed
- Controller intentionally does NOT own the log_url formula or any
LogPersistenceConfig — single source of truth lives in the mapper
Defaults (go/cmd/controllermgr/config/base.yaml):
- controllers.rayCluster.logPersistence:
enabled: true
storageEndpoint: "k3d-michelangelo-sandbox-agent-0:30007"
bucket: ray-history
pathPrefix: log
region: us-east-1
credentialsSecret: minio-credentials
collectorImage: kuberay-collector:v0.1.0
logUrlBaseUrl: "http://localhost:9090/browser"
- Sandbox MinIO defaults; production overlays flip these.
Tests cover: mapper sidecar injection (env vars, lifecycle preservation,
config knobs), controller log_url pass-through.
4cdc4c2 to
6f3c998
Compare
🔍 Go Lint & TODO Tracking Results
|
5 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What type of PR is this? (check all applicable)
What changed?
Wires the KubeRay History Server log-collection path end-to-end on the
controllermgr side. KubeRay History Server reference:
https://github.com/ray-project/kuberay/tree/master/historyserver
log_urltoRayClusterStatusso callers can navigateto persisted logs after a cluster is gone.
go/components/jobs/client/k8sengine):LogPersistenceConfigvia FX fromjobs.k8sengine.mapper.logPersistence.injectCollectorSidecar()— inject the KubeRay collector sidecar intohead + worker pod templates (env-var S3 config, no ConfigMap),
reuse an existing
/tmp/rayvolume when present, setImagePullPolicy: IfNotPresent, add the postStart raylet-node-id hook.mapRayCluster()whenenabled: true.log_urlinMapLocalClusterStatusToGlobal()— the mapperis the single source of truth (it has the config, the local cluster
name, and knows the compute-cluster Ray namespace).
Format:
{LogUrlBaseUrl}/{Bucket}/{PathPrefix}/{cluster}_{rayLocalNamespace}/go/components/ray/cluster):applyRayClusterStatus()copies
clusterStatus.Ray.LogUrlthrough toRayCluster.Status.LogUrl.Controller intentionally owns no log-persistence config or formula.
go/cmd/controllermgr/config/base.yaml): sandbox MinIOdefaults under
jobs.k8sengine.mapper.logPersistence. Productionoverlays flip these.
Why?
The collector sidecar streams Ray cluster logs into MinIO/S3 so the
KubeRay History Server can replay the Ray Dashboard for clusters that
are already torn down.
log_urllets uniflow / Pipeline CR expose adirect browse link.
How did you test it?
Local testing in the OSS k3d sandbox (next PR in the stack brings up
History Server + MinIO + sandbox wiring). Unit tests cover sidecar
injection (env vars, lifecycle preservation, config knobs) and the
controller
log_urlpass-through.Potential risks
kuberay-collectorimage to be published to GHCR beforerollout beyond the sandbox.
enabled: falsein config is the safe rollback — no sidecar getsinjected and no
log_urlis written.Documentation Changes
Follow-up PR: expose
log_urlthrough uniflow onto the Pipeline CR.