Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ray): utilize redis as deployment config cache #722

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions cmd/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ func main() {
publicGrpcS := grpc.NewServer(grpcServerOpts...)
reflection.Register(publicGrpcS)

rayService := ray.NewRay()
defer rayService.Close()

mgmtPublicServiceClient, mgmtPublicServiceClientConn := external.InitMgmtPublicServiceClient(ctx)
defer mgmtPublicServiceClientConn.Close()

Expand All @@ -175,6 +172,9 @@ func main() {
redisClient := redis.NewClient(&config.Config.Cache.Redis.RedisOptions)
defer redisClient.Close()

rayService := ray.NewRay(redisClient)
defer rayService.Close()

temporalTracingInterceptor, err := opentelemetry.NewTracingInterceptor(opentelemetry.TracerOptions{
Tracer: otel.Tracer("temporal-tracer"),
TextMapPropagator: propagator,
Expand Down
6 changes: 3 additions & 3 deletions cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ func main() {
db := database.GetSharedConnection()
defer database.Close(db)

rayService := ray.NewRay()
defer rayService.Close()

redisClient := redis.NewClient(&config.Config.Cache.Redis.RedisOptions)
defer redisClient.Close()

rayService := ray.NewRay(redisClient)
defer rayService.Close()

temporalTracingInterceptor, err := opentelemetry.NewTracingInterceptor(opentelemetry.TracerOptions{
Tracer: otel.Tracer("temporal-tracer"),
TextMapPropagator: b3.New(b3.WithInjectEncoding(b3.B3MultipleHeader)),
Expand Down
119 changes: 107 additions & 12 deletions pkg/mock/ray_mock.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions pkg/ray/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ var SupportedAcceleratorTypeMemory = map[string]int{
}

const (
// Ray redis key
RayDeploymentKey = "model_deployment_config"

// Ray deployment env variables
EnvIsTestModel = "RAY_IS_TEST_MODEL"
EnvMemory = "RAY_MEMORY"
EnvTotalVRAM = "RAY_TOTAL_VRAM"
Expand All @@ -291,8 +295,5 @@ const (
EnvNumOfCPUs = "RAY_NUM_OF_CPUS"
EnvNumOfMinReplicas = "RAY_NUM_OF_MIN_REPLICAS"
EnvNumOfMaxReplicas = "RAY_NUM_OF_MAX_REPLICAS"
)

const (
DummyModelPrefix = "dummy-"
DummyModelPrefix = "dummy-"
)
Loading
Loading