-
Notifications
You must be signed in to change notification settings - Fork 59
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
Caching of file-set hashes by local path and mtimes #700
Merged
Merged
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
45117ef
added code to handle "locally-persistent-ids"
tclose 2b7ca50
implemented persistent hash cache to avoid rehashing files
tclose 04b95ff
touched up persistent_hash_cache test
tclose 0c865f4
replaced Cache({}) with Cache() to match new proper class
tclose 3b3fdb7
upped resolution of mtime to nanoseconds
tclose 81a5108
added sleep to various tests to ensure file mtimes are different
tclose 0c4b179
added more sleeps to ensure mtimes of input files are different in tests
tclose 615d590
debugged setting hash cache via env var and added clean up of directory
tclose 55b660e
mock mtime writing instead of adding sleeps to ensure mtimes are diff…
tclose 5d51736
undid overzealous black
tclose 0421f85
added missing import
tclose a864b32
Adds platformdirs dependency and use it to store the hash cache within
tclose 05ca695
added unittests to hit exceptions in persistentcache init
tclose 52ef03f
added mkdir to location converter
tclose 0216236
debugged mkdir of persistent cache
tclose bad261b
bug fixes in persistentcache location init
tclose 2fbee2b
Revert "mock mtime writing instead of adding sleeps to ensure mtimes …
tclose 91948f0
skip lock files in directory clean up
tclose e058408
fixed clean-up bug
tclose f1ded7a
added mock import
tclose bb11067
added another sleep to trigger atime change
tclose a031ea5
implementing @effigies suggestions
tclose f2f70a6
added comments and doc strings to explain the use of the persistent c…
tclose 191aa9c
touched up comments
tclose 3076fea
another comment touch up
tclose a094fbc
touch up comments again
tclose d27201f
Merge branch 'master' into local-cache-ids
tclose 291f29f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0a10f6c
added in @djarecka's test for moving file cache locations
tclose 311e3dd
updated cache initialisation
tclose 4827365
switched to use blake2b isntead of blake2s
tclose b6799b6
[skip ci] deleted already commented-out code
tclose 2bb86fe
additional doc strings for hash cache objects
tclose 1f601e1
added test to see that persistent cache is used in the running of tasks
tclose 7e60c41
moved persistent hash cache within "hash_cache" subdirectory of the p…
tclose 921979c
fixed import issue
tclose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@tclose - where are you setting the persistent cach path? i.e.
PYDRA_HASH_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.
At @ghisvail's suggestion, the hash cache is stored in a system-dependent user cache directory using
platformdirs.user_cache_dir
by default (e.g./Users/<username>/Library/Caches/pydra/<version-number>
on MacOS).I have just tweaked the code so that it is now put in a
hashes
subdirectory of that user cache dir (accessible in thepydra.utils.user_cache_dir
variable) just in case any other cache data needs to be stored at some point in the future.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.
oh, got it! Sorry I missed that. I've just realized that I made a typo when I was setting
PYDRA_HASH_CACHE
and that's why it was not saving the hashes there, and was confused where this is being saved..