utils

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 13 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 added in v0.3.0

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

func ConfigAdapterVolume added in v0.3.0

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

func ConfigCMVolume added in v0.3.0

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

func ConfigDataVolume added in v0.3.0

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

func ConfigImagePushSecretVolume added in v0.3.0

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

func ConfigResultsVolume added in v0.3.0

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

func ConfigSHMVolume added in v0.3.0

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

func Contains

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

func ExtractAndValidateRepoName added in v0.3.1

func ExtractAndValidateRepoName(image string) error

func FetchGPUCountFromNodes added in v0.3.1

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

FetchGPUCountFromNodes retrieves the GPU count from the given node names.

func GetPerNodeGPUCountFromNodes added in v0.3.1

func GetPerNodeGPUCountFromNodes(nodeList *v1.NodeList) string

func GetReleaseNamespace added in v0.3.0

func GetReleaseNamespace() (string, error)

func GetSKUHandler added in v0.3.1

func GetSKUHandler() (sku.CloudSKUHandler, error)

func GetSKUNumGPUs added in v0.3.1

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

func MergeConfigMaps added in v0.3.0

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

func SearchMap added in v0.3.0

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 added in v0.3.0

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

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

func ShellCmd added in v0.3.0

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