-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Separate the resolution cache and repository cache in Ivy #5844
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,14 @@ def register_options(cls, register): | |
register('--ivy-profile', advanced=True, default=cls._DEFAULT_VERSION, | ||
help='The version of ivy to fetch.') | ||
register('--cache-dir', advanced=True, default=os.path.expanduser('~/.ivy2/pants'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should deprecate this option probably? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, based on our discussion, I'm fine with not deprecating this. But you should expand the description of all of these options to explain how they interact, and you should add validation that both |
||
help='Directory to store artifacts retrieved by Ivy.') | ||
help='The default directory used for both the Ivy resolution and repository caches.' | ||
'If you want to isolate the resolution cache from the repository cache, we ' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Is it worth requiring that both |
||
'recommend setting both the --resolution-cache-dir and --repository-cache-dir ' | ||
'instead of using --cache-dir') | ||
register('--resolution-cache-dir', advanced=True, | ||
help='Directory to store Ivy resolution artifacts.') | ||
register('--repository-cache-dir', advanced=True, | ||
help='Directory to store Ivy repository artifacts.') | ||
register('--ivy-settings', advanced=True, | ||
help='Location of XML configuration file for Ivy settings.') | ||
register('--bootstrap-ivy-settings', advanced=True, | ||
|
@@ -93,3 +100,15 @@ def extra_jvm_options(self): | |
def _parse_proxy_string(self, proxy_string): | ||
parse_result = urllib.parse.urlparse(proxy_string) | ||
return parse_result.hostname, parse_result.port | ||
|
||
def resolution_cache_dir(self): | ||
if self.get_options().resolution_cache_dir: | ||
return self.get_options().resolution_cache_dir | ||
else: | ||
return self.get_options().cache_dir | ||
|
||
def repository_cache_dir(self): | ||
if self.get_options().repository_cache_dir: | ||
return self.get_options().repository_cache_dir | ||
else: | ||
return self.get_options().cache_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.
@cheister Can you clarify when
ivy_cache_dir
will be used instead of the two new options?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 think in most cases people would use the ivy_cache_dir, since most of the time you want the resolution_cache_dir and repository_cache_dir to be the same.
I'm assuming you're referring to the cache-dir option on the
ivy_subsystem
and not this one on the ivy_task_mixin?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.
Thanks. I was kinda expecting some logic between old and new options. Maybe somewhere around https://github.com/pantsbuild/pants/pull/5844/files/edcfcf1c2206aeab9e1398bd1b5a6252b9a00cbc#diff-23cdf27cceb5831fcb8c131fd37fe4cbR61 like
Does that make sense?
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.
Are you looking for the logic in ivy_subsystem.py ?
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.
@cheister ah yes, thanks!
Nit:
None
explicitly for?
that the logic is for option deprecation handling?
Other than that lgtm!
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 originally had
None
for the default but was told it was redundant and removed it.I also don't plan on deprecating
--cache-dir
, I think that will still be used most of the time when you don't want to share a cache between instances. I updated the documentation for the option to more closely describe how it works with ivy itself.