utils

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Index

Constants

View Source
const (
	DefaultVolumeMountPath    = "/dev/shm"
	DefaultConfigMapMountPath = "/mnt/config"
	DefaultDataVolumePath     = "/mnt/data"
	DefaultAdapterVolumePath  = "/mnt/adapter"
)

Variables

This section is empty.

Functions

func BuildCmdStr

func BuildCmdStr(baseCommand string, runParams ...map[string]string) string

func ConfigAdapterVolume

func ConfigAdapterVolume() (corev1.Volume, corev1.VolumeMount)

func ConfigCMVolume

func ConfigCMVolume(cmName string) (corev1.Volume, corev1.VolumeMount)

func ConfigDataVolume

func ConfigDataVolume(hostPath *string) (corev1.Volume, corev1.VolumeMount)

func ConfigImagePushSecretVolume

func ConfigImagePushSecretVolume(imagePushSecret string) (corev1.Volume, corev1.VolumeMount)

func ConfigResultsVolume

func ConfigResultsVolume(outputPath string) (corev1.Volume, corev1.VolumeMount)

func ConfigSHMVolume

func ConfigSHMVolume(instanceCount int) (corev1.Volume, corev1.VolumeMount)

func Contains

func Contains(s []string, e string) bool

func ExtractAndValidateRepoName

func ExtractAndValidateRepoName(image string) error

func FetchGPUCountFromNodes

func FetchGPUCountFromNodes(ctx context.Context, kubeClient client.Client, nodeNames []string) (string, error)

FetchGPUCountFromNodes retrieves the GPU count from the given node names.

func GetPerNodeGPUCountFromNodes

func GetPerNodeGPUCountFromNodes(nodeList *v1.NodeList) string

func GetReleaseNamespace

func GetReleaseNamespace() (string, error)

func GetSKUHandler

func GetSKUHandler() (sku.CloudSKUHandler, error)

func GetSKUNumGPUs

func GetSKUNumGPUs(ctx context.Context, kubeClient client.Client, workerNodes []string, instanceType, defaultGPUCount string) (string, error)

func MergeConfigMaps

func MergeConfigMaps(baseMap, overrideMap map[string]string) map[string]string

func SearchMap

func SearchMap(m map[string]interface{}, key string) (value interface{}, exists bool)

SearchMap performs a search for a key in a map[string]interface{}.

func SearchRawExtension

func SearchRawExtension(raw runtime.RawExtension, key string) (interface{}, bool, error)

SearchRawExtension performs a search for a key within a runtime.RawExtension.

func SelectNodes

func SelectNodes(qualified []*v1.Node, preferred []string, previous []string, count int) []*v1.Node

func ShellCmd

func ShellCmd(command string) []string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL