Skip to content

Commit

Permalink
guide: summarize Exp Sharing titles and examples (#2719)
Browse files Browse the repository at this point in the history
* guide: summarize Sharing Exps intro

* ref: link from exp push/pull to Exp Sharing guide

* Update content/docs/user-guide/experiment-management/sharing-experiments.md

* guide: rename Exp Sharing sections

* guide: summarize Exp Sharing examples

* guide: link from Exp Mgmt index to Sharing

* guide: ~~isolate~~ from link to Exp Sharing
per #2711 (review)

* Update content/docs/user-guide/experiment-management/sharing-experiments.md

Co-authored-by: David de la Iglesia Castro <[email protected]>

* guide: mention only SSH Git URLs support exp sharing
per #2711 (review)

* guide: update dvc remote example in sharing exps

* yarn format some files
per https://app.circleci.com/pipelines/github/iterative/dvc.org/10086/workflows/9b1bf89f-a432-49f2-9a20-72fe77dd4102/jobs/10145

* prettier sharing-experiments.md

* Update content/docs/user-guide/experiment-management/sharing-experiments.md

Co-authored-by: Casper da Costa-Luis <[email protected]>

Co-authored-by: David de la Iglesia Castro <[email protected]>
Co-authored-by: Casper da Costa-Luis <[email protected]>
  • Loading branch information
3 people authored Aug 20, 2021
1 parent 532df56 commit 0581991
Showing 1 changed file with 21 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ dvc remote list
storage s3://mybucket/my-dvc-store
```

## Uploading experiments to remotes
## Uploading experiments

You can upload an experiment and its files to both remotes using `dvc exp push`
(requires the Git remote name and experiment name as arguments).
Expand All @@ -57,7 +57,7 @@ performance also depend on the connection bandwidth and remote configurations.
[run-cache]: /doc/user-guide/project-structure/internal-files#run-cache

## Listing experiments remotely
## Listing remote experiments

In order to list experiments in a DVC project, you can use the `dvc exp list`
command. With no command line options, it lists the experiments in the current
Expand Down Expand Up @@ -102,7 +102,7 @@ cnn-64
cnn-96
```

## Downloading experiments from remotes
## Downloading experiments

When you clone a DVC repository, it doesn't fetch any experiments by default. In
order to get them, use `dvc exp pull` (with the Git remote and the experiment
Expand All @@ -124,31 +124,28 @@ can set the number with `--jobs` (`-j`).
If an experiment being pulled already exists in the local project, DVC won't
overwrite it unless you supply `--force`.

### Example: Pushing or pulling multiple experiments
## Example: Sharing multiple experiments

You can create a loop to upload or download all experiments like this:
You can create a loop to push or pull all experiments. For example in a Linux
terminal:

```dvc
$ dvc exp list --all --names-only | while read -r expname ; do \
dvc exp pull origin ${expname} \
done
```

> Without `--all`, only the experiments derived from the current commit will be
> pushed/pulled.
## Example: Dedicated experiment directories

## Example: Creating a directory for an experiment

A good way to isolate experiments is to create a separate home directory for
each one.
A good way to isolate experiments is to create a separate directory outside the
current <abbr>repository</abbr> for each one.

> Another alternative is to use `dvc exp apply` and `dvc exp branch`, but here
> we'll see how to use `dvc exp pull` to copy an experiment.
Suppose there is a <abbr>DVC repository</abbr> in `~/my-project` with multiple
experiments. Let's create a copy of experiment `exp-abc12` from there.

First, clone the repo into another directory:
Suppose there is a DVC repo in `~/my-project` with multiple experiments. Let's
create a copy of experiment `exp-abc12` from it. First, clone the repo into
another directory:

```dvc
$ git clone ~/my-project ~/my-experiment
Expand All @@ -165,29 +162,25 @@ main:
...
```

If there is no DVC remote in the original repository, you can define its
<abbr>cache</abbr> as the clone's `dvc remote`:
If the original repository doesn't have a `dvc remote`, you can define its
<abbr>cache</abbr> as the clone's remote storage:

```dvc
$ dvc remote add --local --default storage ~/my-project/.dvc/cache
```

> ⚠️ `--local` is important here, so that the configuration change doesn't get
> to the original repo accidentally.
> ⚠️ `--local` is important here, so that the configuration changes don't
> accidentally get to the original repo.
If there's a DVC remote for the project, assuming the experiments have been
pushed there, you can pull the one in question:
Having a DVC remote (and assuming the experiments have been pushed or cached
there) you can `dvc exp pull` the one in question; You can then can
`dvc exp apply` it and get a <abbr>workspace</abbr> that contains all of its
files:

```dvc
$ dvc exp pull origin exp-abc12
```

Then we can `dvc apply` this experiment and get a <abbr>workspace</abbr> that
contains all of its files:

```dvc
$ dvc exp apply exp-abc12
```

Now you have a dedicated directory for your experiment, containing all its
Now you have a separate repo directory for your experiment, containing all its
artifacts!

0 comments on commit 0581991

Please sign in to comment.