Documentation ¶
Index ¶
- Constants
- func AddCoPilotToContainer(ctx context.Context, cfg config.FlyteCoPilotConfig, c *v1.Container, ...) error
- func AddCoPilotToPod(ctx context.Context, cfg config.FlyteCoPilotConfig, coPilotPod *v1.PodSpec, ...) error
- func AddFlyteCustomizationsToContainer(ctx context.Context, parameters template.Parameters, ...) error
- func ApplyResourceOverrides(ctx context.Context, resources v1.ResourceRequirements) *v1.ResourceRequirements
- func BuildIdentityPod() *v1.Pod
- func BuildPodWithSpec(podSpec *v1.PodSpec) *v1.Pod
- func CalculateStorageSize(requirements *v1.ResourceRequirements) *resource.Quantity
- func ConvertPodFailureToError(status v1.PodStatus) (code, message string)
- func DataVolume(name string, size *resource.Quantity) v1.Volume
- func DecorateEnvVars(ctx context.Context, envVars []v1.EnvVar, id pluginsCore.TaskExecutionID) []v1.EnvVar
- func DemystifyPending(status v1.PodStatus) (pluginsCore.PhaseInfo, error)
- func DemystifySuccess(status v1.PodStatus, info pluginsCore.TaskInfo) (pluginsCore.PhaseInfo, error)
- func DeterminePrimaryContainerPhase(primaryContainerName string, statuses []v1.ContainerStatus, ...) pluginsCore.PhaseInfo
- func DownloadCommandArgs(fromInputsPath, outputPrefix storage.DataReference, toLocalPath string, ...) ([]string, error)
- func FlyteCoPilotContainer(name string, cfg config.FlyteCoPilotConfig, args []string, ...) (v1.Container, error)
- func GetContextEnvVars(ownerCtx context.Context) []v1.EnvVar
- func GetExecutionEnvVars(id pluginsCore.TaskExecutionID) []v1.EnvVar
- func GetLastTransitionOccurredAt(pod *v1.Pod) v12.Time
- func GetPodTolerations(interruptible bool, resourceRequirements ...v1.ResourceRequirements) []v1.Toleration
- func GetServiceAccountNameFromTaskExecutionMetadata(taskExecutionMetadata pluginmachinery_core.TaskExecutionMetadata) string
- func MergeResources(in v1.ResourceRequirements, out *v1.ResourceRequirements)
- func SidecarCommandArgs(fromLocalPath string, outputPrefix, rawOutputPath storage.DataReference, ...) ([]string, error)
- func ToK8sContainer(ctx context.Context, taskContainer *core.Container, iFace *core.TypedInterface, ...) (*v1.Container, error)
- func ToK8sEnvVar(env []*core.KeyValuePair) []v1.EnvVar
- func ToK8sPodSpec(ctx context.Context, tCtx pluginsCore.TaskExecutionContext) (*v1.PodSpec, error)
- func UpdatePod(taskExecutionMetadata pluginsCore.TaskExecutionMetadata, ...)
- type ResourceCustomizationMode
Constants ¶
const Interrupted = "Interrupted"
const OOMKilled = "OOMKilled"
const PodKind = "pod"
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
const SIGKILL = 137
Variables ¶
This section is empty.
Functions ¶
func AddCoPilotToContainer ¶ added in v0.5.29
func AddCoPilotToContainer(ctx context.Context, cfg config.FlyteCoPilotConfig, c *v1.Container, iFace *core.TypedInterface, pilot *core.DataLoadingConfig) error
func AddCoPilotToPod ¶ added in v0.5.29
func AddCoPilotToPod(ctx context.Context, cfg config.FlyteCoPilotConfig, coPilotPod *v1.PodSpec, iFace *core.TypedInterface, taskExecMetadata core2.TaskExecutionMetadata, inputPaths io.InputFilePaths, outputPaths io.OutputFilePaths, pilot *core.DataLoadingConfig) error
func AddFlyteCustomizationsToContainer ¶ added in v0.5.65
func AddFlyteCustomizationsToContainer(ctx context.Context, parameters template.Parameters, mode ResourceCustomizationMode, container *v1.Container) error
Takes a container definition which specifies how to run a Flyte task and fills in templated command and argument values, updates resources and decorates environment variables with platform and task-specific customizations.
func ApplyResourceOverrides ¶
func ApplyResourceOverrides(ctx context.Context, resources v1.ResourceRequirements) *v1.ResourceRequirements
func BuildIdentityPod ¶
func CalculateStorageSize ¶ added in v0.5.29
func CalculateStorageSize(requirements *v1.ResourceRequirements) *resource.Quantity
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 DemystifySuccess ¶ added in v0.5.29
func DemystifySuccess(status v1.PodStatus, info pluginsCore.TaskInfo) (pluginsCore.PhaseInfo, error)
func DeterminePrimaryContainerPhase ¶ added in v0.5.54
func DeterminePrimaryContainerPhase(primaryContainerName string, statuses []v1.ContainerStatus, info *pluginsCore.TaskInfo) pluginsCore.PhaseInfo
func DownloadCommandArgs ¶ added in v0.5.29
func DownloadCommandArgs(fromInputsPath, outputPrefix storage.DataReference, toLocalPath string, format core.DataLoadingConfig_LiteralMapFormat, inputInterface *core.VariableMap) ([]string, error)
func FlyteCoPilotContainer ¶ added in v0.5.29
func FlyteCoPilotContainer(name string, cfg config.FlyteCoPilotConfig, args []string, volumeMounts ...v1.VolumeMount) (v1.Container, error)
func GetExecutionEnvVars ¶
func GetExecutionEnvVars(id pluginsCore.TaskExecutionID) []v1.EnvVar
func GetPodTolerations ¶ added in v0.5.29
func GetPodTolerations(interruptible bool, resourceRequirements ...v1.ResourceRequirements) []v1.Toleration
func GetServiceAccountNameFromTaskExecutionMetadata ¶ added in v0.5.35
func GetServiceAccountNameFromTaskExecutionMetadata(taskExecutionMetadata pluginmachinery_core.TaskExecutionMetadata) string
func MergeResources ¶ added in v0.5.65
func MergeResources(in v1.ResourceRequirements, out *v1.ResourceRequirements)
func SidecarCommandArgs ¶ added in v0.5.29
func SidecarCommandArgs(fromLocalPath string, outputPrefix, rawOutputPath storage.DataReference, startTimeout time.Duration, iface *core.TypedInterface) ([]string, error)
func ToK8sContainer ¶
func ToK8sContainer(ctx context.Context, taskContainer *core.Container, iFace *core.TypedInterface, parameters template.Parameters) (*v1.Container, error)
Transforms a task template target of type core.Container into a bare-bones kubernetes container, which can be further modified with flyte-specific customizations specified by various static and run-time attributes.
func ToK8sEnvVar ¶
func ToK8sEnvVar(env []*core.KeyValuePair) []v1.EnvVar
func ToK8sPodSpec ¶
func ToK8sPodSpec(ctx context.Context, tCtx pluginsCore.TaskExecutionContext) (*v1.PodSpec, error)
func UpdatePod ¶ added in v0.5.29
func UpdatePod(taskExecutionMetadata pluginsCore.TaskExecutionMetadata, resourceRequirements []v1.ResourceRequirements, podSpec *v1.PodSpec)
Updates the base pod spec used to execute tasks. This is configured with plugins and task metadata-specific options
Types ¶
type ResourceCustomizationMode ¶ added in v0.5.65
type ResourceCustomizationMode int
const ( AssignResources ResourceCustomizationMode = iota MergeExistingResources LeaveResourcesUnmodified )