-
Notifications
You must be signed in to change notification settings - Fork 394
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
Cloud versioning (initial guide and ref updates) #4165
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7accfe8
ref: document cloud versioned remotes
pmrowla e695ade
ref: document worktree update
pmrowla 72f7d11
review updates
pmrowla 1aa6109
add dev/experimental admon
pmrowla d28a41e
add links to/from import-url for cloud versioning
pmrowla a6b1fde
review fixes
pmrowla 8c148d0
Apply suggestions from code review
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
113 changes: 113 additions & 0 deletions
113
content/docs/user-guide/data-management/cloud-versioning.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Cloud Versioning | ||
|
||
<admon type="warn"> | ||
|
||
Cloud versioning features are currently under active development and should be | ||
considered experimental. These features are subject to frequent change, and the | ||
documentation may not always reflect changes available in the latest DVC | ||
release. | ||
|
||
</admon> | ||
|
||
When cloud versioning is enabled, DVC will store files in the remote according | ||
to their original directory location and filenames. Different versions of a file | ||
will then be stored as separate versions of the corresponding object in cloud | ||
storage. This is useful for cases where users prefer to retain their original | ||
filenames and directory hierarchy in remote storage (instead of using DVC's | ||
usual | ||
[content-addressable storage](/doc/user-guide/project-structure/internal-files#structure-of-the-cache-directory) | ||
format). | ||
|
||
<admon type="warn"> | ||
|
||
Note that not all DVC functionality is supported when using cloud versioned | ||
remotes, and using cloud versioning comes with the tradeoff of losing certain | ||
benefits of content-addressable storage. | ||
|
||
</admon> | ||
|
||
<details> | ||
|
||
### Expand for more details on the differences between cloud versioned and content-addressable storage | ||
|
||
`dvc remote` storage normally uses | ||
[content-addressable storage](/doc/user-guide/project-structure/internal-files#structure-of-the-cache-directory) | ||
to organize versioned data. Different versions of files are stored in the remote | ||
according to hash of their data content instead of according to their original | ||
filenames and directory location. This allows DVC to optimize certain remote | ||
storage lookup and data sync operations, and provides data de-duplication at the | ||
file level. However, this comes with the drawback of losing human-readable | ||
filenames without the use of the DVC CLI (`dvc get --show-url`) or API | ||
(`dvc.api.get_url()`). | ||
|
||
When using cloud versioning, DVC does not provide de-duplication, and certain | ||
remote storage performance optimizations will be unavailable. | ||
|
||
</details> | ||
|
||
## Supported storage providers | ||
|
||
Cloud versioning features are only avaible for certain storage providers. | ||
Currently, it is supported on the following `dvc remote` types: | ||
|
||
- Amazon S3 (requires | ||
[S3 Versioning](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html) | ||
enabled buckets) | ||
- Microsoft Azure Blob Storage (requires | ||
[Blob versioning](https://learn.microsoft.com/en-us/azure/storage/blobs/versioning-overview) | ||
enabled storage accounts and containers) | ||
- Google Cloud Storage (requires | ||
[Object versioning](https://cloud.google.com/storage/docs/object-versioning) | ||
enabled buckets) | ||
|
||
## Version-aware remotes | ||
|
||
When the `version_aware` option is enabled on a `dvc remote`: | ||
|
||
- `dvc push` will utilize cloud versioning when storing data in the remote. Data | ||
will retain its original directory structure and filenames, and each version | ||
of a file tracked by DVC will be stored as a new version of the corresponding | ||
object in cloud storage. | ||
- `dvc fetch` and `dvc pull` will download the corresponding version of an | ||
object from cloud storage. | ||
|
||
<admon type="warn"> | ||
|
||
Note that when `version_aware` is in use, DVC does not delete current versions | ||
or restore noncurrent versions of objects in cloud storage. So the current | ||
version of an object in cloud storage version of a file in your DVC repository. | ||
dberenbaum marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
</admon> | ||
|
||
## Worktree remotes | ||
|
||
`worktree` remotes behave similarly to `version_aware` remotes, but with one key | ||
difference. For `worktree` remotes, DVC will also attempt to ensure that the | ||
current version of objects in cloud storage match the latest versions of files | ||
in your DVC repository. | ||
|
||
So in addition to the command behaviors described for `version_aware` remotes, | ||
when the `worktree` option is enabled on a `dvc remote`: | ||
|
||
- `dvc push` will also ensure that the current version of objects in remote | ||
storage match the latest versions of files in your DVC repository repository. | ||
Additionally, DVC will delete the current version of any objects which were | ||
present in cloud storage but that do not exist in your current DVC repository | ||
workspace. | ||
- `dvc update` can be used to update a DVC-tracked file or directory in your DVC | ||
repository to match the current version of the corresponding object(s) from | ||
cloud storage. | ||
|
||
<admon type="info"> | ||
|
||
Note that deleting current versions in cloud storage does not delete any objects | ||
(and does not delete) any data). It only means that the current version of a | ||
dberenbaum marked this conversation as resolved.
Show resolved
Hide resolved
|
||
given object will show that the object does not exist. | ||
|
||
</admon> | ||
|
||
## Importing versioned data | ||
|
||
DVC supports importing cloud versioned data from supported storage providers. | ||
Refer to the documentation for `dvc import-url` and `dvc update` for more | ||
information. |
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.
What specific functionality is not available? The hidden section below only states that "DVC does not provide de-duplication, and certain remote storage performance optimizations will be unavailable".
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.
pretty much anything that isn't explicitly documented as a cloud-versioning-enabled command/feature
But off the top of my head, some of the things that don't work are:
dvc import
from a DVC repo that uses cloud versioned remote(s)gc -c
status -c
exp
sharing (anything that requiresexp push/pull
)dvc push
with revision flags (you cannotdvc push --all-branches/--all-tags/--all-commits
to cloud versioned remotes, butdvc pull
will work with the flags)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.
It may be worth it to rephrase this and other texts then, to emphasize that A LOT of features don't work with cloud versioned data remotes.