Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repro cmdref updates #1861

Merged
merged 19 commits into from
Nov 3, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions content/docs/command-reference/repro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ usage: dvc repro [-h] [-q | -v] [-f] [-s] [-c <path>] [-m] [--dry] [-i]
[targets [targets ...]]

positional arguments:
targets Stage or .dvc file to reproduce
targets Stage, path to dvc.yaml or .dvc file to reproduce
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
```

## Description
Expand Down Expand Up @@ -110,7 +110,8 @@ up-to-date and only execute the final stage.
reproduced independently.

- `-R`, `--recursive` - determines the stages to reproduce by searching each
target directory (if any) and their subdirectories.
directory and their subdirectories. These directories can be given as
`targets`.
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

- `--no-commit` - do not save outputs to cache. A DVC-file is created and an
entry is added to `.dvc/state`, while nothing is added to the cache.
Expand Down Expand Up @@ -255,14 +256,40 @@ You can now check that `dvc.lock` and `count.txt` have been updated with the new
information: updated dependency/output file hash values, and a new result,
respectively.

## Example: Specific stage

> This example continues the previous one.

We can use `dvc repro` to reproduce a pipeline partially till a specific stage.
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
Let's add this line to `text.txt`:
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

```
...
4321
```

Now, specify the `count` stage as a `target` with `dvc repro`. This results in
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
the execution of `count`, and all the preceding stages in the pipeline (only
`filter` in this example):

```dvc
$ dvc repro count
Running stage 'filter' with command:
cat text.txt | egrep '[0-9]+' > numbers.txt
Updating lock file 'dvc.lock'

Running stage 'count' with command:
python process.py numbers.txt > count.txt
Updating lock file 'dvc.lock'
```

## Example: Downstream

> This example continues the previous one.
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

The `--downstream` option allows us to only reproduce results from commands
after a specific stage in a pipeline. To demonstrate how it works, let's make a
change in `text.txt` (the input of our first stage, created in the previous
example):
change in `text.txt`:

```
...
Expand Down