utils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 23 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, c 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, c client.Client, resource *crov1alpha1.ComposableResource) error

func DeleteDeviceTaint added in v0.1.1

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

func DrainGPU

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

func EnsureGPUDriverExists added in v0.2.0

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

func GenerateComposableResourceName

func GenerateComposableResourceName(typeName string) string

func GetAllNodes

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

func HasDeviceTaint added in v0.1.1

func HasDeviceTaint(ctx context.Context, c client.Client, resource *crov1alpha1.ComposableResource) (bool, error)

func RestartDaemonset

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

func RunNvidiaSmi

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

func TerminateKubeletPluginPodOnNode added in v0.2.0

func TerminateKubeletPluginPodOnNode(ctx context.Context, clientset *kubernetes.Clientset, targetNodeName string) error

Types

type AccountedAppInfo

type AccountedAppInfo struct {
	GPUUUID     string
	ProcessName string
}

func (AccountedAppInfo) String

func (a AccountedAppInfo) String() string

type GPUDriverType added in v0.2.0

type GPUDriverType string
const (
	GPUDriverTypeNone      GPUDriverType = "none"
	GPUDriverTypeHost      GPUDriverType = "host"
	GPUDriverTypeContainer GPUDriverType = "container"
)

Jump to

Keyboard shortcuts

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