Skip to content

Commit

Permalink
remote: include -d option in crtain examples throughout website
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeorpinel committed Jan 16, 2020
1 parent 96232e0 commit 4950d25
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 47 deletions.
7 changes: 4 additions & 3 deletions public/static/docs/command-reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,19 @@ learn more about the state file (database) that is used for optimization.
$ dvc config core.loglevel debug
```

## Example: Add an S3 remote
## Example: Add an S3 remote, and set it as default

> 💡 Before adding an S3 remote, be sure to
> [Create a Bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html).
This also sets the remote as the <abbr>project</abbr> default:

```dvc
$ dvc remote add myremote s3://bucket/path
$ dvc config core.remote myremote
```

> Note that this is equivalent to using `dvc remote add` with the
> `-d`/`--default` option.
## Example: Default remotes

Use remote `myremote` by default:
Expand Down
13 changes: 6 additions & 7 deletions public/static/docs/command-reference/pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,18 @@ reflinks or hardlinks to put it in the workspace without copying. See
## Examples

For using the `dvc pull` command, a remote storage must be defined. (See
`dvc remote`.) For an existing <abbr>project</abbr>, remotes are usually already
set up and you can use `dvc remote list` to check them. Just to remind how it is
done and set a context for the example, let's define an SSH remote with the
`dvc remote add` command:
`dvc remote add`.) For an existing <abbr>project</abbr>, remotes are usually
already set up and you can use `dvc remote list` to check them. To remember how
it's done, and set a context for the example, let's define a default SSH remote:

```dvc
$ dvc remote add r1 ssh://_username_@_host_/path/to/dvc/remote/storage
$ dvc remote add -d r1 ssh://_username_@_host_/path/to/dvc/remote/storage
$ dvc remote list
r1 ssh://_username_@_host_/path/to/dvc/remote/storage
```

> DVC supports several remote types. For details, see the
> [`remote add`](/doc/command-reference/remote/add) documentation.
> DVC supports several
> [remote types](/doc/command-reference/remote/add#supported-storage-types).
Having some images and other files in remote storage, we can pull all changed
files from the current Git branch:
Expand Down
11 changes: 5 additions & 6 deletions public/static/docs/command-reference/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,18 @@ to push.
## Examples

For using the `dvc push` command, a remote storage must be defined. (See
`dvc remote`.) For an existing <abbr>project</abbr>, remotes are usually already
set up and you can use `dvc remote list` to check them. Just to remind how it is
done and set a context for the example, let's define an SSH remote with the
`dvc remote add` command:
`dvc remote add`.) For an existing <abbr>project</abbr>, remotes are usually
already set up and you can use `dvc remote list` to check them. To remember how
it's done, and set a context for the example, let's define a default SSH remote:

```dvc
$ dvc remote add r1 ssh://_username_@_host_/path/to/dvc/cache/directory
$ dvc remote list
r1 ssh://_username_@_host_/path/to/dvc/cache/directory
```

> DVC supports several remote types. For details, see the
> [`remote add`](/doc/command-reference/remote/add) documentation.
> DVC supports several
> [remote types](/doc/command-reference/remote/add#supported-storage-types).
Push all data file caches from the current Git branch to the default remote:

Expand Down
11 changes: 7 additions & 4 deletions public/static/docs/command-reference/remote/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ To communicate with a remote object storage that supports an S3 compatible API
[IBM Cloud Object Storage](https://www.ibm.com/cloud/object-storage) etc.) you
must explicitly set the `endpointurl` in the configuration:

For example:
For example, using `dvc remote modify`:

```dvc
$ dvc remote add -d myremote s3://mybucket/path/to/dir
$ dvc remote add myremote s3://mybucket/path/to/dir
$ dvc remote modify myremote endpointurl https://object-storage.example.com
```

Expand Down Expand Up @@ -390,10 +390,13 @@ $ cat .dvc/config
</details>

## Example: Custom configuration of an S3 remote
## Example: Customize an S3 remote

Add an Amazon S3 remote as the _default_ (via `-d` option), and modify its
region:
region.

> 💡 Before adding an S3 remote, be sure to
> [Create a Bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html).
```dvc
$ dvc remote add -d myremote s3://mybucket/myproject
Expand Down
14 changes: 7 additions & 7 deletions public/static/docs/command-reference/remote/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ url = /path/to/remote
remote = myremote
```

## Example: Add an Amazon S3 remote and modify its region
## Example: Customize an additional S3 remote

> 💡 Before adding an S3 remote, be sure to
> [Create a Bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html).
```dvc
$ dvc remote add mynewremote s3://mybucket/myproject
$ dvc remote modify mynewremote region us-east-2
$ dvc remote add newremote s3://mybucket/myproject
$ dvc remote modify newremote endpointurl https://object-storage.example.com
```

The project's config file should now look something like this:
Expand All @@ -112,21 +112,21 @@ The project's config file should now look something like this:
url = /path/to/remote
[core]
remote = myremote
['remote "mynewremote"']
['remote "newremote"']
url = s3://mybucket/myproject
region = us-east-2
endpointurl = https://object-storage.example.com
```

