-
Notifications
You must be signed in to change notification settings - Fork 303
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
Disk Cache for Pyodide Wheels #1851
Conversation
I just found out KJ does in fact have file I/O, so I'm in the process of rewriting that section of the PR |
c04de8e
to
3441744
Compare
Only thing left to do is to get the cache root from the command line or from the capnp config and edit cacheRoot in server.c++ to make it dynamic |
a38d264
to
e229797
Compare
bdb6b66
to
39aa0c9
Compare
39aa0c9
to
b8aefe8
Compare
Having trouble testing since devspace is down, but the test plan is at the top and everything should be complete at this point |
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.
Generally looks good to me. Is there a downstream PR? Looks to me like you'll need to add a DisabledDiskCache or something like that so that the disk-cache import won't fail.
721343e
to
9557a8f
Compare
4c48e71
to
29ce06b
Compare
29ce06b
to
b2d4f6f
Compare
Relies on #1919 |
void diskCacheDir(kj::StringPtr pathStr) { | ||
kj::Path path = fs->getCurrentPath().eval(pathStr); | ||
kj::Maybe<kj::Own<const kj::Directory>> dir = fs->getRoot().tryOpenSubdir(path, kj::WriteMode::MODIFY); | ||
server.setDiskCacheRoot(kj::mv(dir)); | ||
} |
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.
Should this parameter have a default value pointing at $TMPDIR/workerd-python-package-cache
?
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.
On linux and mac I'd like to see it default to:
$XDG_CACHE_HOME/workerd-python-package-cache
ifXDG_CACHE_HOME
is defined$HOME/.cache/workerd-python-package-cache
otherwise.
Unless you have a strong opinion that it should go in /tmp
instead.
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.
True, better to follow the XDG spec here.
For macOS I think we want ~/Library/Caches/
and I guess %LOCALAPPDATA%
for Windows.
* Disk Cache for Pyodide Wheels * Add command line argument for disk cache root * Better API for instantiating a disabled disk cache * Remove logs when using disk cache * Fix bug with reportUndefinedSymbols shim
Test plan: