-
Notifications
You must be signed in to change notification settings - Fork 300
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
Fix Bug: with_overrides for cache doesn't work #2975
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Stefan He <[email protected]>
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2975 +/- ##
===========================================
- Coverage 79.62% 42.28% -37.34%
===========================================
Files 200 226 +26
Lines 20997 22685 +1688
Branches 2705 2710 +5
===========================================
- Hits 16719 9593 -7126
- Misses 3511 12876 +9365
+ Partials 767 216 -551 ☔ View full report in Codecov by Sentry. |
@@ -194,6 +194,8 @@ def with_overrides( | |||
|
|||
if name is not None: | |||
self._metadata._name = name | |||
if self.run_entity and hasattr(self.run_entity, "metadata"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not override the run_entity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppose you have two tasks in a workflow, like below. The cache version of the second task will be overridden as well.
@workflow
def wf():
t1().with_override(cache_version="v2")
t1()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can pass the node info to local_execute
, and use the cache version in the node info to retrieve the data from the cache.
flytekit/flytekit/core/base_task.py
Line 306 in 935be5c
if self.metadata.cache and local_config.cache_enabled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pingsutw Could I know how to do this?
"You can pass the node info to local_execute`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the problem is:
In node.py
, self._metadata._cacheable
won't be affecting the actual Task entity.
That's why we want to modify the Task's entity's metadata.
But I acknowledge the issue that the two tasks example woulld be problematic. I am not sure how local_config
can help with it.
Tracking issue
Closes flyteorg/flyte#6079
Why are the changes needed?
I tried the with_overrides to override cache configuration for a local flyte @task, but it didn't work as expected.
Code:
After pyflyte run, I found the
cache
is stillFalse
andcache_version
still""
What changes were proposed in this pull request?
How was this patch tested?
make test with a new test case
Also tested in our company's fork E2E with many workflows submission.
Setup process
Screenshots
Before:
After:
Check all the applicable boxes
Related PRs
#2154
Docs link