## Example: List all remotes in the project

```dvc
$ dvc remote list
myremote /path/to/remote
mynewremote s3://mybucket/myproject
newremote s3://mybucket/myproject
```

## Example: Remove a remote

```dvc
$ dvc remote remove mynewremote
$ dvc remote remove newremote
```
7 changes: 4 additions & 3 deletions public/static/docs/command-reference/remote/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ including names and URLs.

## Examples

Let's for simplicity add a default local remote:
Let's for simplicity add a _default_ local remote:

<details>

Expand All @@ -60,6 +60,7 @@ And now the list of remotes should look like:

```dvc
$ dvc remote list
myremote /path/to/remote
myremote /path/to/remote
```

The list will also include any previously added remotes.
18 changes: 10 additions & 8 deletions public/static/docs/command-reference/remote/modify.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ must explicitly set the `endpointurl` in the configuration:
For example:

```dvc
$ dvc remote add -d myremote s3://path/to/dir
$ dvc remote add myremote s3://path/to/dir
$ dvc remote modify myremote endpointurl https://object-storage.example.com
```

Expand Down Expand Up @@ -382,26 +382,28 @@ For more information on configuring Azure Storage connection strings, visit

## Example: Customize an S3 remote

Let's first set up a _default_ S3 remote:
Let's first set up a _default_ S3 remote.

```dvc
$ dvc remote add -d myremote s3://mybucket/storage
> 💡 Before adding an S3 remote, be sure to
> [Create a Bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html).
```dvc
$ dvc remote add -d myremote s3://mybucket/myproject
Setting 'myremote' as a default remote.
```

Modify its endpoint URL:
Modify its access profile:

```dvc
$ dvc remote modify myremote endpointurl https://object-storage.example.com
$ dvc remote modify myremote profile myusername
```

Now the config file should look like (run `cat .dvc/config`):
Now the project config file should look like this:

```ini
['remote "myremote"']
url = s3://mybucket/storage
endpointurl = https://object-storage.example.com
profile = myusername
[core]
remote = myremote
```
5 changes: 2 additions & 3 deletions public/static/docs/command-reference/remote/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ edit config files manually.

## Examples

Add Amazon S3 remote and modify its region:
Add Amazon S3 remote:

```dvc
$ dvc remote add myremote s3://mybucket/myproject
$ dvc remote modify myremote region us-east-2
```

Remove remote:
Remove it:

```dvc
$ dvc remote remove myremote
Expand Down
2 changes: 1 addition & 1 deletion public/static/docs/use-cases/data-registries.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The actual data is stored in the project's <abbr>cache</abbr> and should be
be accessed from other locations or by other people:

```
$ dvc remote add myremote s3://bucket/path
$ dvc remote add -d myremote s3://bucket/path
$ dvc push
```

Expand Down
8 changes: 4 additions & 4 deletions public/static/docs/user-guide/managing-external-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ $ dvc run -d data.txt \
# Add SSH remote to be used as cache location for SSH files
$ dvc remote add sshcache ssh://[email protected]:/cache
# Tell dvc to use the 'sshcache' remote as SSH cache location
# Tell DVC to use the 'sshcache' remote as SSH cache location
$ dvc config cache.ssh sshcache
# Add data on SSH directly
Expand All @@ -86,7 +86,7 @@ $ dvc run -d data.txt \
# Add S3 remote to be used as cache location for S3 files
$ dvc remote add s3cache s3://mybucket/cache
# Tell dvc to use the 's3cache' remote as S3 cache location
# Tell DVC to use the 's3cache' remote as S3 cache location
$ dvc config cache.s3 s3cache
# Add data on S3 directly
Expand All @@ -104,7 +104,7 @@ $ dvc run -d data.txt \
# Add GS remote to be used as cache location for GS files
$ dvc remote add gscache gs://mybucket/cache
# Tell dvc to use the 'gscache' remote as GS cache location
# Tell DVC to use the 'gscache' remote as GS cache location
$ dvc config cache.gs gscache
# Add data on GS directly
Expand All @@ -122,7 +122,7 @@ $ dvc run -d data.txt \
# Add HDFS remote to be used as cache location for HDFS files
$ dvc remote add hdfscache hdfs://[email protected]/cache
# Tell dvc to use the 'hdfscache' remote as HDFS cache location
# Tell DVC to use the 'hdfscache' remote as HDFS cache location
$ dvc config cache.hdfs hdfscache
# Add data on HDFS directly
Expand Down
2 changes: 1 addition & 1 deletion src/LandingHero/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class LandingHero extends Component {
<Line>$ dvc run -d images -o model.p cnn.py</Line>
</Command>
<Command active={activeCommand === 2}>
<Line>$ dvc remote add myrepo s3://mybucket</Line>
<Line>$ dvc remote add -d myrepo s3://mybucket</Line>
</Command>
<Command active={activeCommand === 3}>
<Line>$ dvc push</Line>
Expand Down

0 comments on commit 4950d25

Please sign in to comment.