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

dvc does not cache stream opened files #9030

Closed
skshetry opened this issue Feb 15, 2023 · 5 comments · Fixed by #9183
Closed

dvc does not cache stream opened files #9030

skshetry opened this issue Feb 15, 2023 · 5 comments · Fixed by #9183

Comments

@skshetry
Copy link
Member

Noticed during #8786 that we don't cache files that were streamed from remotes. So subsequent plots show always hits the remote and is thus slow.

@efiop
Copy link
Contributor

efiop commented Feb 16, 2023

Might be solved by #9037

@efiop
Copy link
Contributor

efiop commented Feb 17, 2023

@skshetry Could you try with the upstream, please?

@skshetry
Copy link
Member Author

I don't think so. DVCFileSystem does not support caching, we just use fs.open() which only streams. AFAIR we had fetch=True that would fetch and then re-open from local cache in the past but we got rid of that in 2.0.

@efiop
Copy link
Contributor

efiop commented Feb 17, 2023

@skshetry Ah, I see. Maybe it is worth doing dvc fetch explicitly there instead.

@skshetry
Copy link
Member Author

skshetry commented Feb 17, 2023

In plots, we return a dict with partial function to read file, and resolve later, so we can't do a fetch there.

res[fs_path].update(
{
"data_source": partial(
parse,
fs,
fs_path,
props=joined_props,
onerror=onerror,
)
}
)

Since we are reading the file completely in memory on fs.open(), an easier way would be to bring fetch=True in fs.open() that'd first cache locally and reopen from it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants