common

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GPUPortion           = "GPU_PORTION"
	ReceivedTypeFraction = "Fraction"
	ReceivedTypeRegular  = "Regular"
)
View Source
const (
	NumOfGpusEnvVarBC = "RUNAI_NUM_OF_GPUS" // Deprecated, please use GPU_PORTION env var instead

)

Variables

This section is empty.

Functions

func AddDirectEnvVarsConfigMapSource

func AddDirectEnvVarsConfigMapSource(container *v1.Container, directEnvVarsMapName string)

func AddEnvVarToContainer

func AddEnvVarToContainer(container *v1.Container, envVar v1.EnvVar)

func AddGPUSharingEnvVars added in v0.7.6

func AddGPUSharingEnvVars(container *v1.Container, sharedGpuConfigMapName string)

func GetConfigVolumeName

func GetConfigVolumeName(configMapName string) string

func GetFractionContainerRef added in v0.10.0

func GetFractionContainerRef(pod *v1.Pod) (*gpusharingconfigmap.PodContainerRef, error)

func IsSharedGPUAllocation

func IsSharedGPUAllocation(bindRequest *v1alpha2.BindRequest) bool

func SetConfigMapVolume

func SetConfigMapVolume(pod *v1.Pod, configMapName string)

func SetGPUPortion added in v0.7.6

func SetGPUPortion(
	ctx context.Context, kubeClient client.Client, pod *v1.Pod, containerRef *gpusharingconfigmap.PodContainerRef,
	gpuPortionStr string,
) error

func SetNvidiaVisibleDevices

func SetNvidiaVisibleDevices(
	ctx context.Context, kubeClient client.Client, pod *v1.Pod, containerRef *gpusharingconfigmap.PodContainerRef,
	visibleDevicesValue string,
) error

func UpdateConfigMapEnvironmentVariable

func UpdateConfigMapEnvironmentVariable(
	ctx context.Context, kubeclient client.Client, task *v1.Pod,
	configMapName string, changesFunc func(map[string]string) error,
) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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