From 81a9e0a45ee7f42e1197722eca752bd91b179320 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 4 Feb 2020 16:30:18 +0200 Subject: [PATCH 1/2] add cache.shared config reference and use case Fixes #497 --- public/static/docs/command-reference/config.md | 7 +++++++ .../docs/use-cases/shared-development-server.md | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/public/static/docs/command-reference/config.md b/public/static/docs/command-reference/config.md index aeb88b1ea0..ba9e4ae094 100644 --- a/public/static/docs/command-reference/config.md +++ b/public/static/docs/command-reference/config.md @@ -152,6 +152,13 @@ for more details.) This section contains the following options: > These warnings are automatically turned off when `cache.type` is manually > set. +- `cache.shared` - permissions for newly created or downloaded cache files and + directories. The default permissions are `0o664`(rw-r--r--) for files and + `0o755`(rwxr-xr-x) for directories. The only accepted value right now is + `group`, which makes dvc use `0o664`(rw-rw-r--) for files and + `0o775`(rwxrwxr-x) for directories, which is useful when you are using a a + [shared development server](/doc/use-cases/shared-development-server). + - `cache.local` - name of a local remote to use as cache directory. (Refer to `dvc remote` for more information on "local remotes".) This will overwrite the value provided to `dvc config cache.dir` or `dvc cache dir`. diff --git a/public/static/docs/use-cases/shared-development-server.md b/public/static/docs/use-cases/shared-development-server.md index 6bbd866534..f1c357c779 100644 --- a/public/static/docs/use-cases/shared-development-server.md +++ b/public/static/docs/use-cases/shared-development-server.md @@ -37,6 +37,16 @@ to simply move it from an old cache location to the new one: $ mv .dvc/cache/* /path/to/dvc-cache ``` +Now you need to ensure that cache files/directories have appropriate +permissions, so that they could be accessed by your collegues that are members +of the same group: + +```dvc +$ sudo find /path/to/dvc-cache -type f -exec chmod 0664 {} \; +$ sudo find /path/to/dvc-cache -type d -exec chmod 0775 {} \; +$ sudo chown -R myuser:ourgroup /path/to/dvc-cache/ +``` + ## Configure shared cache Tell DVC to use the directory we've set up above as an shared cache location by @@ -46,6 +56,13 @@ running: $ dvc config cache.dir /path/to/dvc-cache ``` +And tell DVC to set group permissions on the newly created/downloaded cache +files: + +```dvc +$ dvc config cache.shared group +``` + Commit changes to `.dvc/config` and push them to your git remote: ```dvc From ebfc5a4328dfee177dce14d19f30fe2d808f7bd5 Mon Sep 17 00:00:00 2001 From: Ivan Shcheklein Date: Tue, 4 Feb 2020 07:25:10 -0800 Subject: [PATCH 2/2] Update config.md --- public/static/docs/command-reference/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/static/docs/command-reference/config.md b/public/static/docs/command-reference/config.md index ba9e4ae094..afbb836d36 100644 --- a/public/static/docs/command-reference/config.md +++ b/public/static/docs/command-reference/config.md @@ -155,7 +155,7 @@ for more details.) This section contains the following options: - `cache.shared` - permissions for newly created or downloaded cache files and directories. The default permissions are `0o664`(rw-r--r--) for files and `0o755`(rwxr-xr-x) for directories. The only accepted value right now is - `group`, which makes dvc use `0o664`(rw-rw-r--) for files and + `group`, which makes DVC use `0o664`(rw-rw-r--) for files and `0o775`(rwxrwxr-x) for directories, which is useful when you are using a a [shared development server](/doc/use-cases/shared-development-server).