Skip to content

Commit

Permalink
Organize imports and rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
mounchin committed Oct 3, 2024
1 parent 64c07f2 commit 2f3bfc9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ray-operator/controllers/ray/common/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/go-logr/logr"
"os"
"strconv"
"strings"

"github.com/go-logr/logr"

"github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"

"k8s.io/apimachinery/pkg/api/resource"
Expand Down Expand Up @@ -759,7 +760,7 @@ func generateRayStartCommand(ctx context.Context, nodeType rayv1.RayNodeType, ra
}

// Add GPU and custom accelerator resources to rayStartParams if not already present.
addGPUAndCustomAcceleratorResourcesIfNotExists(log, rayStartParams, resource.Limits)
addWellKnownAcceleratorResources(log, rayStartParams, resource.Limits)

rayStartCmd := ""
switch nodeType {
Expand All @@ -774,7 +775,7 @@ func generateRayStartCommand(ctx context.Context, nodeType rayv1.RayNodeType, ra
return rayStartCmd
}

func addGPUAndCustomAcceleratorResourcesIfNotExists(log logr.Logger, rayStartParams map[string]string, resourceLimits corev1.ResourceList) {
func addWellKnownAcceleratorResources(log logr.Logger, rayStartParams map[string]string, resourceLimits corev1.ResourceList) {
resourcesMap, _ := getResourcesMap(rayStartParams)

// Flag to track if any custom accelerator resource are present/added in rayStartParams resources.
Expand Down

0 comments on commit 2f3bfc9

Please sign in to comment.