-
Notifications
You must be signed in to change notification settings - Fork 702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flytekit] Polish - Cache #6143
Comments
Before moving forward with this, I think we need to consider how this interacts with flyteorg/flytekit#2971 |
Yes! I think, ideally, the Perhaps, instead of combining these two objects into one, we could simply add a |
@granthamtaylor @thomasjpfan @eapolinario @dansola I like grantham's idea of just moving the Can we just make it Cache(
version: str | CachePolicy,
serialize: bool,
ignored_inputs: list[str] | str | None = None, # Or should we just use the "ignore" in the original above, i thought "ignored_inputs" might be more clear
) The What does everyone think? If we're all good, I say we go for it. And yeah let's resolve and merge dan's pr first. |
@wild-endeavor I have been thinking about this for some while. I would still like the However, I think that the class Cache:
salt: Optional[str]=None
serialize: bool=False
ignored_inputs: Optional[list[str] | str]=None
policies: Optional[list[CachePolicy] | CachePolicy]=None I say this for the following reasons: we have currently been calling Secondly, all of the parameters here should have some default arguments. Lastly, the |
We're not abandoning the existing behavior, right? How users are going to migrate? We can't simply assume that if
this is not entirely correct as the salt is used to produce the final version, which is what
that's reasonable, but this confusion is alleviated by docs. Two comments about flyteorg/flytekit#2971:
This leads me to propose a slightly modified version of class Cache:
policies: list[CachePolicy]=[ <reasonable-list-of-policies> ] # this is for illustration purposes only, we shouldn't have mutable objects as part of an object definition
serialize: bool=False
ignored_inputs: Optional[list[str]]=None |
I agree with that! It is a small thing, but I would also like to see that single item ignore inputs are supported ( I think that leaves us with the following impl for class Cache:
version: Optional[str]=None
policies: list[CachePolicy]=[ <reasonable-list-of-policies> ] # this is for illustration purposes only, we shouldn't have mutable objects as part of an object definition
serialize: bool=False
ignored_inputs: Optional[list[str] | str]=None |
100%. As we spoke offline, not listing Let me get the gears cranking on flyteorg/flytekit#2971. Summary of the proposed changes:
|
Caching
This is a series of tickets to improve the flytekit authoring experience. If any changes are not possible to make in a backwards-compatible way, split it out into a separate ticket.
Merge options into a dataclass and rename argument
Currently there are three configurations for cache control:
cache_serialize
,cache_version
,cache_ignore_input_vars
. We should rename these toserialize
(bool
) ,version
(remains astr
), andignore
(update type tolist[str]|str|None=None
).This object should then be the input to the
cache
argument in the task decorator, which should be of typebool | Cache
, and isFalse
by default.Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: