flytekit.core.cache
| Class |
Description |
Cache |
Cache configuration for a task. |
VersionParameters |
Parameters used for version hash generation. |
| Property |
Type |
Description |
FuncOut |
TypeVar |
|
P |
ParamSpec |
|
Cache configuration for a task.
:type version: Optional[str]
:type serialize: bool
:type ignored_inputs: Union[Tuple[str, …], str]
:type salt: str
:type policies: Optional[Union[List[CachePolicy], CachePolicy]]
class Cache(
version: typing.Optional[str] = None,
serialize: bool = False,
ignored_inputs: typing.Union[typing.Tuple[str, ...], str] = (),
salt: str = '',
policies: typing.Union[typing.List[flytekit.core.cache.CachePolicy], flytekit.core.cache.CachePolicy, NoneType] = None,
)
| Parameter |
Type |
Description |
version |
typing.Optional[str] |
The version of the task. If not provided, the version will be generated based on the cache policies. |
serialize |
bool |
Boolean that indicates if identical (ie. same inputs) instances of this task should be executed in serial when caching is enabled. This means that given multiple concurrent executions over identical inputs, only a single instance executes and the rest wait to reuse the cached results. |
ignored_inputs |
typing.Union[typing.Tuple[str, ...], str] |
A tuple of input names to ignore when generating the version hash. |
salt |
str |
A salt used in the hash generation. |
policies |
typing.Union[typing.List[flytekit.core.cache.CachePolicy], flytekit.core.cache.CachePolicy, NoneType] |
A list of cache policies to generate the version hash. |
def get_version(
params: flytekit.core.cache.VersionParameters,
) -> str
| Parameter |
Type |
Description |
params |
flytekit.core.cache.VersionParameters |
|
def get_version(
salt: str,
params: flytekit.core.cache.VersionParameters,
) -> str
| Parameter |
Type |
Description |
salt |
str |
|
params |
flytekit.core.cache.VersionParameters |
|
Parameters used for version hash generation.
param func: The function to generate a version for. This is an optional parameter and can be any callable
that matches the specified parameter and return types.
:type func: Optional[Callable[P, FuncOut]]
:type container_image: Optional[Union[str, ImageSpec]]
class VersionParameters(
func: typing.Callable[~P, ~FuncOut],
container_image: typing.Union[str, flytekit.image_spec.image_spec.ImageSpec, NoneType] = None,
pod_template: typing.Optional[flytekit.core.pod_template.PodTemplate] = None,
pod_template_name: typing.Optional[str] = None,
)
| Parameter |
Type |
Description |
func |
typing.Callable[~P, ~FuncOut] |
|
container_image |
typing.Union[str, flytekit.image_spec.image_spec.ImageSpec, NoneType] |
The container image to generate a version for. This can be a string representing the image name or an ImageSpec object. |
pod_template |
typing.Optional[flytekit.core.pod_template.PodTemplate] |
|
pod_template_name |
typing.Optional[str] |
|