Skip to main content

AddFlyteCustomizationsToContainer

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.

def AddFlyteCustomizationsToContainer(
ctx: context.Context,
parameters: template.Parameters,
mode: ResourceCustomizationMode,
container: *v1.Container,
extendedResources: *core.ExtendedResources
) - > 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.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for logging and cancellation.
parameterstemplate.ParametersThe parameters containing task execution metadata, platform resources, and override resources used for customization.
modeResourceCustomizationModeThe mode specifying how container resources should be customized (e.g., assign, merge, or ensure in range).
container*v1.ContainerThe container definition to which Flyte customizations will be applied, including command, arguments, environment variables, and resource requirements.
extendedResources*core.ExtendedResourcesAdditional extended resources, such as GPU accelerators, that might influence resource sanitization.

Returns

TypeDescription
errorAn error if any templating or customization fails.