-
Couldn't load subscription status.
- Fork 1.3k
remote: separate cloud remote and cloud cache classes #4019
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
Conversation
61b8acf to
d51da92
Compare
dvc/remote/local.py
Outdated
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.
Is this function needed? It looks like it was leftover from some old behavior, and is local only (not found in BaseRemote). It's still being tested in tests/func/test_data_cloud but I couldn't find anywhere else in DVC that it's actually used.
dvc/remote/base.py
Outdated
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.
Cloud cache is technically not an extension to cloud remote, since we define remote as the cloud push/pull mirror for a local .dvc MD5 checksum-based cache. However, cloud caches still need to implement the remote methods for size estimation and garbage collection (so that we can display progress during gc).
Originally, I had separate BaseCloud, RemoteMixin, CacheMixin, classes, but it seemed strange to have it like that if every cache class was always going to include the RemoteMixin methods. So for now all the cloud cache classes are implemented as an extension of a cloud remote class + the cache mixin.
d51da92 to
2a690a4
Compare
|
Will need rebase after #3991 is merged to resolve |
* makes RemoteTree and RepoTree consistent with regard to checksum calculation
* when tree is remote.tree, save will be a move + link operation (same as default existing behavior) * when saving path from a different tree, save will be a copy operation
2a690a4 to
f3a6a1e
Compare
|
|
||
| def _get(remote_conf): | ||
| for remote in REMOTES: | ||
| def _get(remote_conf, remotes, default): |
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.
@efiop I think cleaning this up to use tree.supported(...) will also require moving scheme and the remaining constants into the tree classes like we discussed. And then once we have single Remote and Cache classes that take a tree as a parameter, we'll be able to get rid of these helper methods.
I think it would be best to leave this as-is for now, and then handle it in the next PR
β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here. If the CLI API is changed, I have updated tab completion scripts.
β I will check DeepSource, CodeClimate, and other sanity checks below. (We consider them recommendatory and don't expect everything to be addressed. Please fix things that actually improve code or fix bugs.)
Thank you for the contribution - we'll try to review it as soon as possible. π
Related to #3882
S3Remote,S3Cache,LocalRemote,LocalCache, etc)get_checksumrelated functions are now moved into remote treescache.save()now takes an explicittreeparametertreeisremote.tree, save is done viamove()+link()treeintoremote.tree