Skip to content

Commit

Permalink
docs: use --external for add/run
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop committed Jun 2, 2020
1 parent aefba93 commit d267c49
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
6 changes: 5 additions & 1 deletion content/docs/command-reference/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Track data files or directories with DVC, by creating a corresponding
## Synopsis

```usage
usage: dvc add [-h] [-q | -v] [-R] [--no-commit] [-f <filename>]
usage: dvc add [-h] [-q | -v] [-R] [--no-commit] [--external]
[-f <filename>]
targets [targets ...]
positional arguments:
Expand Down Expand Up @@ -98,6 +99,9 @@ This way you bring data provenance and make your project
when ready to commit outputs with DVC. This is analogous to using `git add`
before `git commit`.

- `--external` - allow targets that are outside of the DVC project. See
[Managing External Data](/doc/user-guide/managing-external-data).

- `-f <filename>`, `--file <filename>` - specify name of the DVC-file it
generates. This option works only if there is a single target. By default the
name of the generated DVC-file is `<target>.dvc`, where `<target>` is the file
Expand Down
5 changes: 4 additions & 1 deletion content/docs/command-reference/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ usage: dvc run [-h] [-q | -v] [-d <path>] [-o <path>] [-O <path>]
[-w <path>] [--no-exec] [--overwrite-dvcfile]
[--no-run-cache] [--no-commit]
[--outs-persist <path>] [--outs-persist-no-cache <path>]
[--always-changed]
[--always-changed] [--external]
command
positional arguments:
Expand Down Expand Up @@ -183,6 +183,9 @@ data pipeline (e.g. random numbers, time functions, hardware dependency, etc.)
> Note that DVC-files without dependencies are automatically considered
> "always changed", so this option has no effect in those cases.
- `--external` - allow outputs that are outside of the DVC project. See
[Managing External Data](/doc/user-guide/managing-external-data).

- `-h`, `--help` - prints the usage/help message, and exit.

- `-q`, `--quiet` - do not write anything to standard output. Exit with 0 if no
Expand Down
15 changes: 10 additions & 5 deletions content/docs/user-guide/managing-external-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ The default local cache location is `.dvc/cache`, so there is no need to specify
it explicitly.

```dvc
$ dvc add /home/shared/mydata
$ dvc add /home/shared/mydata --external
$ dvc run -d data.txt \
--external \
-o /home/shared/data.txt \
cp data.txt /home/shared/data.txt
```
Expand All @@ -68,10 +69,11 @@ $ dvc remote add sshcache ssh://[email protected]:/cache
$ dvc config cache.ssh sshcache
# Add data on SSH directly
$ dvc add ssh://[email protected]:/mydata
$ dvc add ssh://[email protected]:/mydata --external
# Create the stage with external SSH output
$ dvc run -d data.txt \
--external \
-o ssh://[email protected]:/home/shared/data.txt \
scp data.txt [email protected]:/home/shared/data.txt
```
Expand All @@ -86,10 +88,11 @@ $ dvc remote add s3cache s3://mybucket/cache
$ dvc config cache.s3 s3cache
# Add data on S3 directly
$ dvc add s3://mybucket/mydata
$ dvc add s3://mybucket/mydata --external
# Create the stage with external S3 output
$ dvc run -d data.txt \
--external \
-o s3://mybucket/data.txt \
aws s3 cp data.txt s3://mybucket/data.txt
```
Expand All @@ -104,10 +107,11 @@ $ dvc remote add gscache gs://mybucket/cache
$ dvc config cache.gs gscache
# Add data on GS directly
$ dvc add gs://mybucket/mydata
$ dvc add gs://mybucket/mydata --external
# Create the stage with external GS output
$ dvc run -d data.txt \
--external \
-o gs://mybucket/data.txt \
gsutil cp data.txt gs://mybucket/data.txt
```
Expand All @@ -122,10 +126,11 @@ $ dvc remote add hdfscache hdfs://[email protected]/cache
$ dvc config cache.hdfs hdfscache
# Add data on HDFS directly
$ dvc add hdfs://[email protected]/mydata
$ dvc add hdfs://[email protected]/mydata --external
# Create the stage with external HDFS output
$ dvc run -d data.txt \
--external \
-o hdfs://[email protected]/home/shared/data.txt \
hdfs fs -copyFromLocal \
data.txt \
Expand Down

0 comments on commit d267c49

Please sign in to comment.