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

user-guide: add troubleshooting entry for dvc-exp in shallow clones #3577

Merged
merged 8 commits into from
Jun 11, 2022
50 changes: 50 additions & 0 deletions content/docs/user-guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,53 @@ and retry the DVC command. Specifically, one of:

[internal directories]:
https://dvc.org/doc/user-guide/project-structure/internal-files

## DVC Experiments may fail in Git shallow clones {#git-shallow}

`dvc exp` commands use internal Git operations which may not work properly in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe hyperlink to more info (presumably some section on reflog things?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't explain internal Git merges anywhere, not even in Peter's blog post. Too deep

[shallow clones](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt).
Local Git repositories can be unshallowed with `git fetch --unshallow`.

This often occurs in transient remote environments such as
Continuous Integration (CI) jobs, which use shallow clones by default. In those
cases, change their configuration to avoid shallow cloning. Common examples:

<toggle>
<tab title="CML">

[CML](https://cml.dev) has a convenient `--unshallow` option for its
[`ci`](https://cml.dev/doc/ref/ci) command:

```cli
$ cml ci --unshallow
```
casperdcl marked this conversation as resolved.
Show resolved Hide resolved

</tab>
<tab title="GitHub Actions">

Set `fetch-depth` to `0` in the `actions/checkout` action:

```yaml
- uses: actions/checkout@v3
with:
fetch-depth: 0
```

> More info.
> [here](https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches).
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

</tab>
<tab title="GitLab CI/CD">

Set the `GIT_DEPTH` env var to `0`:

```yaml
variables:
GIT_DEPTH: '0'
```

> More info.
> [here](https://docs.gitlab.com/ee/ci/large_repositories/#shallow-cloning).
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

</tab>
</toggle>