-
Notifications
You must be signed in to change notification settings - Fork 336
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
Automatically derive a cache descriminator from the wasmer version and selected functions #2250
Conversation
d53c9bc
to
2d0f2de
Compare
That is awkward.. for some reason the CI has a different discriminator value than I have on my local machine? That's not right.. |
Interesting, on my machine, the test also passes. |
af86194
to
a5ef54d
Compare
a5ef54d
to
f2ad3b3
Compare
6c68bf7
to
0cfa86a
Compare
6af8b92
to
4dc02fb
Compare
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 like that we have a mechanism that prevents errors during deserialization of modules in cache. I see some room for potential improvements/simplification of the current approach. If the comments I suggested are implemented, potentially we'll be able to move the only thing that is needed - hash_function
- to cw-derive
crate. Let's discuss that approach.
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.
Just changelog entry and the one open comment and then it's good to merge.
5c27dbf
to
bce8adf
Compare
Ugh, I forgot GitHub Actions always tests a fictional merge commit.. that behaviour throws me off so bad |
Yup, that also threw me off a few times before, but it's definitely the correct thing to do, since that's what you want to test. |
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.
LGTM
I'm wondering if we also want to backport this?
This looks good at first glance. However, how does a node operator know which directories to delete and which ones to keep? Invalidated caches are not deleted automatically. |
The idea here was to have them look at the least-recently-used directory and delete the others. Depends on how much we want to proof this impl. But I feel like the LRU approach is fine, not perfect but fine. |
Closes #2205
The hash is produced as follows:
And the hashes of the functions are lexicographically sorted since the
inventory
crate doesn't give us any guarantees about the order of hashes yielded.