Documentation
¶
Index ¶
- Variables
- func CalculateNumberOfReplicas(ctx context.Context, k8sClient client.Client, gpuVendor string, ...) (int, int, int, error)
- func CompareClusterQueues(a, b kueuev1beta1.ClusterQueue) bool
- func ComparePriorityClasses(a, b kueuev1beta1.WorkloadPriorityClass) bool
- func CompareResourceFlavors(a, b kueuev1beta1.ResourceFlavor) bool
- func ConvertKaiwoToKueueClusterQueue(kaiwoQueue kaiwo.ClusterQueue) kueuev1beta1.ClusterQueue
- func ConvertKaiwoToKueueResourceFlavor(kaiwoFlavor kaiwo.ResourceFlavorSpec) kueuev1beta1.ResourceFlavor
- func ConvertKaiwoToKueueResourceFlavors(kaiwoFlavors []kaiwo.ResourceFlavorSpec) []kueuev1beta1.ResourceFlavor
- func CreateClusterQueue(nodePoolResources map[string]kueuev1beta1.FlavorQuotas, name string) kaiwo.ClusterQueue
- func CreateDefaultResourceFlavors(ctx context.Context, c client.Client) ([]kaiwo.ResourceFlavorSpec, map[string]kueuev1beta1.FlavorQuotas, error)
- func CreateLocalQueue(ctx context.Context, c client.Client, name string, namespace string) error
- func EnsureConfig(ctx context.Context, k8sClient client.Client) error
- func EnsureNamespaceKueueManaged(ctx context.Context, k8sClient client.Client, namespaceName string) error
- func FindFlavor(flavors []kueuev1beta1.ResourceFlavor, name string) (kueuev1beta1.ResourceFlavor, bool)
- func GetContextWithConfig(ctx context.Context, k8sClient client.Client) (context.Context, error)
- func LabelNode(ctx context.Context, c client.Client, nodeName, key, value string) error
- func MapGPUDeviceIDToName(gpuID string, vendor string) string
- func RemoveDuplicateResourceFlavors(flavors []kaiwo.ResourceFlavorSpec) []kaiwo.ResourceFlavorSpec
- func TaintNode(ctx context.Context, client client.Client, nodeName string, taint corev1.Taint) error
- type KaiwoConfigContext
- type NodeResourceInfo
Constants ¶
This section is empty.
Variables ¶
var DefaultNodePoolLabel = "kaiwo/nodepool"
Functions ¶
func CalculateNumberOfReplicas ¶
func CalculateNumberOfReplicas(ctx context.Context, k8sClient client.Client, gpuVendor string, totalUserRequestedGpus int, userReplicas int, userGpusPerReplica int, useAvailability bool) (int, int, int, error)
CalculateNumberOfReplicas determines the number of replicas and GPUs per replica based on node labels and optionally available GPU capacity.
func CompareClusterQueues ¶
func CompareClusterQueues(a, b kueuev1beta1.ClusterQueue) bool
func ComparePriorityClasses ¶
func ComparePriorityClasses(a, b kueuev1beta1.WorkloadPriorityClass) bool
func CompareResourceFlavors ¶
func CompareResourceFlavors(a, b kueuev1beta1.ResourceFlavor) bool
func ConvertKaiwoToKueueClusterQueue ¶
func ConvertKaiwoToKueueClusterQueue(kaiwoQueue kaiwo.ClusterQueue) kueuev1beta1.ClusterQueue
func ConvertKaiwoToKueueResourceFlavor ¶
func ConvertKaiwoToKueueResourceFlavor(kaiwoFlavor kaiwo.ResourceFlavorSpec) kueuev1beta1.ResourceFlavor
func ConvertKaiwoToKueueResourceFlavors ¶
func ConvertKaiwoToKueueResourceFlavors(kaiwoFlavors []kaiwo.ResourceFlavorSpec) []kueuev1beta1.ResourceFlavor
func CreateClusterQueue ¶
func CreateClusterQueue(nodePoolResources map[string]kueuev1beta1.FlavorQuotas, name string) kaiwo.ClusterQueue
func CreateDefaultResourceFlavors ¶
func CreateDefaultResourceFlavors(ctx context.Context, c client.Client) ([]kaiwo.ResourceFlavorSpec, map[string]kueuev1beta1.FlavorQuotas, error)
func CreateLocalQueue ¶
CreateLocalQueue creates a LocalQueue in the given namespace.
func EnsureConfig ¶ added in v0.1.4
EnsureConfig ensures that a Kaiwo configuration exists within the cluster. It provides a way to either create one automatically, or to give some time for another system to create one while the controller is starting.
func FindFlavor ¶
func FindFlavor(flavors []kueuev1beta1.ResourceFlavor, name string) (kueuev1beta1.ResourceFlavor, bool)
func GetContextWithConfig ¶ added in v0.1.4
GetContextWithConfig fetches the latest config and attaches it to a given context
func MapGPUDeviceIDToName ¶
func RemoveDuplicateResourceFlavors ¶
func RemoveDuplicateResourceFlavors(flavors []kaiwo.ResourceFlavorSpec) []kaiwo.ResourceFlavorSpec
Types ¶
type KaiwoConfigContext ¶ added in v0.1.4
type KaiwoConfigContext struct {
configapi.KaiwoConfigSpec
}
KaiwoConfigContext holds the config that is relevant for a particular context In the future it can be extended with namespace-specific configuration as well
func ConfigFromContext ¶ added in v0.1.4
func ConfigFromContext(ctx context.Context) KaiwoConfigContext
ConfigFromContext extracts the cfg (or panics if missing).
type NodeResourceInfo ¶
type NodeResourceInfo struct {
Name string
CPU int
Memory int
Labels map[string]string
Unschedulable bool
}
func GetNodeResources ¶
func GetNodeResources(ctx context.Context, c client.Client) []NodeResourceInfo