Skip to content

Commit

Permalink
fix: reference duplicate func and constant variables
Browse files Browse the repository at this point in the history
  • Loading branch information
CheyuWu committed Jan 13, 2025
1 parent 75e32a1 commit e579e66
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
14 changes: 8 additions & 6 deletions ray-operator/apis/ray/v1/constant.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package v1

// In KubeRay, the Ray container must be the first application container in a head or worker Pod.
const RayContainerIndex = 0
const (
// In KubeRay, the Ray container must be the first application container in a head or worker Pod.
RayContainerIndex = 0

// Use as container env variable
const RAY_REDIS_ADDRESS = "RAY_REDIS_ADDRESS"
// Use as container env variable
RAY_REDIS_ADDRESS = "RAY_REDIS_ADDRESS"

// Ray GCS FT related annotations
const RayFTEnabledAnnotationKey = "ray.io/ft-enabled"
// Ray GCS FT related annotations
RayFTEnabledAnnotationKey = "ray.io/ft-enabled"
)
12 changes: 8 additions & 4 deletions ray-operator/controllers/ray/utils/constant.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package utils

import "errors"
import (
"errors"

rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
)

const (

Expand Down Expand Up @@ -28,7 +32,7 @@ const (
KubeRayVersion = "ray.io/kuberay-version"

// In KubeRay, the Ray container must be the first application container in a head or worker Pod.
RayContainerIndex = 0
RayContainerIndex = rayv1.RayContainerIndex

// Batch scheduling labels
// TODO(tgaddair): consider making these part of the CRD
Expand All @@ -37,7 +41,7 @@ const (
RayClusterGangSchedulingEnabled = "ray.io/gang-scheduling-enabled"

// Ray GCS FT related annotations
RayFTEnabledAnnotationKey = "ray.io/ft-enabled"
RayFTEnabledAnnotationKey = rayv1.RayFTEnabledAnnotationKey
RayExternalStorageNSAnnotationKey = "ray.io/external-storage-namespace"

// If this annotation is set to "true", the KubeRay operator will not modify the container's command.
Expand Down Expand Up @@ -98,7 +102,7 @@ const (
FQ_RAY_IP = "FQ_RAY_IP"
RAY_PORT = "RAY_PORT"
RAY_ADDRESS = "RAY_ADDRESS"
RAY_REDIS_ADDRESS = "RAY_REDIS_ADDRESS"
RAY_REDIS_ADDRESS = rayv1.RAY_REDIS_ADDRESS
REDIS_PASSWORD = "REDIS_PASSWORD"
RAY_DASHBOARD_ENABLE_K8S_DISK_USAGE = "RAY_DASHBOARD_ENABLE_K8S_DISK_USAGE"
RAY_EXTERNAL_STORAGE_NS = "RAY_external_storage_namespace"
Expand Down
9 changes: 1 addition & 8 deletions ray-operator/controllers/ray/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,7 @@ func IsJobFinished(j *batchv1.Job) (batchv1.JobConditionType, bool) {
return "", false
}

func EnvVarExists(envName string, envVars []corev1.EnvVar) bool {
for _, env := range envVars {
if env.Name == envName {
return true
}
}
return false
}
var EnvVarExists func(envName string, envVars []corev1.EnvVar) bool = rayv1.EnvVarExists

func UpsertEnvVar(envVars []corev1.EnvVar, newEnvVar corev1.EnvVar) []corev1.EnvVar {
overridden := false
Expand Down

0 comments on commit e579e66

Please sign in to comment.