From 015259f244523a68a1254dae0d0d4f3c1a446e7e Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Wed, 29 May 2019 16:37:28 -0500 Subject: [PATCH 1/9] Adds initial pkg and pgk-install cmd refs. WIP --- src/Documentation/sidebar.json | 3 ++ static/docs/commands-reference/cache.md | 2 +- static/docs/commands-reference/pkg.md | 25 +++++++++ static/docs/commands-reference/pkg_install.md | 51 +++++++++++++++++++ 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 static/docs/commands-reference/pkg.md create mode 100644 static/docs/commands-reference/pkg_install.md diff --git a/src/Documentation/sidebar.json b/src/Documentation/sidebar.json index 06d60fc747..3fa6c848e9 100644 --- a/src/Documentation/sidebar.json +++ b/src/Documentation/sidebar.json @@ -104,6 +104,7 @@ ], "move.md", ["pipeline.md", "pipeline_list.md", "pipeline_show.md"], + ["pkg.md", "pkg_install.md"], "push.md", "pull.md", [ @@ -157,6 +158,8 @@ "pipeline.md": "pipeline", "pipeline_list.md": "pipeline list", "pipeline_show.md": "pipeline show", + "pkg.md": "pkg", + "pkg_install.md": "pkg install", "destroy.md": "destroy", "unprotect.md": "unprotect", "cache.md": "cache", diff --git a/static/docs/commands-reference/cache.md b/static/docs/commands-reference/cache.md index 7c4420e231..5dcfd875af 100644 --- a/static/docs/commands-reference/cache.md +++ b/static/docs/commands-reference/cache.md @@ -38,7 +38,7 @@ different platforms.) ## Example The main use of this command is to apply the `-v` and `-q` options to -`dvc cache dir` which doesn't have them: +[dvc cache dir](/doc/commands-reference/cache-dir) which doesn't have them: ```dvc $ dvc cache --verbose dir mycache diff --git a/static/docs/commands-reference/pkg.md b/static/docs/commands-reference/pkg.md new file mode 100644 index 0000000000..b5fe4b27d7 --- /dev/null +++ b/static/docs/commands-reference/pkg.md @@ -0,0 +1,25 @@ +# pkg + +Contains a helper command to install a DVC package: +[install](/doc/commands-reference/pkg-install). + +## Synopsis + +```usage +usage: dvc pkg [-q | -v] {install} ... + +positional arguments: + {install} Use dvc pkg CMD --help for command-specific help. + install Install package. +``` + +## Description + +Manage DVC packages. See [dvc pkg install](/doc/commands-reference/pkg-install). + +## Options + +- `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if + no problems arise, otherwise 1. + +- `-v`, `--verbose` - displays detailed tracing information. diff --git a/static/docs/commands-reference/pkg_install.md b/static/docs/commands-reference/pkg_install.md new file mode 100644 index 0000000000..265ba96f60 --- /dev/null +++ b/static/docs/commands-reference/pkg_install.md @@ -0,0 +1,51 @@ +# pkg install + +Install a DVC package. + +## Synopsis + +```usage +usage: dvc pkg install [-h] [--global] [--system] [--local] [-q | -v] + [-s OUT] [-f FILE] + [address] [target] + +positional arguments: + address Package address: git:// or https://github.com/... + target Target directory to deploy package outputs. Default + value is the current dir. +``` + +## Description + +Install DVC package at `address`, deploying its outputs to the `target` +directory. + +## Options + +- `-s OUT`, `--select OUT` - Select and persist only specified outputs from a + package. The parameter can be used multiple times. All outputs will be + selected by default. + +- `-f FILE`, `--file FILE` - Specify name of the stage file. It should be either + 'Dvcfile' or have a '.dvc' suffix (e.g. 'prepare.dvc', 'clean.dvc', etc). By + default the file has 'mod\_' prefix and imported package name followed by .dvc + +- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead + of the project's `.dvc/config`. + +- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of + `.dvc/config`. + +- `--local` - modify a local config file instead of `.dvc/config`. It is located + in `.dvc/config.local` and is Git-ignored. This is useful when you need to + specify private config options in your config, that you don't want to track + and share through Git. + +- `-h`, `--help` - prints the usage/help message, and exit. + +- `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if + no problems arise, otherwise 1. + +- `-v`, `--verbose` - displays detailed tracing information. + +## Examples: ... From 87678fab13a279cf12105f5d9218c1532a3ddab9 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Thu, 30 May 2019 14:32:58 -0500 Subject: [PATCH 2/9] Removes accidental lose empty text files --- static/docs/commands-reference/cache | 0 static/docs/commands-reference/metrics | 0 static/docs/commands-reference/pipeline | 0 static/docs/commands-reference/remote | 0 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 static/docs/commands-reference/cache delete mode 100644 static/docs/commands-reference/metrics delete mode 100644 static/docs/commands-reference/pipeline delete mode 100644 static/docs/commands-reference/remote diff --git a/static/docs/commands-reference/cache b/static/docs/commands-reference/cache deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/static/docs/commands-reference/metrics b/static/docs/commands-reference/metrics deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/static/docs/commands-reference/pipeline b/static/docs/commands-reference/pipeline deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/static/docs/commands-reference/remote b/static/docs/commands-reference/remote deleted file mode 100644 index e69de29bb2..0000000000 From 7df0c64e48987badb0e855610d622f237d491129 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Thu, 30 May 2019 14:33:36 -0500 Subject: [PATCH 3/9] Adds note on credentials to `dvc remote modify` and other related cmd refs Per https://discordapp.com/channels/485586884165107732/485596304961962003/583696642197159946 --- static/docs/commands-reference/pkg.md | 4 +++- static/docs/commands-reference/remote_add.md | 21 +++++++++++-------- .../docs/commands-reference/remote_default.md | 7 ++++--- .../docs/commands-reference/remote_modify.md | 8 ++++++- .../docs/commands-reference/remote_remove.md | 2 +- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/static/docs/commands-reference/pkg.md b/static/docs/commands-reference/pkg.md index b5fe4b27d7..17ae0938c2 100644 --- a/static/docs/commands-reference/pkg.md +++ b/static/docs/commands-reference/pkg.md @@ -15,10 +15,12 @@ positional arguments: ## Description -Manage DVC packages. See [dvc pkg install](/doc/commands-reference/pkg-install). +Manage DVC packages. See `dvc pkg install`. ## Options +- `-h`, `--help` - prints the usage/help message, and exit. + - `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if no problems arise, otherwise 1. diff --git a/static/docs/commands-reference/remote_add.md b/static/docs/commands-reference/remote_add.md index 9c9f597018..29c2ec8d35 100644 --- a/static/docs/commands-reference/remote_add.md +++ b/static/docs/commands-reference/remote_add.md @@ -1,8 +1,9 @@ # remote add -Add a new data remote. Depending on your storage type you might need to run -`dvc remote modify` to provide credentials and/or configure other remote -parameters. +Add a new data remote. + +> Depending on your storage type, you may also need `dvc remote modify` to +> provide credentials and/or configure other remote parameters. See also [default](/doc/commands-reference/remote-default), [list](/doc/commands-reference/remote-list), @@ -76,6 +77,8 @@ Use `dvc config` to unset/change the default remote as so: - `-f`, `--force` - to overwrite existing remote with new `url` value. +## Examples +
### Click for a local remote example @@ -309,9 +312,9 @@ $ export OSS_ACCESS_KEY_SECRET='AccessKeySecret'
-## Examples +## Examples: Custom configuration of an S3 remote -Add AWS S3 _default_ (via `-d` option) remote and modify its region: +Add a AWS S3 remote as the _default_ (via `-d` option), and modify its region: ```dvc $ dvc remote add -d myremote s3://mybucket/myproject @@ -320,7 +323,7 @@ Setting 'myremote' as a default remote. $ dvc remote modify myremote region us-east-2 ``` -DVC config file would look like (run `cat .dvc/config`): +DVC config file (`.dvc/config`) now looks like this: ```ini ['remote "myremote"'] @@ -330,7 +333,7 @@ region = us-east-2 remote = myremote ``` -And list of remotes like this: +The list of remotes should now be: ```dvc $ dvc remote list @@ -338,13 +341,13 @@ $ dvc remote list myremote s3://mybucket/myproject ``` -You can overwrite existing remote using `-f` with `dvc remote add` as under: +You can overwrite existing remotes using `-f` with `dvc remote add`: ```dvc $ dvc remote add -f myremote s3://mybucket/mynewproject ``` -List remotes to view the updated remote: +List remotes again to view the updated remote: ```dvc $ dvc remote list diff --git a/static/docs/commands-reference/remote_default.md b/static/docs/commands-reference/remote_default.md index 9cdd4d481a..e4e6ce72fb 100644 --- a/static/docs/commands-reference/remote_default.md +++ b/static/docs/commands-reference/remote_default.md @@ -1,8 +1,9 @@ # remote default -To set/unset default data remote. Depending on your storage type you may need to -run `dvc remote modify` to provide credentials and/or configure other remote -parameters. +Set/unset a default data remote. + +> Depending on your storage type, you may also need `dvc remote modify` to +> provide credentials and/or configure other remote parameters. See also [add](/doc/commands-reference/remote-add), [list](/doc/commands-reference/remote-list), diff --git a/static/docs/commands-reference/remote_modify.md b/static/docs/commands-reference/remote_modify.md index 6d1325bf87..318896f07c 100644 --- a/static/docs/commands-reference/remote_modify.md +++ b/static/docs/commands-reference/remote_modify.md @@ -2,6 +2,10 @@ Modify remote settings. +> This command is commonly needed after `dvc remote add` or +> [default](/doc/commands-reference/remote-default) to setup credentials or +> other customizations to each remote type. + See also [add](/doc/commands-reference/remote-add), [default](/doc/commands-reference/remote-default), [list](/doc/commands-reference/remote-list), and @@ -46,6 +50,8 @@ This command modifies a section in the DVC config, that you don't want to track and share through Git (credentials, private locations, etc). +## Examples +
### Click for AWS S3 available options @@ -252,7 +258,7 @@ $ dvc remote modify myremote oss_endpoint endpoint
-## Examples +## Examples: Customize an S3 remote Let's first set up a _default_ S3 remote: diff --git a/static/docs/commands-reference/remote_remove.md b/static/docs/commands-reference/remote_remove.md index cb368b799b..9cdf7e627a 100644 --- a/static/docs/commands-reference/remote_remove.md +++ b/static/docs/commands-reference/remote_remove.md @@ -1,7 +1,7 @@ # remote remove Remove a specified remote. This command affects DVC configuration files only, it -does not physically remove your data files stored remotely. +does not physically remove data files stored remotely. See also [add](/doc/commands-reference/remote-add), [default](/doc/commands-reference/remote-default), From b45ead51a372a60c3f219b335c904ac399f4fb29 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Mon, 3 Jun 2019 13:46:01 -0500 Subject: [PATCH 4/9] Updates `dvc pkg install` cmd ref to current core dvc repo master behavior. --- static/docs/commands-reference/pkg.md | 3 ++ static/docs/commands-reference/pkg_install.md | 36 +++++++++++-------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/static/docs/commands-reference/pkg.md b/static/docs/commands-reference/pkg.md index 17ae0938c2..7373e4abb3 100644 --- a/static/docs/commands-reference/pkg.md +++ b/static/docs/commands-reference/pkg.md @@ -17,6 +17,9 @@ positional arguments: Manage DVC packages. See `dvc pkg install`. +Any DVC project can be used as a DVC package in order to reuse its data +artifacts in the current project workspace. + ## Options - `-h`, `--help` - prints the usage/help message, and exit. diff --git a/static/docs/commands-reference/pkg_install.md b/static/docs/commands-reference/pkg_install.md index 265ba96f60..4c863cf81e 100644 --- a/static/docs/commands-reference/pkg_install.md +++ b/static/docs/commands-reference/pkg_install.md @@ -1,6 +1,6 @@ # pkg install -Install a DVC package. +Install a DVC package. The command can be run only from a DVC project root. ## Synopsis @@ -17,8 +17,19 @@ positional arguments: ## Description -Install DVC package at `address`, deploying its outputs to the `target` -directory. +Any external DVC project stored in a Git repository at `address` can be +installed as a package in the current workspace. If no `target` directory is +specified, the repo name will be extracted from the `address` path and created +as a sub-directory of `dvc_mod/`. + +All the outputs of the package will be fetched into the local cache as well as +added to the workspace for further use. The `.gitignore` file will be updated to +include the `dvc_mod/` directory as well as all the aforementioned package +outputs. + +A DVC-file specifying all the outputs of the package will also be added to the +pipeline. Adding the `.gitignore` changes as well as the DVC-file to Git is +recommended at this point. ## Options @@ -30,17 +41,6 @@ directory. 'Dvcfile' or have a '.dvc' suffix (e.g. 'prepare.dvc', 'clean.dvc', etc). By default the file has 'mod\_' prefix and imported package name followed by .dvc -- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead - of the project's `.dvc/config`. - -- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of - `.dvc/config`. - -- `--local` - modify a local config file instead of `.dvc/config`. It is located - in `.dvc/config.local` and is Git-ignored. This is useful when you need to - specify private config options in your config, that you don't want to track - and share through Git. - - `-h`, `--help` - prints the usage/help message, and exit. - `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if @@ -49,3 +49,11 @@ directory. - `-v`, `--verbose` - displays detailed tracing information. ## Examples: ... + +Having: DVC package in https://github.com/dmpetrov/tag_classifier + +```dvc +$ dvc pkg install https://github.com/dmpetrov/tag_classifier +``` + +Result: `tag_classifier` package in `dvc_mod/` directory From 142a2d2429450da9fde5b2d19b48484e3b19e81d Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Mon, 3 Jun 2019 18:49:31 -0500 Subject: [PATCH 5/9] WIP: Adds 4/6 `dvc pkg` subcommand ref files. --- src/Documentation/sidebar.json | 17 ++++++++- static/docs/commands-reference/pkg.md | 24 +++++++++--- static/docs/commands-reference/pkg_add.md | 38 +++++++++++++++++++ static/docs/commands-reference/pkg_install.md | 33 ++++++++-------- static/docs/commands-reference/pkg_remove.md | 38 +++++++++++++++++++ .../docs/commands-reference/pkg_uninstall.md | 37 ++++++++++++++++++ 6 files changed, 164 insertions(+), 23 deletions(-) create mode 100644 static/docs/commands-reference/pkg_add.md create mode 100644 static/docs/commands-reference/pkg_remove.md create mode 100644 static/docs/commands-reference/pkg_uninstall.md diff --git a/src/Documentation/sidebar.json b/src/Documentation/sidebar.json index 3fa6c848e9..490b28539e 100644 --- a/src/Documentation/sidebar.json +++ b/src/Documentation/sidebar.json @@ -104,7 +104,16 @@ ], "move.md", ["pipeline.md", "pipeline_list.md", "pipeline_show.md"], - ["pkg.md", "pkg_install.md"], + [ + "pkg.md", + "pkg_install.md", + "pkg_uninstall.md", + "pkg_add.md", + "pkg_remove.md", + "pkg_modify.md", + "pkg_list.md", + "pkg_import.md" + ], "push.md", "pull.md", [ @@ -160,6 +169,12 @@ "pipeline_show.md": "pipeline show", "pkg.md": "pkg", "pkg_install.md": "pkg install", + "pkg_uninstall.md": "pkg uninstall", + "pkg_add.md": "pkg add", + "pkg_remove.md": "pkg remove", + "pkg_modify.md": "pkg modify", + "pkg_list.md": "pkg list", + "pkg_import.md": "pkg import", "destroy.md": "destroy", "unprotect.md": "unprotect", "cache.md": "cache", diff --git a/static/docs/commands-reference/pkg.md b/static/docs/commands-reference/pkg.md index 7373e4abb3..f11067c982 100644 --- a/static/docs/commands-reference/pkg.md +++ b/static/docs/commands-reference/pkg.md @@ -1,16 +1,30 @@ # pkg -Contains a helper command to install a DVC package: -[install](/doc/commands-reference/pkg-install). +A set of commands to to manage DVC packages: +[install](/doc/commands-reference/pkg-install), +[uninstall](/doc/commands-reference/pkg-uninstall), +[add](/doc/commands-reference/pkg-add), +[remove](/doc/commands-reference/pkg-remove), +[modify](/doc/commands-reference/pkg-modify), +[list](/doc/commands-reference/pkg-list), +[import](/doc/commands-reference/pkg-import) ## Synopsis ```usage -usage: dvc pkg [-q | -v] {install} ... +usage: dvc pkg [-h | -q | -v] + {install,uninstall,add,remove,modify,list,import} ... positional arguments: - {install} Use dvc pkg CMD --help for command-specific help. - install Install package. + {install,uninstall,add,remove,modify,list,import} + Use dvc pkg CMD --help for command-specific help. + install Install package(s). + uninstall Uninstall package(s). + add Add package. + remove Remove package. + modify Modify package. + list List packages. + import Import data from package. ``` ## Description diff --git a/static/docs/commands-reference/pkg_add.md b/static/docs/commands-reference/pkg_add.md new file mode 100644 index 0000000000..31521e53a1 --- /dev/null +++ b/static/docs/commands-reference/pkg_add.md @@ -0,0 +1,38 @@ +# pkg add + +Add package. The package is registered in the DVC project configuration. + +## Synopsis + +```usage +usage: dvc pkg add [-h] [--global] [--system] [--local] [-q | -v] + name url + +positional arguments: + name Package name. + url Package URL. +``` + +## Description + +... + +## Options + +- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead + of the project's `.dvc/config`. + +- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of + `.dvc/config`. + +- `--local` - modify a local config file instead of `.dvc/config`. It is located + in `.dvc/config.local` and is Git-ignored. This is useful when you need to + specify private config options in your config, that you don't want to track + and share through Git. + +- `-h`, `--help` - prints the usage/help message, and exit. + +- `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if + no problems arise, otherwise 1. + +- `-v`, `--verbose` - displays detailed tracing information. diff --git a/static/docs/commands-reference/pkg_install.md b/static/docs/commands-reference/pkg_install.md index 4c863cf81e..f6703c26f2 100644 --- a/static/docs/commands-reference/pkg_install.md +++ b/static/docs/commands-reference/pkg_install.md @@ -1,26 +1,22 @@ # pkg install -Install a DVC package. The command can be run only from a DVC project root. +Install DVC package(s). ## Synopsis ```usage usage: dvc pkg install [-h] [--global] [--system] [--local] [-q | -v] - [-s OUT] [-f FILE] - [address] [target] + [targets [targets ...]] positional arguments: - address Package address: git:// or https://github.com/... - target Target directory to deploy package outputs. Default - value is the current dir. + targets Package name. ``` ## Description -Any external DVC project stored in a Git repository at `address` can be -installed as a package in the current workspace. If no `target` directory is -specified, the repo name will be extracted from the `address` path and created -as a sub-directory of `dvc_mod/`. +Any external DVC project stored in a Git repository can be installed as a +package in the current workspace. The package name (`target`) will be created as +a sub-directory of `dvc_mod/`. All the outputs of the package will be fetched into the local cache as well as added to the workspace for further use. The `.gitignore` file will be updated to @@ -33,13 +29,16 @@ recommended at this point. ## Options -- `-s OUT`, `--select OUT` - Select and persist only specified outputs from a - package. The parameter can be used multiple times. All outputs will be - selected by default. +- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead + of the project's `.dvc/config`. -- `-f FILE`, `--file FILE` - Specify name of the stage file. It should be either - 'Dvcfile' or have a '.dvc' suffix (e.g. 'prepare.dvc', 'clean.dvc', etc). By - default the file has 'mod\_' prefix and imported package name followed by .dvc +- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of + `.dvc/config`. + +- `--local` - modify a local config file instead of `.dvc/config`. It is located + in `.dvc/config.local` and is Git-ignored. This is useful when you need to + specify private config options in your config, that you don't want to track + and share through Git. - `-h`, `--help` - prints the usage/help message, and exit. @@ -48,7 +47,7 @@ recommended at this point. - `-v`, `--verbose` - displays detailed tracing information. -## Examples: ... +## Example Having: DVC package in https://github.com/dmpetrov/tag_classifier diff --git a/static/docs/commands-reference/pkg_remove.md b/static/docs/commands-reference/pkg_remove.md new file mode 100644 index 0000000000..11e8295a7c --- /dev/null +++ b/static/docs/commands-reference/pkg_remove.md @@ -0,0 +1,38 @@ +# pkg remove + +Remove package. Undoes the [adding](/doc/commands-reference/pkg-add) of a +package. + +## Synopsis + +```usage +usage: dvc pkg remove [-h] [--global] [--system] [--local] [-q | -v] + name + +positional arguments: + name Package name. +``` + +## Description + +... + +## Options + +- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead + of the project's `.dvc/config`. + +- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of + `.dvc/config`. + +- `--local` - modify a local config file instead of `.dvc/config`. It is located + in `.dvc/config.local` and is Git-ignored. This is useful when you need to + specify private config options in your config, that you don't want to track + and share through Git. + +- `-h`, `--help` - prints the usage/help message, and exit. + +- `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if + no problems arise, otherwise 1. + +- `-v`, `--verbose` - displays detailed tracing information. diff --git a/static/docs/commands-reference/pkg_uninstall.md b/static/docs/commands-reference/pkg_uninstall.md new file mode 100644 index 0000000000..1f67febc04 --- /dev/null +++ b/static/docs/commands-reference/pkg_uninstall.md @@ -0,0 +1,37 @@ +# pkg uninstall + +Uninstall DVC package(s). + +## Synopsis + +```usage +usage: dvc pkg uninstall [-h] [--global] [--system] [--local] [-q | -v] + [targets [targets ...]] + +positional arguments: + targets Package name. +``` + +## Description + +... + +## Options + +- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead + of the project's `.dvc/config`. + +- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of + `.dvc/config`. + +- `--local` - modify a local config file instead of `.dvc/config`. It is located + in `.dvc/config.local` and is Git-ignored. This is useful when you need to + specify private config options in your config, that you don't want to track + and share through Git. + +- `-h`, `--help` - prints the usage/help message, and exit. + +- `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if + no problems arise, otherwise 1. + +- `-v`, `--verbose` - displays detailed tracing information. From 2f4cb7241b569f024afa1c430574586f974d6785 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Tue, 4 Jun 2019 01:11:07 -0500 Subject: [PATCH 6/9] First complete version of initial 4 pkg subcommands. --- static/docs/commands-reference/config.md | 6 ++ static/docs/commands-reference/pkg.md | 4 +- static/docs/commands-reference/pkg_add.md | 36 ++++++++- static/docs/commands-reference/pkg_install.md | 81 +++++++++++++------ static/docs/commands-reference/pkg_remove.md | 35 +++++++- .../docs/commands-reference/pkg_uninstall.md | 31 ++++--- 6 files changed, 150 insertions(+), 43 deletions(-) diff --git a/static/docs/commands-reference/config.md b/static/docs/commands-reference/config.md index d5eed01f6d..b3456203fa 100644 --- a/static/docs/commands-reference/config.md +++ b/static/docs/commands-reference/config.md @@ -168,6 +168,12 @@ more about the state file that is used for optimization. so that when it needs to cleanup the database it could sort them by the timestamp and remove the oldest ones. Default quota is set to 50(percent). +### pkg + +These are sections in the config file that describe specific +[DVC packages](/doc/commands-reference/pkg). These sections contain the `url` +and `_cwd` keys, which values are used internally by the `dvc pkg` commands. + ## Examples: Core config options Set the `dvc` log level to `debug`: diff --git a/static/docs/commands-reference/pkg.md b/static/docs/commands-reference/pkg.md index f11067c982..b469e14157 100644 --- a/static/docs/commands-reference/pkg.md +++ b/static/docs/commands-reference/pkg.md @@ -31,8 +31,8 @@ positional arguments: Manage DVC packages. See `dvc pkg install`. -Any DVC project can be used as a DVC package in order to reuse its data -artifacts in the current project workspace. +Any DVC project can be used as a DVC package in order to reuse its code, stages, +and related data artifacts in the current project workspace. ## Options diff --git a/static/docs/commands-reference/pkg_add.md b/static/docs/commands-reference/pkg_add.md index 31521e53a1..979476826d 100644 --- a/static/docs/commands-reference/pkg_add.md +++ b/static/docs/commands-reference/pkg_add.md @@ -1,6 +1,6 @@ # pkg add -Add package. The package is registered in the DVC project configuration. +Add a DVC package. The package is registered in the DVC project configuration. ## Synopsis @@ -15,7 +15,24 @@ positional arguments: ## Description -... +Any DVC project can be used as a DVC package in order to reuse its code, stages, +and related data artifacts in the current project workspace. + +Add expects a `name` to identify the package configuration in this DVC project. +Such name can be any valid continuous alphanumeric string like `my-pkg_name.0`. +If the name is already registered (check with `dvc pkg list`), the package `url` +is overwritten. + +A valid `url` should be either an HTTP or SSH Git repository address such as +`https://github.com/iterative/example-get-started` or +`git@github.com:iterative/example-get-started.git` respectively – corresponding +to our sample [get started](/doc/get-started) DVC project. Note that +`dvc pkg add` does NOT validate the URL at this stage, however inexistent or +unreachable addresses will result in a failure of `dvc pkg install`. + +Adding a package registers it in the DVC config file (typically in `.dvc/config` +– see `dvc config`). Note that nothing is downloaded from the package URL. (Use +`dvc pkg install` or `dvc pkg import` to actually get files from the package). ## Options @@ -36,3 +53,18 @@ positional arguments: no problems arise, otherwise 1. - `-v`, `--verbose` - displays detailed tracing information. + +## Example + +```dvc +$ dvc pkg add get-started https://github.com/iterative/example-get-started +``` + +Results in the DVC config file (typically `.dvc/config`) being appended a `pkg` +section like: + +```ini +['pkg "get-started"'] +url = https://github.com/iterative/example-get-started +_cwd = /Users/username/dvcproject/.dvc +``` diff --git a/static/docs/commands-reference/pkg_install.md b/static/docs/commands-reference/pkg_install.md index f6703c26f2..fa2b262027 100644 --- a/static/docs/commands-reference/pkg_install.md +++ b/static/docs/commands-reference/pkg_install.md @@ -14,31 +14,25 @@ positional arguments: ## Description -Any external DVC project stored in a Git repository can be installed as a -package in the current workspace. The package name (`target`) will be created as -a sub-directory of `dvc_mod/`. +Any DVC project can be used as a DVC package in order to reuse its code, stages, +and related data artifacts in the current project workspace. -All the outputs of the package will be fetched into the local cache as well as -added to the workspace for further use. The `.gitignore` file will be updated to -include the `dvc_mod/` directory as well as all the aforementioned package -outputs. +When installing a package, the provided name(s) (`targets`) can be previously +registered with `dvc pkg add`. Each name will be created as a subdirectory of +`.dvc/pkg/`, where the corresponding package source files (code and stage files) +will be placed. (`.dvc/pkg/` will be added to the `.dvc/.gitignore` file if +needed.) All the outputs in the package pipelines will be also downloaded from +the default remotes into the locally installed package directory. -A DVC-file specifying all the outputs of the package will also be added to the -pipeline. Adding the `.gitignore` changes as well as the DVC-file to Git is -recommended at this point. +The provided `targets` may also be URLs to the HTTP location of the DVC +packages, in that case, the implicit package name will be extracted from the +given HTTP address and used for the subdirectory of `.dvc/pkg/` as explained in +the previous paragraph. -## Options - -- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead - of the project's `.dvc/config`. +> Note that installing packages with implicit names does NOT add them to the +> config file. -- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of - `.dvc/config`. - -- `--local` - modify a local config file instead of `.dvc/config`. It is located - in `.dvc/config.local` and is Git-ignored. This is useful when you need to - specify private config options in your config, that you don't want to track - and share through Git. +## Options - `-h`, `--help` - prints the usage/help message, and exit. @@ -47,12 +41,49 @@ recommended at this point. - `-v`, `--verbose` - displays detailed tracing information. -## Example +## Examples: With an implicit package name + +Having a DVC project in https://github.com/iterative/example-get-started + +```dvc +$ dvc pkg install https://github.com/iterative/example-get-started +... +``` + +The result is the `example-get-started` package fully installed in the +`.dvc/pkg/` directory. + +```dvc +$ tree .dvc/pkg +.dvc/pkg +└── example-get-started + ├── README.md + ├── auc.metric + ├── data + │   └── data.xml.dvc + ├── evaluate.dvc + ├── featurize.dvc + ├── prepare.dvc + ├── requirements.txt + ├── src + │   ├── evaluate.py + │   ├── featurization.py + │   ├── prepare.py + │   └── train.py + └── train.dvc +``` + +## Examples: Having added the package first -Having: DVC package in https://github.com/dmpetrov/tag_classifier +Having the same DVC project in https://github.com/iterative/example-get-started +as in the previous example: ```dvc -$ dvc pkg install https://github.com/dmpetrov/tag_classifier +$ dvc pkg add https://github.com/iterative/example-get-started +$ dvc pkg install example-get-started +... ``` -Result: `tag_classifier` package in `dvc_mod/` directory +Same result as the previous example, except that additionally, the DVC config +file (typically `.dvc/config` will contain a `['pkg "example-get-started"']` +section due to the `dvc pkg add` command above. diff --git a/static/docs/commands-reference/pkg_remove.md b/static/docs/commands-reference/pkg_remove.md index 11e8295a7c..87216e5673 100644 --- a/static/docs/commands-reference/pkg_remove.md +++ b/static/docs/commands-reference/pkg_remove.md @@ -1,6 +1,6 @@ # pkg remove -Remove package. Undoes the [adding](/doc/commands-reference/pkg-add) of a +Remove a DVC package. Undoes the [adding](/doc/commands-reference/pkg-add) of a package. ## Synopsis @@ -15,7 +15,20 @@ positional arguments: ## Description -... +The `name` of the package must have been previously registered with the +[add](/doc/commands-reference/pkg-add) or +[install](/doc/commands-reference/pkg-install) commands previously. + +> Keep in mind that the use of this command should match the cache location +> options used at the time of adding the package +> (`[--global] [--system] [--local]`). + +This command removes the package from the DVC config file (typically in +`.dvc/config`). It does NOT remove any files that may have been downloaded by +`dvc pkg install`. (See `dvc pkg uninstall` for that purpose.) + +> Try not to remove a package before its uninstalled, as the `.dvc/pkg/` folder +> may end up with directories that have to be removed manually. ## Options @@ -36,3 +49,21 @@ positional arguments: no problems arise, otherwise 1. - `-v`, `--verbose` - displays detailed tracing information. + +## Example + +Having the `get-started` package added in the example of `dvc pkg add`: + +```dvc +$ dvc pkg list +get-started https://github.com/iterative/example-get-started +``` + +The following command deletes the `pkg` section for the `get-started` package +from the DVC config file: + +```dvc +$ dvc pkg remove get-started https://github.com/iterative/example-get-started +``` + +(Try `cat .dvc/config` to confirm.) diff --git a/static/docs/commands-reference/pkg_uninstall.md b/static/docs/commands-reference/pkg_uninstall.md index 1f67febc04..a192d53428 100644 --- a/static/docs/commands-reference/pkg_uninstall.md +++ b/static/docs/commands-reference/pkg_uninstall.md @@ -14,20 +14,13 @@ positional arguments: ## Description -... +Provided package directory name(s) (`targets`) will be searched for in the +`.dvc/pkg/` directory and completely removed if found. -## Options - -- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead - of the project's `.dvc/config`. - -- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of - `.dvc/config`. +> Note that this command does NOT remove the package records from the DVC config +> file. See `dvc pkg remove` for that purpose. -- `--local` - modify a local config file instead of `.dvc/config`. It is located - in `.dvc/config.local` and is Git-ignored. This is useful when you need to - specify private config options in your config, that you don't want to track - and share through Git. +## Options - `-h`, `--help` - prints the usage/help message, and exit. @@ -35,3 +28,17 @@ positional arguments: no problems arise, otherwise 1. - `-v`, `--verbose` - displays detailed tracing information. + +## Example + +Having installed the `example-get-started` package from the example in +`dvc pkg install`: + +```dvc +$ ls -l .dvc/pkg/ +example-get-started +$ dvc pkg uninstall example-get-started +``` + +Results in the `.dvc/pkg/example-get-started/` directory being completely +removed. From e70988c430aadcfb5fd73af34f0912816bc8c818 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Tue, 4 Jun 2019 12:12:15 -0500 Subject: [PATCH 7/9] Update to first 4 pkg commads per efiop/pkgs branch From upstream git@github.com:efiop/dvc.git For #385 --- static/docs/commands-reference/config.md | 2 +- static/docs/commands-reference/pkg_add.md | 23 +++++++++++-------- static/docs/commands-reference/pkg_install.md | 11 ++++----- .../docs/commands-reference/pkg_uninstall.md | 3 +-- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/static/docs/commands-reference/config.md b/static/docs/commands-reference/config.md index b3456203fa..1e784bf525 100644 --- a/static/docs/commands-reference/config.md +++ b/static/docs/commands-reference/config.md @@ -15,7 +15,7 @@ positional arguments: You can query/set/replace/unset DVC configuration options with this command. It takes a config option `name` (a section and a key, separated by a dot) and its -`value`. +`value` (any valid alpha-numeric string generally). This command reads and overwrites the DVC config file `.dvc/config`. If `--local` option is specified, `.dvc/config.local` is modified instead. diff --git a/static/docs/commands-reference/pkg_add.md b/static/docs/commands-reference/pkg_add.md index 979476826d..6b3eaabb51 100644 --- a/static/docs/commands-reference/pkg_add.md +++ b/static/docs/commands-reference/pkg_add.md @@ -5,8 +5,8 @@ Add a DVC package. The package is registered in the DVC project configuration. ## Synopsis ```usage -usage: dvc pkg add [-h] [--global] [--system] [--local] [-q | -v] - name url +usage: dvc pkg add [-h] [--global] [--system] [--local] [-q | -v] [-f] + [name] url positional arguments: name Package name. @@ -18,17 +18,20 @@ positional arguments: Any DVC project can be used as a DVC package in order to reuse its code, stages, and related data artifacts in the current project workspace. -Add expects a `name` to identify the package configuration in this DVC project. -Such name can be any valid continuous alphanumeric string like `my-pkg_name.0`. -If the name is already registered (check with `dvc pkg list`), the package `url` -is overwritten. - A valid `url` should be either an HTTP or SSH Git repository address such as `https://github.com/iterative/example-get-started` or `git@github.com:iterative/example-get-started.git` respectively – corresponding to our sample [get started](/doc/get-started) DVC project. Note that -`dvc pkg add` does NOT validate the URL at this stage, however inexistent or -unreachable addresses will result in a failure of `dvc pkg install`. +`dvc pkg add` does NOT validate the URL at this point, however inexistent or +unreachable addresses will result in a failure of the package +[install](/doc/commands-reference/pkg-install) and +[import](/doc/commands-reference/pkg-import) commands. + +A `name` is required to identify the package configuration in the DVC project. +Such name can be any valid continuous alpha-numeric string like `my-pkg_name`. +However, the `name` argument is optional as it can be extracted from the `url` +path. If the name is already registered (check with `dvc pkg list`), the package +`url` is overwritten. Adding a package registers it in the DVC config file (typically in `.dvc/config` – see `dvc config`). Note that nothing is downloaded from the package URL. (Use @@ -36,6 +39,8 @@ Adding a package registers it in the DVC config file (typically in `.dvc/config` ## Options +- `-f`, `--force` - to overwrite existing package with new `url` value. + - `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead of the project's `.dvc/config`. diff --git a/static/docs/commands-reference/pkg_install.md b/static/docs/commands-reference/pkg_install.md index fa2b262027..8762f480f7 100644 --- a/static/docs/commands-reference/pkg_install.md +++ b/static/docs/commands-reference/pkg_install.md @@ -5,8 +5,7 @@ Install DVC package(s). ## Synopsis ```usage -usage: dvc pkg install [-h] [--global] [--system] [--local] [-q | -v] - [targets [targets ...]] +usage: dvc pkg install [-h] [-q | -v] [targets [targets ...]] positional arguments: targets Package name. @@ -24,10 +23,10 @@ will be placed. (`.dvc/pkg/` will be added to the `.dvc/.gitignore` file if needed.) All the outputs in the package pipelines will be also downloaded from the default remotes into the locally installed package directory. -The provided `targets` may also be URLs to the HTTP location of the DVC -packages, in that case, the implicit package name will be extracted from the -given HTTP address and used for the subdirectory of `.dvc/pkg/` as explained in -the previous paragraph. +The provided `targets` may also be URLs to the location of the DVC packages +(same as `url` in `dvc pkg add`), in that case, the implicit package name will +be extracted from the given address and used for the subdirectory of `.dvc/pkg/` +as explained in the previous paragraph. > Note that installing packages with implicit names does NOT add them to the > config file. diff --git a/static/docs/commands-reference/pkg_uninstall.md b/static/docs/commands-reference/pkg_uninstall.md index a192d53428..2c13624729 100644 --- a/static/docs/commands-reference/pkg_uninstall.md +++ b/static/docs/commands-reference/pkg_uninstall.md @@ -5,8 +5,7 @@ Uninstall DVC package(s). ## Synopsis ```usage -usage: dvc pkg uninstall [-h] [--global] [--system] [--local] [-q | -v] - [targets [targets ...]] +usage: dvc pkg uninstall [-h] [-q | -v] [targets [targets ...]] positional arguments: targets Package name. From 0e3f11ba314595c71bb039057d613f78cdda892f Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Tue, 4 Jun 2019 20:57:20 -0500 Subject: [PATCH 8/9] Finish all pkg file up to current dev version (See https://github.com/efiop/dvc/tree/pkgs) - Update a few usages in first 4 commands - Link all commands together in their intros - Add list, modify, and import with basic examples - Related changes in `cache dir` and `remote modify` cmd refs For #385 --- static/docs/commands-reference/cache_dir.md | 3 +- static/docs/commands-reference/pkg.md | 4 +- static/docs/commands-reference/pkg_add.md | 7 ++ static/docs/commands-reference/pkg_import.md | 104 ++++++++++++++++++ static/docs/commands-reference/pkg_install.md | 12 +- static/docs/commands-reference/pkg_list.md | 51 +++++++++ static/docs/commands-reference/pkg_modify.md | 64 +++++++++++ static/docs/commands-reference/pkg_remove.md | 7 ++ .../docs/commands-reference/pkg_uninstall.md | 7 ++ .../docs/commands-reference/remote_modify.md | 10 +- 10 files changed, 258 insertions(+), 11 deletions(-) create mode 100644 static/docs/commands-reference/pkg_import.md create mode 100644 static/docs/commands-reference/pkg_list.md create mode 100644 static/docs/commands-reference/pkg_modify.md diff --git a/static/docs/commands-reference/cache_dir.md b/static/docs/commands-reference/cache_dir.md index a784779afa..0a27a53305 100644 --- a/static/docs/commands-reference/cache_dir.md +++ b/static/docs/commands-reference/cache_dir.md @@ -33,7 +33,8 @@ file, as they are expected in the config file. specify private config options in your config, that you don't want to track and share through Git. -- `-u`, `--unset` - remove a specified config option from a config file. +- `-u`, `--unset` - remove the `cache.dir` config option from the config file. + Don't provide a `value` when using this flag. - `-h`, `--help` - prints the usage/help message, and exit. diff --git a/static/docs/commands-reference/pkg.md b/static/docs/commands-reference/pkg.md index b469e14157..06bd883714 100644 --- a/static/docs/commands-reference/pkg.md +++ b/static/docs/commands-reference/pkg.md @@ -6,8 +6,8 @@ A set of commands to to manage DVC packages: [add](/doc/commands-reference/pkg-add), [remove](/doc/commands-reference/pkg-remove), [modify](/doc/commands-reference/pkg-modify), -[list](/doc/commands-reference/pkg-list), -[import](/doc/commands-reference/pkg-import) +[list](/doc/commands-reference/pkg-list), and +[import](/doc/commands-reference/pkg-import). ## Synopsis diff --git a/static/docs/commands-reference/pkg_add.md b/static/docs/commands-reference/pkg_add.md index 6b3eaabb51..dfb5f47197 100644 --- a/static/docs/commands-reference/pkg_add.md +++ b/static/docs/commands-reference/pkg_add.md @@ -2,6 +2,13 @@ Add a DVC package. The package is registered in the DVC project configuration. +See also [install](/doc/commands-reference/pkg-install), +[uninstall](/doc/commands-reference/pkg-uninstall), +[remove](/doc/commands-reference/pkg-remove), +[modify](/doc/commands-reference/pkg-modify), +[list](/doc/commands-reference/pkg-list), and +[import](/doc/commands-reference/pkg-import). + ## Synopsis ```usage diff --git a/static/docs/commands-reference/pkg_import.md b/static/docs/commands-reference/pkg_import.md new file mode 100644 index 0000000000..6e37f2d58c --- /dev/null +++ b/static/docs/commands-reference/pkg_import.md @@ -0,0 +1,104 @@ +# pkg import + +Import a data artifact from a DVC package. + +See also [uninstall](/doc/commands-reference/pkg-uninstall), +[add](/doc/commands-reference/pkg-add), +[remove](/doc/commands-reference/pkg-remove), +[modify](/doc/commands-reference/pkg-modify), +[list](/doc/commands-reference/pkg-list), and +[import](/doc/commands-reference/pkg-import). + +## Synopsis + +```usage +usage: dvc pkg import [-h] [-q | -v] pkg_name pkg_path [out] + +positional arguments: + pkg_name Package name. + pkg_path Path to data in the package. + out Destination path to put data to. +``` + +## Description + +Any DVC project can be used as a DVC package in order to reuse its code, stages, +and related data artifacts in the current project workspace. + +When importing data from a package, the provided name (`pkg_name`) can be +previously registered with `dvc pkg add`. The first thing that this command does +is to install the package in `.dvc/pkg/{pkg_name}`. (See `dvc pkg install` for +more details.) + +The provided name (`pkg_name`) may also be the URL to the location of the DVC +package (same as `url` in `dvc pkg add`), in that case, the implicit package +name will be extracted from the given address and used for the package +installation. + +> Note that like with installing, importing data from a package with implicit +> names does NOT add the package to the config file. + +`pkg_path` is the path to the data artifact in the package after its `url` root +`/`, such as `scripts/innosetup/dvc.ico` (see [example](#example) below). A data +artifact is any one output defined in a DVC-file in the package. Note that since +these data artifacts are controlled by DVC and not by the SCM system (e.g. Git), +they can't be found by browsing the code repository. This command has to read +the package configuration to connect to a remote of that project in order to +fetch the data file to the local cache, and "check it out" (see `dvc checkout`) +it to the current project's workspace. + +Data artifacts are placed in the current working directory with the same file +name as the original output from the package. To use custom path and file name +instead, and optional `out` argument can be used with this command. + +Finally, the data import process creates a DVC-file in the same location as the +imported data, specifying the package dependency for the imported data similar +as to having added the imported data with `dvc add`. This way `dvc repro` will +be able to reproduce the import operation as a regular stage in this project's +pipeline. + +## Options + +- `-h`, `--help` - prints the usage/help message, and exit. + +- `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if + no problems arise, otherwise 1. + +- `-v`, `--verbose` - displays detailed tracing information. + +# Example + +```dvc +$ mkdir import && cd import +$ dvc pkg import https://github.com/iterative/dvc scripts/innosetup/dvc.ico +Preparing to collect status from https://dvc.org/s3/dvc +... +``` + +Will find the `dvc.ico` file in the output of a stage file in the +https://github.com/iterative/dvc package and import it into the current working +dir (`import/`). + +```dvc +$ ls +dvc.ico dvc.ico.dvc +``` + +The `dvc.ico.dvc` file contents should look something like: + +```ini +md5: 7aac042f559753a470723d44b2384a61 +wdir: . +deps: +- md5: 90104d9e83cfb825cf45507e90aadd27 + path: scripts/innosetup/dvc.ico + pkg: + name: dvc + url: https://github.com/iterative/dvc +outs: +- md5: 90104d9e83cfb825cf45507e90aadd27 + path: dvc.ico + cache: true + metric: false + persist: false +``` diff --git a/static/docs/commands-reference/pkg_install.md b/static/docs/commands-reference/pkg_install.md index 8762f480f7..99b71a6c0e 100644 --- a/static/docs/commands-reference/pkg_install.md +++ b/static/docs/commands-reference/pkg_install.md @@ -2,6 +2,13 @@ Install DVC package(s). +See also [uninstall](/doc/commands-reference/pkg-uninstall), +[add](/doc/commands-reference/pkg-add), +[remove](/doc/commands-reference/pkg-remove), +[modify](/doc/commands-reference/pkg-modify), +[list](/doc/commands-reference/pkg-list), and +[import](/doc/commands-reference/pkg-import). + ## Synopsis ```usage @@ -18,10 +25,9 @@ and related data artifacts in the current project workspace. When installing a package, the provided name(s) (`targets`) can be previously registered with `dvc pkg add`. Each name will be created as a subdirectory of -`.dvc/pkg/`, where the corresponding package source files (code and stage files) +`.dvc/pkg/`, where the corresponding package source files (code and DVC-files) will be placed. (`.dvc/pkg/` will be added to the `.dvc/.gitignore` file if -needed.) All the outputs in the package pipelines will be also downloaded from -the default remotes into the locally installed package directory. +needed.) The provided `targets` may also be URLs to the location of the DVC packages (same as `url` in `dvc pkg add`), in that case, the implicit package name will diff --git a/static/docs/commands-reference/pkg_list.md b/static/docs/commands-reference/pkg_list.md new file mode 100644 index 0000000000..9974bf15ce --- /dev/null +++ b/static/docs/commands-reference/pkg_list.md @@ -0,0 +1,51 @@ +# pkg list + +List DVC packages that have been previously added. + +See also [install](/doc/commands-reference/pkg-install), +[uninstall](/doc/commands-reference/pkg-uninstall), +[add](/doc/commands-reference/pkg-add), +[remove](/doc/commands-reference/pkg-remove), +[modify](/doc/commands-reference/pkg-modify), +[list](/doc/commands-reference/pkg-list), and +[import](/doc/commands-reference/pkg-import). + +## Synopsis + +```usage +usage: dvc pkg list [-h] [--global] [--system] [--local] [-q | -v] +``` + +## Description + +This command accepts no arguments. It reads the appropriate config file (see the +command options) and lists the packages specified in its `pkg` sections. (See +also `dvc config`.) + +## Options + +- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead + of the project's `.dvc/config`. + +- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of + `.dvc/config`. + +- `--local` - modify a local config file instead of `.dvc/config`. It is located + in `.dvc/config.local` and is Git-ignored. This is useful when you need to + specify private config options in your config, that you don't want to track + and share through Git. + +- `-h`, `--help` - prints the usage/help message, and exit. + +- `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if + no problems arise, otherwise 1. + +- `-v`, `--verbose` - displays detailed tracing information. + +## Example + +```dvc +$ dvc pkg add get-started https://github.com/iterative/example-get-started +$ dvc pkg list +get-started +``` diff --git a/static/docs/commands-reference/pkg_modify.md b/static/docs/commands-reference/pkg_modify.md new file mode 100644 index 0000000000..246030a696 --- /dev/null +++ b/static/docs/commands-reference/pkg_modify.md @@ -0,0 +1,64 @@ +# pkg modify + +Modify DVC package settings. + +See also [install](/doc/commands-reference/pkg-install), +[uninstall](/doc/commands-reference/pkg-uninstall), +[add](/doc/commands-reference/pkg-add), +[remove](/doc/commands-reference/pkg-remove), +[list](/doc/commands-reference/pkg-list), and +[import](/doc/commands-reference/pkg-import). + +## Synopsis + +```usage +usage: dvc pkg modify [-h] [--global] [--system] [--local] [-q | -v] + [-u] name option [value] + +positional arguments: + name Package name. + option Option. + value Value. +``` + +## Description + +Package `name` and `option` name are required. + +This command modifies a `pkg` section in the DVC +[config file](/doc/user-guide/dvc-files-and-directories). Alternatively, +`dvc config` or manual editing could be used to change settings. + +## Options + +- `-u`, `--unset` - delete configuration value for given `option`. Don't provide + a `value` when using this flag. + +- `--global` - modify a global config file (e.g. `~/.config/dvc/config`) instead + of the project's `.dvc/config`. + +- `--system` - modify a system config file (e.g. `/etc/dvc.config`) instead of + `.dvc/config`. + +- `--local` - modify a local config file instead of `.dvc/config`. It is located + in `.dvc/config.local` and is Git-ignored. This is useful when you need to + specify private config options in your config, that you don't want to track + and share through Git. + +- `-h`, `--help` - prints the usage/help message, and exit. + +- `-q`, `--quiet` - does not write anything to standard output. Exit with 0 if + no problems arise, otherwise 1. + +- `-v`, `--verbose` - displays detailed tracing information. + +## Example + +```dvc +$ dvc pkg add example-get-started https://github.com/username/example-get-started +$ dvc pkg modify example-get-started https://github.com/iterative/example-get-started +``` + +The above command first registers a `example-get-started` with the URL of the +username's fork of the original repository from "iterative", and then corrects +the mistake. diff --git a/static/docs/commands-reference/pkg_remove.md b/static/docs/commands-reference/pkg_remove.md index 87216e5673..4c65da86fc 100644 --- a/static/docs/commands-reference/pkg_remove.md +++ b/static/docs/commands-reference/pkg_remove.md @@ -3,6 +3,13 @@ Remove a DVC package. Undoes the [adding](/doc/commands-reference/pkg-add) of a package. +See also [install](/doc/commands-reference/pkg-install), +[uninstall](/doc/commands-reference/pkg-uninstall), +[add](/doc/commands-reference/pkg-add), +[modify](/doc/commands-reference/pkg-modify), +[list](/doc/commands-reference/pkg-list), and +[import](/doc/commands-reference/pkg-import). + ## Synopsis ```usage diff --git a/static/docs/commands-reference/pkg_uninstall.md b/static/docs/commands-reference/pkg_uninstall.md index 2c13624729..476b5294b2 100644 --- a/static/docs/commands-reference/pkg_uninstall.md +++ b/static/docs/commands-reference/pkg_uninstall.md @@ -2,6 +2,13 @@ Uninstall DVC package(s). +See also [install](/doc/commands-reference/pkg-install), +[add](/doc/commands-reference/pkg-add), +[remove](/doc/commands-reference/pkg-remove), +[modify](/doc/commands-reference/pkg-modify), +[list](/doc/commands-reference/pkg-list), and +[import](/doc/commands-reference/pkg-import). + ## Synopsis ```usage diff --git a/static/docs/commands-reference/remote_modify.md b/static/docs/commands-reference/remote_modify.md index 318896f07c..44bce46396 100644 --- a/static/docs/commands-reference/remote_modify.md +++ b/static/docs/commands-reference/remote_modify.md @@ -14,9 +14,8 @@ See also [add](/doc/commands-reference/remote-add), ## Synopsis ```usage -usage: dvc remote modify [-h] [-q | -v] [-u] - [--global] [--system] [--local] - name option [value] +usage: dvc remote modify [-h] [--global] [--system] [--local] [-q | -v] + [-u] name option [value] positional arguments: name Name of the remote @@ -30,13 +29,14 @@ Remote `name` and `option` name are required. Option names are remote type specific. See below examples and a list of per remote type - AWS S3, Google cloud, Azure, SSH, ALiyun OSS, and others. -This command modifies a section in the DVC +This command modifies a `remote` section in the DVC [config file](/doc/user-guide/dvc-files-and-directories). Alternatively, `dvc config` or manual editing could be used to change settings. ## Options -- `-u`, `--unset` - delete configuration value +- `-u`, `--unset` - delete configuration value for given `option`. Don't provide + a `value` when using this flag. - `--global` - save remote configuration to the global config (e.g. `~/.config/dvc/config`) instead of `.dvc/config`. From dd14502b5318539bef657c199b64eb8ea8f67543 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Thu, 6 Jun 2019 22:42:39 -0500 Subject: [PATCH 9/9] reset to `dvc cache dir` implicit link in cache cmd ref --- static/docs/commands-reference/cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/docs/commands-reference/cache.md b/static/docs/commands-reference/cache.md index 5dcfd875af..7c4420e231 100644 --- a/static/docs/commands-reference/cache.md +++ b/static/docs/commands-reference/cache.md @@ -38,7 +38,7 @@ different platforms.) ## Example The main use of this command is to apply the `-v` and `-q` options to -[dvc cache dir](/doc/commands-reference/cache-dir) which doesn't have them: +`dvc cache dir` which doesn't have them: ```dvc $ dvc cache --verbose dir mycache