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

DM-36412: Add new env var DAF_BUTLER_CACHE_DIRECTORY_IF_UNSET #738

Merged
merged 4 commits into from Oct 7, 2022

Conversation

timj
Copy link
Member

@timj timj commented Oct 4, 2022

This only overrides the cache directory if nothing has set it explicitly from config or the other env var.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Base: 84.79% // Head: 84.80% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (8e3d7ad) compared to base (cd26679).
Patch coverage: 93.22% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #738      +/-   ##
==========================================
+ Coverage   84.79%   84.80%   +0.01%     
==========================================
  Files         254      254              
  Lines       32911    32967      +56     
  Branches     5618     5630      +12     
==========================================
+ Hits        27907    27959      +52     
- Misses       3783     3785       +2     
- Partials     1221     1223       +2     
Impacted Files Coverage Δ
...thon/lsst/daf/butler/core/datastoreCacheManager.py 80.95% <85.71%> (+0.20%) ⬆️
tests/test_datastore.py 99.28% <100.00%> (+0.02%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks good, one easy question.

tests/test_datastore.py Outdated Show resolved Hide resolved
@timj timj marked this pull request as ready for review October 6, 2022 15:57
This only overrides the cache directory if nothing has
set it explicitly from config or the other env var.
If multiple processes are sharing a cache directory and caching
on read then it is possible that the other process has already
copied the dataset into the cache. We therefore need to check
before we try to copy it.
…able

Also change the behavior such that if that variable gets set
after the cache manager has been instantiated, it will still
use that environment variable to make the default cache
directory if it has not yet been defined.
@timj timj merged commit 07bf668 into main Oct 7, 2022
@timj timj deleted the tickets/DM-36412 branch October 7, 2022 15:37
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 this pull request may close these issues.

None yet

2 participants