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
| Attribute | Type | Description |
|---|---|---|
| version | str | The version of the task |
| project | `str | None` = None |
| domain | `str | None` = None |
| org | `str | None` = None |
| code_bundle | Optional[[CodeBundle](codebundle.md?sid=flyte_models_codebundle)] = None | The code bundle for the task. This is used to package the code and the inflation path. |
| input_path | str = "{{.input}}" | The path to the inputs for the task. This is used to determine where the inputs will be located |
| output_path | str = "{{.outputPrefix}}" | The path to the outputs for the task. This is used to determine where the outputs will be located |
| interpreter_path | str = "/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 | `ImageCache | None` = None |
| root_dir | Optional[pathlib.Path] = None | This 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
| Name | Type | Description |
|---|---|---|
| version | str | The 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_path | str | The path to the inputs for the task. This is used to determine where the inputs will be located |
| output_path | str | The 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
| Name | Type | Description |
|---|---|---|
| interpreter_path | Optional[str] = None | The path to the interpreter (python). |
Returns
| Type | Description |
|---|---|
str | The entrypoint path for the task execution. |