Skip to content

Commit

Permalink
chore(ray): fix metadata model name (#632)
Browse files Browse the repository at this point in the history
Because

- `Sync` does not provide model name to deploy

This commit

- check action before extracting metadata value
  • Loading branch information
heiruwu authored Jul 11, 2024
1 parent 4a2fc8a commit 637a621
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions pkg/ray/ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,22 +258,28 @@ func (r *ray) UpdateContainerizedModel(ctx context.Context, modelName string, us

logger, _ := custom_logger.GetZapLogger(ctx)

applicationMetadatValue, err := GetApplicationMetadaValue(modelName, version)
if err != nil {
logger.Error(err.Error())
return err
}
var err error
applicationMetadatValue := ""
runOptions := []string{}

runOptions := []string{
"--tls-verify=false",
"--pull=always",
"--rm",
"-v /home/ray/ray_pb2.py:/home/ray/ray_pb2.py",
"-v /home/ray/ray_pb2.pyi:/home/ray/ray_pb2.pyi",
"-v /home/ray/ray_pb2_grpc.py:/home/ray/ray_pb2_grpc.py",
if action != Sync {
applicationMetadatValue, err = GetApplicationMetadaValue(modelName, version)
if err != nil {
logger.Error(err.Error())
return err
}
}

if action == Deploy {
runOptions = []string{
"--tls-verify=false",
"--pull=always",
"--rm",
"-v /home/ray/ray_pb2.py:/home/ray/ray_pb2.py",
"-v /home/ray/ray_pb2.pyi:/home/ray/ray_pb2.pyi",
"-v /home/ray/ray_pb2_grpc.py:/home/ray/ray_pb2_grpc.py",
}

accelerator, ok := SupportedAcceleratorType[hardware]
if !ok {
logger.Warn("accelerator type(hardware) not supported, setting it as custom resource")
Expand Down

0 comments on commit 637a621

Please sign in to comment.