Skip to content

Commit

Permalink
guide: rewrite instructions of Shared Dev Server and
Browse files Browse the repository at this point in the history
add note about enabling all link types to close #429
  • Loading branch information
jorgeorpinel committed Aug 27, 2020
1 parent 7f44782 commit c293470
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion content/docs/command-reference/destroy.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ usage: dvc destroy [-h] [-q | -v] [-f]
directory from the <abbr>workspace</abbr>.

Note that the <abbr>cache directory</abbr> will be removed as well, unless it's
[set to an external location](/doc/use-cases/shared-development-server#configure-the-external-shared-cache)
[set to an external location](/doc/use-cases/shared-development-server#configure-the-shared-cache)
(by default a local cache is located in `.dvc/cache`). If you were using
[symlinks for linking](/doc/user-guide/large-dataset-optimization) data from the
cache, DVC will replace them with the latest versions of the actual files and
Expand Down
32 changes: 19 additions & 13 deletions content/docs/use-cases/shared-development-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ can write to it, and can read cached files owned by others.

> E.g. make all users members of a group that owns the shared cache directory.
You can skip this part if you are setting up a new DVC project where the local
<abbr>cache directory</abbr> (`.dvc/cache` by default), hasn't been used.
## Transfer existing cache (if any)

If you did work on the <abbr>DVC projects</abbr> previously and wish to transfer
its existing cache to the shared cache directory, you will simply need to move
its contents from the old location to the new one:
> Not needed for new DVC projects where the local cache hasn't been used.
For existing DVC projects to work on a new shared cache directory, first you'll
need to move their cache contents from the old location:

```dvc
$ mv .dvc/cache/* /home/shared/dvc-cache
Expand All @@ -52,26 +52,32 @@ $ sudo find /home/shared/dvc-cache -type f -exec chmod 0664 {} \;
$ sudo chown -R myuser:ourgroup /home/shared/dvc-cache/
```

## Configure the external shared cache
## Configure the shared cache

Tell DVC to use the directory we've set up above as the <abbr>cache</abbr> for
your <abbr>project</abbr>:
Tell DVC to use the directory we've set up above as _external
<abbr>cache</abbr>_ for your <abbr>project</abbr>:

```dvc
$ dvc cache dir /home/shared/dvc-cache
```

And tell DVC to set group permissions on newly created or downloaded cache
files:
And configure DVC to set group permissions on cached assets, and to enable all
[link types](/doc/user-guide/large-dataset-optimization#file-link-types-for-the-dvc-cache):

```dvc
$ dvc config cache.shared group
$ dvc config cache.type 'reflink,symlink,hardlink,copy'
```

> See `dvc cache dir` and `dvc config cache` for more information.
⚠️ Note that you cam't manually modify tracked data with the above `cache.type`
value. Soft/hard links are disabled by default for this reason, but are needed
for a reliable shared cache.

> See `dvc cache dir` and `dvc config cache` for more details on the above
> steps.
If you're using Git, commit changes to your project's config file (`.dvc/config`
by default):
If using Git, commit the changes to your project's configuration (in
`.dvc/config` by default):

```dvc
$ git add .dvc/config
Expand Down
2 changes: 1 addition & 1 deletion content/docs/user-guide/managing-external-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Currently, the following types (protocols) of external outputs (and
In order to specify an external output for a stage file, use the usual `-o` or
`-O` options of `dvc run`, but with the external path or URL to the file in
question. For <abbr>cached</abbr> external outputs (`-o`) you will need to
[setup an external cache](/doc/use-cases/shared-development-server#configure-the-external-shared-cache)
[setup an external cache](/doc/use-cases/shared-development-server#configure-the-shared-cache)
in the same external/remote file system first.

> Avoid using the same location of the
Expand Down

0 comments on commit c293470

Please sign in to comment.