Skip to main content

SerializationContext

This object holds serialization time contextual information, that can be used when serializing the task and various parameters of a tasktemplate. This is only available when the task is being serialized and can be during a deployment or runtime.

Attributes

AttributeTypeDescription
versionstrThe version of the task
project`strNone` = None
domain`strNone` = None
org`strNone` = None
code_bundleOptional[[CodeBundle](codebundle.md?sid=flyte_models_codebundle)] = NoneThe code bundle for the task. This is used to package the code and the inflation path.
input_pathstr = "{{.input}}"The path to the inputs for the task. This is used to determine where the inputs will be located
output_pathstr = "{{.outputPrefix}}"The path to the outputs for the task. This is used to determine where the outputs will be located
interpreter_pathstr = "/opt/venv/bin/python"This attribute stores the file path to the Python interpreter used for executing the task, which ensures the task runs in the correct environment.
image_cache`ImageCacheNone` = None
root_dirOptional[pathlib.Path] = NoneThis attribute stores the root directory path for the serialization context, which serves as the base for resolving other relative paths within the task's environment.

Constructor

Signature

def SerializationContext(
version: str,
code_bundle: [CodeBundle](codebundle.md?sid=flyte_models_codebundle),
input_path: str,
output_path: str
)

Parameters

NameTypeDescription
versionstrThe version of the task
code_bundle[CodeBundle](codebundle.md?sid=flyte_models_codebundle)The code bundle for the task. This is used to package the code and the inflation path.
input_pathstrThe path to the inputs for the task. This is used to determine where the inputs will be located
output_pathstrThe path to the outputs for the task. This is used to determine where the outputs will be located

Methods


get_entrypoint_path()

@classmethod
def get_entrypoint_path(
interpreter_path: Optional[str] = None
) - > str

Get the entrypoint path for the task. This is used to determine the entrypoint for the task execution.

Parameters

NameTypeDescription
interpreter_pathOptional[str] = NoneThe path to the interpreter (python).

Returns

TypeDescription
strThe entrypoint path for the task execution.