Skip to content
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 local overwrite cache #2198

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

ChungYujoyce
Copy link
Contributor

Tracking issue

Closes flyteorg/flyte#4727

Why are the changes needed?

We can't overwrite the cache when using pyflyte run --overwrite-cache in local runs.

What changes were proposed in this pull request?

  • Once the argument --overwrite-cache is added, we get run_level_params.overwrite_cache=True and set the environment variable FLYTE_LOCAL_CACHE_OVERWRITE=true accordingly.
  • With FLYTE_LOCAL_CACHE_OVERWRITE=true, the task will be executed and overwrite the existing cache.
  • The cache add function in LocalTaskCache is changed to set as the previous one can't update the cache if there's already an existing one.

How was this patch tested?

Added a test which confirms that setting FLYTE_LOCAL_CACHE_OVERWRITE=true can successfully overwrite the existing cache.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Signed-off-by: ChungYujoyce <joyce.bhps@gmail.com>
Signed-off-by: ChungYujoyce <joyce.bhps@gmail.com>
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 18, 2024
Copy link

codecov bot commented Feb 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7794d3a) 85.53% compared to head (5a6265e) 85.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2198      +/-   ##
==========================================
- Coverage   85.53%   85.52%   -0.01%     
==========================================
  Files         309      309              
  Lines       23460    23467       +7     
  Branches     3630     3632       +2     
==========================================
+ Hits        20066    20070       +4     
- Misses       2752     2753       +1     
- Partials      642      644       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: ChungYujoyce <joyce.bhps@gmail.com>
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@dosubot dosubot bot added the lgtm This PR has been approved by maintainer label Feb 20, 2024
Copy link
Collaborator

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Don't worry about the failing unit tests in https://github.com/flyteorg/flytekit/actions/runs/7969843181/attempts/2?pr=2198, those are being fixed in #2199.

@eapolinario eapolinario merged commit 434953e into flyteorg:master Feb 20, 2024
78 of 81 checks passed
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
* Fix local overwrite cache

Signed-off-by: ChungYujoyce <joyce.bhps@gmail.com>

* take off print

Signed-off-by: ChungYujoyce <joyce.bhps@gmail.com>

* change overwrite logic

Signed-off-by: ChungYujoyce <joyce.bhps@gmail.com>

---------

Signed-off-by: ChungYujoyce <joyce.bhps@gmail.com>
Signed-off-by: Jan Fiedler <jan@union.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants