Documentation ¶
Index ¶
- Constants
- func ApplyResourceOverrides(ctx context.Context, resources v1.ResourceRequirements) *v1.ResourceRequirements
- func BuildIdentityPod() *v1.Pod
- func BuildPodWithSpec(podSpec *v1.PodSpec) *v1.Pod
- func ConvertPodFailureToError(status v1.PodStatus) (code, message string)
- func DecorateEnvVars(ctx context.Context, envVars []v1.EnvVar, id pluginsCore.TaskExecutionID) []v1.EnvVar
- func DemystifyPending(status v1.PodStatus) (pluginsCore.PhaseInfo, error)
- func GetContextEnvVars(ownerCtx context.Context) []v1.EnvVar
- func GetExecutionEnvVars(id pluginsCore.TaskExecutionID) []v1.EnvVar
- func GetLastTransitionOccurredAt(pod *v1.Pod) v12.Time
- func GetTolerationsForResources(resourceRequirements ...v1.ResourceRequirements) []v1.Toleration
- func ToK8sContainer(ctx context.Context, taskExecutionMetadata pluginsCore.TaskExecutionMetadata, ...) (*v1.Container, error)
- func ToK8sEnvVar(env []*core.KeyValuePair) []v1.EnvVar
- func ToK8sPodSpec(ctx context.Context, taskExecutionMetadata pluginsCore.TaskExecutionMetadata, ...) (*v1.PodSpec, error)
Constants ¶
View Source
const PodKind = "pod"
View Source
const ResourceNvidiaGPU = "nvidia.com/gpu"
ResourceNvidiaGPU is the name of the Nvidia GPU resource. Copied from: k8s.io/autoscaler/cluster-autoscaler/utils/gpu/gpu.go
Variables ¶
This section is empty.
Functions ¶
func ApplyResourceOverrides ¶
func ApplyResourceOverrides(ctx context.Context, resources v1.ResourceRequirements) *v1.ResourceRequirements
func BuildIdentityPod ¶
func DecorateEnvVars ¶
func DecorateEnvVars(ctx context.Context, envVars []v1.EnvVar, id pluginsCore.TaskExecutionID) []v1.EnvVar
func DemystifyPending ¶
func DemystifyPending(status v1.PodStatus) (pluginsCore.PhaseInfo, error)
Important considerations. Pending Status in Pod could be for various reasons and sometimes could signal a problem Case I: Pending because the Image pull is failing and it is backing off
This could be transient. So we can actually rely on the failure reason. The failure transitions from ErrImagePull -> ImagePullBackoff
Case II: Not enough resources are available. This is tricky. It could be that the total number of
resources requested is beyond the capability of the system. for this we will rely on configuration and hence input gates. We should not allow bad requests that request for large number of resource through. In the case it makes through, we will fail after timeout
func GetExecutionEnvVars ¶
func GetExecutionEnvVars(id pluginsCore.TaskExecutionID) []v1.EnvVar
func GetTolerationsForResources ¶
func GetTolerationsForResources(resourceRequirements ...v1.ResourceRequirements) []v1.Toleration
func ToK8sContainer ¶
func ToK8sContainer(ctx context.Context, taskExecutionMetadata pluginsCore.TaskExecutionMetadata, taskContainer *core.Container, inputReader io.InputReader, outputPaths io.OutputFilePaths) (*v1.Container, error)
Returns a K8s Container for the execution
func ToK8sEnvVar ¶
func ToK8sEnvVar(env []*core.KeyValuePair) []v1.EnvVar
func ToK8sPodSpec ¶
func ToK8sPodSpec(ctx context.Context, taskExecutionMetadata pluginsCore.TaskExecutionMetadata, taskReader pluginsCore.TaskReader, inputs io.InputReader, outputPaths io.OutputFilePaths) (*v1.PodSpec, error)
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.