Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Index ¶
- Constants
- Variables
- func BuildCmdStr(baseCommand string, runParams ...map[string]string) string
- func ConfigAdapterVolume() (corev1.Volume, corev1.VolumeMount)
- func ConfigCMVolume(cmName string) (corev1.Volume, corev1.VolumeMount)
- func ConfigDataVolume(hostPath *string) (corev1.Volume, corev1.VolumeMount)
- func ConfigImagePullSecretVolume(nameSuffix string, imagePullSecrets []string) (corev1.Volume, corev1.VolumeMount)
- func ConfigImagePushSecretVolume(imagePushSecret string) (corev1.Volume, corev1.VolumeMount)
- func ConfigResultsVolume(outputPath string) (corev1.Volume, corev1.VolumeMount)
- func ConfigSHMVolume() (corev1.Volume, corev1.VolumeMount)
- func Contains(s []string, e string) bool
- func ExtractAndValidateRepoName(image string) error
- func FetchGPUCountFromNodes(ctx context.Context, kubeClient client.Client, nodeNames []string) (int, error)
- func GetGPUConfigBySKU(instanceType string) (*sku.GPUConfig, error)
- func GetPerNodeGPUCountFromNodes(nodeList *v1.NodeList) int
- func GetReleaseNamespace() (string, error)
- func GetSKUHandler() (sku.CloudSKUHandler, error)
- func MergeConfigMaps(baseMap, overrideMap map[string]string) map[string]string
- func ParseHuggingFaceModelVersion(version string) (repoId string, revision string, err error)
- func SearchMap(m map[string]interface{}, key string) (value interface{}, exists bool)
- func SearchRawExtension(raw runtime.RawExtension, key string) (interface{}, bool, error)
- func SelectNodes(qualified []*v1.Node, preferred []string, previous []string, count int) []*v1.Node
- func ShellCmd(command string) []string
- func TryGetGPUConfigFromNode(ctx context.Context, kubeClient client.Client, workerNodes []string) (*sku.GPUConfig, error)
Constants ¶
View Source
const ( DefaultVolumeMountPath = "/dev/shm" DefaultConfigMapMountPath = "/mnt/config" DefaultDataVolumePath = "/mnt/data" DefaultAdapterVolumePath = "/mnt/adapter" )
Variables ¶
View Source
var ( KarpenterSchemeBuilder = runtime.NewSchemeBuilder(func(scheme *runtime.Scheme) error { scheme.AddKnownTypes(karpenterSchemeGroupVersion, &karpenterv1.NodePool{}, &karpenterv1.NodePoolList{}, &karpenterv1.NodeClaim{}, &karpenterv1.NodeClaimList{}, ) metav1.AddToGroupVersion(scheme, karpenterSchemeGroupVersion) return nil }) AwsSchemeBuilder = runtime.NewSchemeBuilder(func(scheme *runtime.Scheme) error { scheme.AddKnownTypes(awsSchemeGroupVersion, &awsv1beta1.EC2NodeClass{}, &awsv1beta1.EC2NodeClassList{}, ) metav1.AddToGroupVersion(scheme, awsSchemeGroupVersion) return nil }) )
Functions ¶
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 ConfigImagePullSecretVolume ¶ added in v0.4.5
func ConfigImagePushSecretVolume ¶
func ConfigImagePushSecretVolume(imagePushSecret string) (corev1.Volume, corev1.VolumeMount)
func ConfigResultsVolume ¶
func ConfigResultsVolume(outputPath string) (corev1.Volume, corev1.VolumeMount)
func ConfigSHMVolume ¶
func ConfigSHMVolume() (corev1.Volume, corev1.VolumeMount)
func FetchGPUCountFromNodes ¶
func FetchGPUCountFromNodes(ctx context.Context, kubeClient client.Client, nodeNames []string) (int, error)
FetchGPUCountFromNodes retrieves the GPU count from the given node names.
func GetGPUConfigBySKU ¶ added in v0.4.5
func GetReleaseNamespace ¶
func GetSKUHandler ¶
func GetSKUHandler() (sku.CloudSKUHandler, error)
func MergeConfigMaps ¶
func ParseHuggingFaceModelVersion ¶ added in v0.4.6
ParseHuggingFaceModelVersion parses the model version in the format of https://huggingface.co/<org>/<model>/commit/<revision> and returns the repoId and revision. If the commit is not specified, it returns an empty string for revision, and the main branch HEAD commit is used.
Example 1:
Version: "https://huggingface.co/tiiuae/falcon-7b/commit/ec89142b67d748a1865ea4451372db8313ada0d8" RepoId: "tiiuae/falcon-7b" Revision: "ec89142b67d748a1865ea4451372db8313ada0d8"
Example 2:
Version: https://huggingface.co/tiiuae/falcon-7b RepoId: "tiiuae/falcon-7b" Revision: "" (main branch HEAD commit is used)
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 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.