diff --git a/historyserver/README.md b/historyserver/README.md index 9cdf3a618f4..d5cdb46c45c 100644 --- a/historyserver/README.md +++ b/historyserver/README.md @@ -63,25 +63,25 @@ docker buildx build -t : --platform linux/amd64,linux/arm64 . - The history server can be configured using command-line flags: -- `--runtime-class-name`: Storage backend type (e.g., "s3", "aliyunoss", "localtest") +- `--storage-backend`: Storage backend type (e.g., "s3", "aliyunoss", "localtest") - `--ray-root-dir`: Root directory for Ray logs - `--kubeconfigs`: Path to kubeconfig file(s) for accessing Kubernetes clusters - `--dashboard-dir`: Directory containing dashboard assets (default: "/dashboard") -- `--runtime-class-config-path`: Path to runtime class configuration file +- `--storage-backend-config-path`: Path to storage backend configuration file ### Collector Configuration The collector can be configured using command-line flags: - `--role`: Node role ("Head" or "Worker") -- `--runtime-class-name`: Storage backend type (e.g., "s3", "aliyunoss") +- `--storage-backend`: Storage backend type (e.g., "s3", "aliyunoss") - `--ray-cluster-name`: Name of the Ray cluster - `--ray-cluster-namespace`: Namespace of the Ray cluster - `--ray-root-dir`: Root directory for Ray logs - `--log-batching`: Number of log entries to batch before writing - `--events-port`: Port for the events server - `--push-interval`: Interval between pushes to storage -- `--runtime-class-config-path`: Path to runtime class configuration file +- `--storage-backend-config-path`: Path to storage backend configuration file ## Supported Storage Backends @@ -99,7 +99,7 @@ Each backend requires specific configuration parameters passed through environme ```bash ./output/bin/historyserver \ - --runtime-class-name=s3 \ + --storage-backend=s3 \ --ray-root-dir=/path/to/logs ``` @@ -108,7 +108,7 @@ Each backend requires specific configuration parameters passed through environme ```bash ./output/bin/collector \ --role=Head \ - --runtime-class-name=s3 \ + --storage-backend=s3 \ --ray-cluster-name=my-cluster \ --ray-root-dir=/path/to/logs ``` diff --git a/historyserver/cmd/collector/main.go b/historyserver/cmd/collector/main.go index b2ec4f2de83..b59b3963c32 100644 --- a/historyserver/cmd/collector/main.go +++ b/historyserver/cmd/collector/main.go @@ -25,7 +25,7 @@ import ( func main() { role := "" - runtimeClassName := "" + storageBackend := "" rayClusterName := "" rayClusterNamespace := "" rayRootDir := "" @@ -36,7 +36,7 @@ func main() { ownerName := "" enableEventCollector := true enableLogCollector := true - runtimeClassConfigPath := "" + storageBackendConfigPath := "" // Event collector disk-first storage flags. eventDataDir := "/tmp/ray/event-data" @@ -48,13 +48,13 @@ func main() { flag.BoolVar(&enableEventCollector, "enable-event-collector", true, "Enable event collector") flag.BoolVar(&enableLogCollector, "enable-log-collector", true, "Enable log collector") flag.StringVar(&role, "role", "Worker", "Role of the collector node: Head or Worker") - flag.StringVar(&runtimeClassName, "runtime-class-name", "", "") + flag.StringVar(&storageBackend, "storage-backend", "", "") flag.StringVar(&rayClusterName, "ray-cluster-name", "", "") flag.StringVar(&rayClusterNamespace, "ray-cluster-namespace", "default", "") flag.StringVar(&rayRootDir, "ray-root-dir", "", "") flag.IntVar(&logBatching, "log-batching", 1000, "") flag.IntVar(&eventsPort, "events-port", 8080, "") - flag.StringVar(&runtimeClassConfigPath, "runtime-class-config-path", "", "") + flag.StringVar(&storageBackendConfigPath, "storage-backend-config-path", "", "") flag.DurationVar(&pushInterval, "push-interval", time.Minute, "") flag.StringVar(&ownerKind, "owner-kind", "", "") flag.StringVar(&ownerName, "owner-name", "", "") @@ -110,8 +110,8 @@ func main() { enableLogCollector = enabled } } - if val := os.Getenv("RUNTIME_CLASS_CONFIG_PATH"); val != "" { - runtimeClassConfigPath = val + if val := os.Getenv("STORAGE_BACKEND_CONFIG_PATH"); val != "" { + storageBackendConfigPath = val } role = strings.TrimSpace(role) @@ -183,27 +183,25 @@ func main() { } jsonData := make(map[string]interface{}) - if runtimeClassConfigPath != "" { - data, err := os.ReadFile(runtimeClassConfigPath) + if storageBackendConfigPath != "" { + data, err := os.ReadFile(storageBackendConfigPath) if err != nil { - logrus.Fatalf("Failed to read runtime class config from %s: %v", runtimeClassConfigPath, err) + logrus.Fatalf("Failed to read storage backend config from %s: %v", storageBackendConfigPath, err) } if err := json.Unmarshal(data, &jsonData); err != nil { - logrus.Fatalf("Failed to parse runtime class config from %s: %v", runtimeClassConfigPath, err) + logrus.Fatalf("Failed to parse storage backend config from %s: %v", storageBackendConfigPath, err) } } if val := os.Getenv("STORAGE_BACKEND"); val != "" { - runtimeClassName = val - } else if val := os.Getenv("RUNTIME_CLASS_NAME"); val != "" { - runtimeClassName = val + storageBackend = val } - runtimeClassName = strings.ToLower(runtimeClassName) + storageBackend = strings.ToLower(storageBackend) registry := collector.GetWriterRegistry() - factory, ok := registry[runtimeClassName] + factory, ok := registry[storageBackend] if !ok { - logrus.Fatalf("Not supported runtime class name: %s for role: %s.", runtimeClassName, role) + logrus.Fatalf("Not supported storage backend: %s for role: %s.", storageBackend, role) } rayNodeId, err := utils.GetNodeRayIDWithFQIP() @@ -255,7 +253,7 @@ func main() { writer, err := factory(&globalConfig, jsonData) if err != nil { - logrus.Fatalf("Failed to create writer for runtime class name: %s for role: %s, err: %v", runtimeClassName, role, err) + logrus.Fatalf("Failed to create writer for storage backend: %s for role: %s, err: %v", storageBackend, role, err) } var wg sync.WaitGroup diff --git a/historyserver/cmd/historyserver/main.go b/historyserver/cmd/historyserver/main.go index bb13e119f9e..fba46b45b5d 100644 --- a/historyserver/cmd/historyserver/main.go +++ b/historyserver/cmd/historyserver/main.go @@ -18,10 +18,10 @@ import ( ) func main() { - runtimeClassName := "" + storageBackend := "" rayRootDir := "" kubeconfigs := "" - runtimeClassConfigPath := "" + storageBackendConfigPath := "" dashboardDir := "" useKubernetesProxy := false useAuthTokenMode := false @@ -30,11 +30,11 @@ func main() { sessionProcessTimeout := historyserver.DefaultSessionProcessTimeout sessionCacheSize := historyserver.DefaultSessionCacheSize sessionCacheTTL := historyserver.DefaultSessionCacheTTL - flag.StringVar(&runtimeClassName, "runtime-class-name", "", "Storage backend: s3 / gcs / azureblob / aliyunoss / localtest") + flag.StringVar(&storageBackend, "storage-backend", "", "Storage backend: s3 / gcs / azureblob / aliyunoss / localtest") flag.StringVar(&rayRootDir, "ray-root-dir", "", "Root dir inside the bucket") flag.StringVar(&kubeconfigs, "kubeconfigs", "", "Kubeconfig path; empty = in-cluster") flag.StringVar(&dashboardDir, "dashboard-dir", "/dashboard", "Path to Ray Dashboard static assets") - flag.StringVar(&runtimeClassConfigPath, "runtime-class-config-path", "", "Path to backend config JSON") + flag.StringVar(&storageBackendConfigPath, "storage-backend-config-path", "", "Path to backend config JSON") flag.BoolVar(&useKubernetesProxy, "use-kubernetes-proxy", false, "Use local kubeconfig instead of in-cluster config") flag.BoolVar(&useAuthTokenMode, "use-auth-token-mode", false, "Enable Ray dashboard token authentication mode (requires x-ray-authorization header)") flag.Float64Var(&qps, "kube-api-qps", historyserver.DefaultKubeAPIQPS, "The QPS value for the client communicating with the Kubernetes API server.") @@ -45,14 +45,12 @@ func main() { flag.Parse() if val := os.Getenv("STORAGE_BACKEND"); val != "" { - runtimeClassName = val - } else if val := os.Getenv("RUNTIME_CLASS_NAME"); val != "" { - runtimeClassName = val + storageBackend = val } - if runtimeClassName == "" { - logrus.Fatal("--runtime-class-name, STORAGE_BACKEND, or RUNTIME_CLASS_NAME environment variable is required") + if storageBackend == "" { + logrus.Fatal("--storage-backend or STORAGE_BACKEND environment variable is required") } - runtimeClassName = strings.ToLower(runtimeClassName) + storageBackend = strings.ToLower(storageBackend) if qps <= 0 { logrus.Fatalf("--kube-api-qps must be > 0, got %v", qps) @@ -78,20 +76,20 @@ func main() { } jsonData := make(map[string]interface{}) - if runtimeClassConfigPath != "" { - data, err := os.ReadFile(runtimeClassConfigPath) + if storageBackendConfigPath != "" { + data, err := os.ReadFile(storageBackendConfigPath) if err != nil { - logrus.Fatalf("Failed to read runtime-class-config-path from %s: %v", runtimeClassConfigPath, err) + logrus.Fatalf("Failed to read storage-backend-config-path from %s: %v", storageBackendConfigPath, err) } if err := json.Unmarshal(data, &jsonData); err != nil { - logrus.Fatalf("Failed to parse runtime-class-config-path from %s: %v", runtimeClassConfigPath, err) + logrus.Fatalf("Failed to parse storage-backend-config-path from %s: %v", storageBackendConfigPath, err) } } registry := collector.GetReaderRegistry() - factory, ok := registry[runtimeClassName] + factory, ok := registry[storageBackend] if !ok { - logrus.Fatalf("Unsupported runtime-class-name for reader: %s", runtimeClassName) + logrus.Fatalf("Unsupported storage-backend for reader: %s", storageBackend) } globalConfig := types.RayHistoryServerConfig{ @@ -100,7 +98,7 @@ func main() { reader, err := factory(&globalConfig, jsonData) if err != nil { - logrus.Fatalf("Failed to create reader for runtime class name %s: %v", runtimeClassName, err) + logrus.Fatalf("Failed to create reader for storage backend %s: %v", storageBackend, err) } serverCtx, serverCancel := signal.NotifyContext( diff --git a/historyserver/config/historyserver-azureblob.yaml b/historyserver/config/historyserver-azureblob.yaml index f00b98bbe34..2c1a72d4771 100644 --- a/historyserver/config/historyserver-azureblob.yaml +++ b/historyserver/config/historyserver-azureblob.yaml @@ -42,7 +42,7 @@ spec: imagePullPolicy: IfNotPresent command: - historyserver - - --runtime-class-name=azureblob + - --storage-backend=azureblob - --ray-root-dir=log ports: - containerPort: 8080 diff --git a/historyserver/config/historyserver-gcs.yaml b/historyserver/config/historyserver-gcs.yaml index 104ab5edd66..4a02838dd66 100644 --- a/historyserver/config/historyserver-gcs.yaml +++ b/historyserver/config/historyserver-gcs.yaml @@ -41,7 +41,7 @@ spec: imagePullPolicy: IfNotPresent command: - historyserver - - --runtime-class-name=gcs + - --storage-backend=gcs - --ray-root-dir=log ports: - containerPort: 8080 diff --git a/historyserver/config/historyserver.yaml b/historyserver/config/historyserver.yaml index f07d45d34ee..dca174d8660 100644 --- a/historyserver/config/historyserver.yaml +++ b/historyserver/config/historyserver.yaml @@ -54,7 +54,7 @@ spec: imagePullPolicy: IfNotPresent command: - historyserver - - --runtime-class-name=s3 + - --storage-backend=s3 - --ray-root-dir=log # Enable proxying to live RayClusters with token authentication enabled. # The history server reads the auth Secret and forwards requests with the diff --git a/historyserver/config/raycluster-azureblob.yaml b/historyserver/config/raycluster-azureblob.yaml index 9de3a42e8b7..ead778c0cee 100644 --- a/historyserver/config/raycluster-azureblob.yaml +++ b/historyserver/config/raycluster-azureblob.yaml @@ -65,7 +65,7 @@ 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 - command: [collector, --role=Head, --runtime-class-name=azureblob, --ray-cluster-name=raycluster-historyserver, --ray-root-dir=log, --events-port=8084] + command: [collector, --role=Head, --storage-backend=azureblob, --ray-cluster-name=raycluster-historyserver, --ray-root-dir=log, --events-port=8084] volumeMounts: - name: historyserver mountPath: *rayTmpRoot @@ -136,7 +136,7 @@ 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 - command: [collector, --role=Worker, --runtime-class-name=azureblob, --ray-cluster-name=raycluster-historyserver, --ray-root-dir=log, --events-port=8084] + command: [collector, --role=Worker, --storage-backend=azureblob, --ray-cluster-name=raycluster-historyserver, --ray-root-dir=log, --events-port=8084] volumeMounts: - name: historyserver mountPath: *rayTmpRoot diff --git a/historyserver/config/raycluster-gcs.yaml b/historyserver/config/raycluster-gcs.yaml index 4739b79d509..cba724dd77b 100644 --- a/historyserver/config/raycluster-gcs.yaml +++ b/historyserver/config/raycluster-gcs.yaml @@ -87,7 +87,7 @@ spec: command: - collector - --role=Head - - --runtime-class-name=gcs + - --storage-backend=gcs - --ray-cluster-name=${RAY_CLUSTER} - --ray-root-dir=log - --events-port=8084 @@ -161,7 +161,7 @@ spec: command: - collector - --role=Worker - - --runtime-class-name=gcs + - --storage-backend=gcs - --ray-cluster-name=${RAY_CLUSTER} - --ray-root-dir=log - --events-port=8084 diff --git a/historyserver/config/raycluster.yaml b/historyserver/config/raycluster.yaml index 1acf4b94462..31cf44f798a 100644 --- a/historyserver/config/raycluster.yaml +++ b/historyserver/config/raycluster.yaml @@ -106,7 +106,7 @@ spec: command: - collector - --role=Head - - --runtime-class-name=s3 + - --storage-backend=s3 - --ray-cluster-name=raycluster-historyserver - --ray-root-dir=log - --events-port=8084 @@ -196,7 +196,7 @@ spec: command: - collector - --role=Worker - - --runtime-class-name=s3 + - --storage-backend=s3 - --ray-cluster-name=raycluster-historyserver - --ray-root-dir=log - --events-port=8084 diff --git a/historyserver/docs/README.md b/historyserver/docs/README.md index 1180fa49157..487ee2679d6 100644 --- a/historyserver/docs/README.md +++ b/historyserver/docs/README.md @@ -29,10 +29,10 @@ The History Server supports multiple storage backends: | Backend | Description | Configuration | |---------|-------------|---------------| -| S3/MinIO | AWS S3 or MinIO-compatible storage | Use `--runtime-class-name=s3` | -| Azure Blob Storage | Microsoft Azure Blob Storage | Use `--runtime-class-name=azureblob` | -| Aliyun OSS | Alibaba Cloud Object Storage Service | Use `--runtime-class-name=aliyunoss` | -| Local test | For local testing and development | Use `--runtime-class-name=localtest` | +| S3/MinIO | AWS S3 or MinIO-compatible storage | Use `--storage-backend=s3` | +| Azure Blob Storage | Microsoft Azure Blob Storage | Use `--storage-backend=azureblob` | +| Aliyun OSS | Alibaba Cloud Object Storage Service | Use `--storage-backend=aliyunoss` | +| Local test | For local testing and development | Use `--storage-backend=localtest` | ## Running locally diff --git a/historyserver/docs/set_up_historyserver.md b/historyserver/docs/set_up_historyserver.md index 60663ab7158..6e79ed237ee 100644 --- a/historyserver/docs/set_up_historyserver.md +++ b/historyserver/docs/set_up_historyserver.md @@ -99,7 +99,7 @@ debugging in your own IDE. For example, you can set up `.vscode/launch.json` as "program": "${workspaceFolder}/historyserver/cmd/historyserver/main.go", "cwd": "${workspaceFolder}", "args": [ - "--runtime-class-name=s3", + "--storage-backend=s3", "--ray-root-dir=log" ], "env": { @@ -139,7 +139,7 @@ export S3DISABLE_SSL=true # Run the history server. ./output/bin/historyserver \ - --runtime-class-name=s3 \ + --storage-backend=s3 \ --ray-root-dir=log \ --use-kubernetes-proxy=true ``` diff --git a/historyserver/pkg/storage/aliyunoss/README.md b/historyserver/pkg/storage/aliyunoss/README.md index f6babe26c62..c5f0f6f01d8 100644 --- a/historyserver/pkg/storage/aliyunoss/README.md +++ b/historyserver/pkg/storage/aliyunoss/README.md @@ -14,7 +14,7 @@ Content in `/var/collector-config/data` should be in JSON format, for example: } ``` -Set `--runtime-class-name=aliyunoss` to enable this module. +Set `--storage-backend=aliyunoss` to enable this module. Currently, this module can only be used in an ACK environment. OIDC must be enabled for the cluster, and write permission to OSS must be granted. diff --git a/historyserver/pkg/storage/azureblob/README.md b/historyserver/pkg/storage/azureblob/README.md index 5a254becbcd..9f644ac4187 100644 --- a/historyserver/pkg/storage/azureblob/README.md +++ b/historyserver/pkg/storage/azureblob/README.md @@ -8,7 +8,7 @@ variables or `/var/collector-config/data`. Content in `/var/collector-config/data` should be in JSON format, like `{"azureContainer": "", "azureConnectionString": "", "azureAccountURL": ""}` -Set `--runtime-class-name=azureblob` to enable this module. +Set `--storage-backend=azureblob` to enable this module. ## Authentication diff --git a/historyserver/pkg/storage/gcs/README.md b/historyserver/pkg/storage/gcs/README.md index fee688b4198..cf8b455b0ef 100644 --- a/historyserver/pkg/storage/gcs/README.md +++ b/historyserver/pkg/storage/gcs/README.md @@ -5,7 +5,7 @@ This module is the writer and reader for GCS storage. It is required for the GKE Cluster running Ray to have workload identity (WI), to setup WI, please follow: [How-to: Workload Identity](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) -To use it with the History Server, set `--runtime-class-name=gcs`. +To use it with the History Server, set `--storage-backend=gcs`. ```yaml apiVersion: apps/v1 @@ -26,7 +26,7 @@ spec: imagePullPolicy: Always command: - historyserver - - --runtime-class-name=gcs + - --storage-backend=gcs - --ray-root-dir=log ports: - containerPort: 8080 @@ -47,7 +47,7 @@ RayCluster will also have the following under both the worker and head collector command: - collector - --role=Head - - --runtime-class-name=gcs + - --storage-backend=gcs - --ray-cluster-name=raycluster-historyserver - --ray-root-dir=log - --events-port=8084 diff --git a/historyserver/pkg/storage/s3/README.md b/historyserver/pkg/storage/s3/README.md index b5a548c2a78..79540237624 100644 --- a/historyserver/pkg/storage/s3/README.md +++ b/historyserver/pkg/storage/s3/README.md @@ -7,6 +7,6 @@ S3 endpoint, S3 region and S3 bucket are read from /var/collector-config/data. Content in /var/collector-config/data should be in json format, like `{"s3Bucket": "", "s3Endpoint": "", "s3Region": ""}` -Set `--runtime-class-name=s3` to enable this module. +Set `--storage-backend=s3` to enable this module. This module can be used with any S3 compatible storage service.