File tree Expand file tree Collapse file tree 3 files changed +17
-18
lines changed
Expand file tree Collapse file tree 3 files changed +17
-18
lines changed Original file line number Diff line number Diff line change 11package v1
22
3- // In KubeRay, the Ray container must be the first application container in a head or worker Pod.
4- const RayContainerIndex = 0
3+ const (
4+ // In KubeRay, the Ray container must be the first application container in a head or worker Pod.
5+ RayContainerIndex = 0
56
6- // Use as container env variable
7- const RAY_REDIS_ADDRESS = "RAY_REDIS_ADDRESS"
7+ // Use as container env variable
8+ RAY_REDIS_ADDRESS = "RAY_REDIS_ADDRESS"
89
9- // Ray GCS FT related annotations
10- const RayFTEnabledAnnotationKey = "ray.io/ft-enabled"
10+ // Ray GCS FT related annotations
11+ RayFTEnabledAnnotationKey = "ray.io/ft-enabled"
12+ )
Original file line number Diff line number Diff line change 11package utils
22
3- import "errors"
3+ import (
4+ "errors"
5+
6+ rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
7+ )
48
59const (
610
@@ -28,7 +32,7 @@ const (
2832 KubeRayVersion = "ray.io/kuberay-version"
2933
3034 // In KubeRay, the Ray container must be the first application container in a head or worker Pod.
31- RayContainerIndex = 0
35+ RayContainerIndex = rayv1 . RayContainerIndex
3236
3337 // Batch scheduling labels
3438 // TODO(tgaddair): consider making these part of the CRD
@@ -37,7 +41,7 @@ const (
3741 RayClusterGangSchedulingEnabled = "ray.io/gang-scheduling-enabled"
3842
3943 // Ray GCS FT related annotations
40- RayFTEnabledAnnotationKey = "ray.io/ft-enabled"
44+ RayFTEnabledAnnotationKey = rayv1 . RayFTEnabledAnnotationKey
4145 RayExternalStorageNSAnnotationKey = "ray.io/external-storage-namespace"
4246
4347 // If this annotation is set to "true", the KubeRay operator will not modify the container's command.
@@ -98,7 +102,7 @@ const (
98102 FQ_RAY_IP = "FQ_RAY_IP"
99103 RAY_PORT = "RAY_PORT"
100104 RAY_ADDRESS = "RAY_ADDRESS"
101- RAY_REDIS_ADDRESS = " RAY_REDIS_ADDRESS"
105+ RAY_REDIS_ADDRESS = rayv1 . RAY_REDIS_ADDRESS
102106 REDIS_PASSWORD = "REDIS_PASSWORD"
103107 RAY_DASHBOARD_ENABLE_K8S_DISK_USAGE = "RAY_DASHBOARD_ENABLE_K8S_DISK_USAGE"
104108 RAY_EXTERNAL_STORAGE_NS = "RAY_external_storage_namespace"
Original file line number Diff line number Diff line change @@ -577,14 +577,7 @@ func IsJobFinished(j *batchv1.Job) (batchv1.JobConditionType, bool) {
577577 return "" , false
578578}
579579
580- func EnvVarExists (envName string , envVars []corev1.EnvVar ) bool {
581- for _ , env := range envVars {
582- if env .Name == envName {
583- return true
584- }
585- }
586- return false
587- }
580+ var EnvVarExists func (envName string , envVars []corev1.EnvVar ) bool = rayv1 .EnvVarExists
588581
589582func UpsertEnvVar (envVars []corev1.EnvVar , newEnvVar corev1.EnvVar ) []corev1.EnvVar {
590583 overridden := false
You can’t perform that action at this time.
0 commit comments