utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckGPUVisible

func CheckGPUVisible(ctx context.Context, client client.Client, clientset *kubernetes.Clientset, restConfig *rest.Config, deviceResourceType string, resource *crov1alpha1.ComposableResource) (bool, error)

func CheckNoGPULoads

func CheckNoGPULoads(ctx context.Context, client client.Client, clientset *kubernetes.Clientset, restConfig *rest.Config, targetNodeName string, targetGPUUUID *string) error

func CheckNodeCapacitySufficient

func CheckNodeCapacitySufficient(ctx context.Context, client client.Client, nodeName string, nodeSpec *v1alpha1.NodeSpec) (bool, error)

func CheckNodeExisted

func CheckNodeExisted(ctx context.Context, client client.Client, nodeName string) error

func ContainsString

func ContainsString(slice []string, s string) bool

func CreateDeviceTaint

func CreateDeviceTaint(ctx context.Context, client client.Client, resource *crov1alpha1.ComposableResource) error

func DrainGPU

func DrainGPU(ctx context.Context, client client.Client, clientset *kubernetes.Clientset, restConfig *rest.Config, targetNodeName string, targetGPUUUID string, deviceResourceType string) error

func GenerateComposableResourceName

func GenerateComposableResourceName(typeName string) string

func GetAllNodes

func GetAllNodes(ctx context.Context, client client.Client) (*corev1.NodeList, error)

func RestartDaemonset

func RestartDaemonset(ctx context.Context, client client.Client, namespace string, name string) error

func RunNvidiaSmi

func RunNvidiaSmi(ctx context.Context, client client.Client, clientset *kubernetes.Clientset, restConfig *rest.Config, targetNodeName string) error

func SetNodeSchedulable

func SetNodeSchedulable(ctx context.Context, client client.Client, request *v1alpha1.ComposableResource) (bool, error)

Types

type AccountedAppInfo

type AccountedAppInfo struct {
	GPUUUID     string
	ProcessName string
}

func (AccountedAppInfo) String

func (a AccountedAppInfo) String() string

Jump to

Keyboard shortcuts

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