Documentation
¶
Index ¶
- type GPUValidator
- func (gv *GPUValidator) GetGPUCountInPod(ctx context.Context, namespace, podName string) (int, error)
- func (gv *GPUValidator) GetGPUNodes(ctx context.Context) ([]corev1.Node, error)
- func (gv *GPUValidator) GetTotalGPUCount(ctx context.Context) (int, error)
- func (gv *GPUValidator) ValidateCDISpec(ctx context.Context, podName, namespace string) error
- func (gv *GPUValidator) ValidateDeviceAllocation(ctx context.Context, namespace, claimName string) error
- func (gv *GPUValidator) ValidateGPUInPod(ctx context.Context, namespace, podName string, expectedGPUCount int) error
- func (gv *GPUValidator) ValidateResourceSlice(ctx context.Context, nodeName string) (*resourceapi.ResourceSlice, error)
- type PrerequisitesInstaller
- func (pi *PrerequisitesInstaller) InstallAll(ctx context.Context) error
- func (pi *PrerequisitesInstaller) InstallDRADriver(ctx context.Context) error
- func (pi *PrerequisitesInstaller) IsDRADriverInstalled(ctx context.Context) bool
- func (pi *PrerequisitesInstaller) IsGPUOperatorInstalled(ctx context.Context) bool
- func (pi *PrerequisitesInstaller) RollbackDRAMutations(ctx context.Context)
- func (pi *PrerequisitesInstaller) UninstallAll(ctx context.Context) error
- func (pi *PrerequisitesInstaller) UninstallDRADriver(ctx context.Context) error
- func (pi *PrerequisitesInstaller) WaitForDRADriver(ctx context.Context, timeout time.Duration) error
- func (pi *PrerequisitesInstaller) WaitForGPUOperator(ctx context.Context, timeout time.Duration) error
- type ResourceBuilder
- func (rb *ResourceBuilder) BuildDeviceClass(name string) *resourceapi.DeviceClass
- func (rb *ResourceBuilder) BuildLongRunningPodWithClaim(name, claimName, image string) *corev1.Pod
- func (rb *ResourceBuilder) BuildPodWithClaim(name, claimName, image string) *corev1.Pod
- func (rb *ResourceBuilder) BuildPodWithInlineClaim(name, deviceClassName string) *corev1.Pod
- func (rb *ResourceBuilder) BuildResourceClaim(name, deviceClassName string, count int) *resourceapi.ResourceClaim
- func (rb *ResourceBuilder) BuildResourceClaimTemplate(name, deviceClassName string, count int) *resourceapi.ResourceClaimTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GPUValidator ¶
type GPUValidator struct {
// contains filtered or unexported fields
}
GPUValidator validates GPU allocation and accessibility
func NewGPUValidator ¶
func NewGPUValidator(f *framework.Framework) *GPUValidator
NewGPUValidator creates a new validator instance
func (*GPUValidator) GetGPUCountInPod ¶
func (gv *GPUValidator) GetGPUCountInPod(ctx context.Context, namespace, podName string) (int, error)
GetGPUCountInPod returns the number of GPUs visible in a pod
func (*GPUValidator) GetGPUNodes ¶
GetGPUNodes returns nodes with NVIDIA GPUs
func (*GPUValidator) GetTotalGPUCount ¶
func (gv *GPUValidator) GetTotalGPUCount(ctx context.Context) (int, error)
GetTotalGPUCount returns the total number of GPUs available in the cluster by counting devices in ResourceSlices
func (*GPUValidator) ValidateCDISpec ¶
func (gv *GPUValidator) ValidateCDISpec(ctx context.Context, podName, namespace string) error
ValidateCDISpec validates CDI specification was created
func (*GPUValidator) ValidateDeviceAllocation ¶
func (gv *GPUValidator) ValidateDeviceAllocation(ctx context.Context, namespace, claimName string) error
ValidateDeviceAllocation validates that claim is properly allocated
func (*GPUValidator) ValidateGPUInPod ¶
func (gv *GPUValidator) ValidateGPUInPod(ctx context.Context, namespace, podName string, expectedGPUCount int) error
ValidateGPUInPod validates that GPU is accessible in the pod
func (*GPUValidator) ValidateResourceSlice ¶
func (gv *GPUValidator) ValidateResourceSlice(ctx context.Context, nodeName string) (*resourceapi.ResourceSlice, error)
ValidateResourceSlice validates ResourceSlice for GPU node
type PrerequisitesInstaller ¶
type PrerequisitesInstaller struct {
// contains filtered or unexported fields
}
PrerequisitesInstaller validates GPU Operator and manages DRA driver installation
func NewPrerequisitesInstaller ¶
func NewPrerequisitesInstaller(f *framework.Framework) *PrerequisitesInstaller
NewPrerequisitesInstaller creates a new installer
func (*PrerequisitesInstaller) InstallAll ¶
func (pi *PrerequisitesInstaller) InstallAll(ctx context.Context) error
InstallAll validates GPU Operator is present and installs DRA Driver
func (*PrerequisitesInstaller) InstallDRADriver ¶
func (pi *PrerequisitesInstaller) InstallDRADriver(ctx context.Context) error
InstallDRADriver installs NVIDIA DRA Driver via Helm with pinned version
func (*PrerequisitesInstaller) IsDRADriverInstalled ¶
func (pi *PrerequisitesInstaller) IsDRADriverInstalled(ctx context.Context) bool
IsDRADriverInstalled checks if DRA Driver is installed (via Helm or other means)
func (*PrerequisitesInstaller) IsGPUOperatorInstalled ¶
func (pi *PrerequisitesInstaller) IsGPUOperatorInstalled(ctx context.Context) bool
IsGPUOperatorInstalled checks if GPU Operator is installed (via Helm or OLM)
func (*PrerequisitesInstaller) RollbackDRAMutations ¶
func (pi *PrerequisitesInstaller) RollbackDRAMutations(ctx context.Context)
RollbackDRAMutations performs best-effort cleanup of cluster-scoped mutations made during DRA installation This is called when installation or waiting fails, to avoid leaving partial state
func (*PrerequisitesInstaller) UninstallAll ¶
func (pi *PrerequisitesInstaller) UninstallAll(ctx context.Context) error
UninstallAll uninstalls DRA Driver (GPU Operator is cluster infrastructure, not removed)
func (*PrerequisitesInstaller) UninstallDRADriver ¶
func (pi *PrerequisitesInstaller) UninstallDRADriver(ctx context.Context) error
UninstallDRADriver uninstalls DRA Driver and cleans up cluster-scoped resources
func (*PrerequisitesInstaller) WaitForDRADriver ¶
func (pi *PrerequisitesInstaller) WaitForDRADriver(ctx context.Context, timeout time.Duration) error
WaitForDRADriver waits for DRA Driver to be ready
func (*PrerequisitesInstaller) WaitForGPUOperator ¶
func (pi *PrerequisitesInstaller) WaitForGPUOperator(ctx context.Context, timeout time.Duration) error
WaitForGPUOperator waits for GPU Operator to be ready
type ResourceBuilder ¶
type ResourceBuilder struct {
// contains filtered or unexported fields
}
ResourceBuilder helps build DRA resource objects
func NewResourceBuilder ¶
func NewResourceBuilder(namespace string) *ResourceBuilder
NewResourceBuilder creates a new builder
func (*ResourceBuilder) BuildDeviceClass ¶
func (rb *ResourceBuilder) BuildDeviceClass(name string) *resourceapi.DeviceClass
BuildDeviceClass creates a DeviceClass for NVIDIA GPUs
func (*ResourceBuilder) BuildLongRunningPodWithClaim ¶
func (rb *ResourceBuilder) BuildLongRunningPodWithClaim(name, claimName, image string) *corev1.Pod
BuildLongRunningPodWithClaim creates a long-running Pod for testing
func (*ResourceBuilder) BuildPodWithClaim ¶
func (rb *ResourceBuilder) BuildPodWithClaim(name, claimName, image string) *corev1.Pod
BuildPodWithClaim creates a Pod that uses a ResourceClaim
func (*ResourceBuilder) BuildPodWithInlineClaim ¶
func (rb *ResourceBuilder) BuildPodWithInlineClaim(name, deviceClassName string) *corev1.Pod
BuildPodWithInlineClaim creates a Pod with inline ResourceClaim Note: Inline claims via ResourceClaimTemplate are not directly supported in pod spec This creates a pod that references a ResourceClaimTemplateName The GPU count is specified in the ResourceClaimTemplate, not in this pod spec
func (*ResourceBuilder) BuildResourceClaim ¶
func (rb *ResourceBuilder) BuildResourceClaim(name, deviceClassName string, count int) *resourceapi.ResourceClaim
BuildResourceClaim creates a ResourceClaim requesting GPUs
func (*ResourceBuilder) BuildResourceClaimTemplate ¶
func (rb *ResourceBuilder) BuildResourceClaimTemplate(name, deviceClassName string, count int) *resourceapi.ResourceClaimTemplate
BuildResourceClaimTemplate creates a ResourceClaimTemplate