From 0b9b295ea30c6b4ab5cafa6008ec0ebfcd991dba Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Fri, 20 May 2022 15:36:42 +0900 Subject: [PATCH 1/8] user-guide: add troubleshooting entry for dvc-exp in shallow clones --- content/docs/user-guide/troubleshooting.md | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/content/docs/user-guide/troubleshooting.md b/content/docs/user-guide/troubleshooting.md index fbf5b091b6..6ddbe5fd68 100644 --- a/content/docs/user-guide/troubleshooting.md +++ b/content/docs/user-guide/troubleshooting.md @@ -125,3 +125,39 @@ 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 shallow Git repositories {#git-shallow} + +DVC experiments rely on Git features which may not work properly in shallow Git +repositories. This error commonly occurs in certain CI environments which use +shallow git clones by default. When this error is encountered, try unshallowing +the Git repository and then retry the DVC command. + +Local Git repositories can be unshallowed by using: + +``` +$ git fetch --unshallow +``` + +When using [CML](https://cml.dev/doc), repositories can be unshallowed by using: + +``` +$ cml ci --unshallow +``` + +In GitHub Actions, repositories can be unshallowed by setting `fetch-depth` in +the `actions/checkout` action. + +``` +- uses: actions/checkout@v3 + with: + fetch-depth: 0 +``` + +In GitLab CI/CD, repositories can be unshallowed by setting the `GIT_DEPTH` +environment variable: + +``` +variables: + GIT_DEPTH: "0" +``` From 972461980817959b43dee03d991086742b7505db Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Tue, 24 May 2022 20:26:48 -0500 Subject: [PATCH 2/8] guide: rewrite git-shallow troubleshooting --- content/docs/user-guide/troubleshooting.md | 45 ++++++++++++++-------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/content/docs/user-guide/troubleshooting.md b/content/docs/user-guide/troubleshooting.md index 6ddbe5fd68..026ce0c81e 100644 --- a/content/docs/user-guide/troubleshooting.md +++ b/content/docs/user-guide/troubleshooting.md @@ -126,38 +126,51 @@ 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 shallow Git repositories {#git-shallow} +## DVC Experiments may fail in Git shallow clones {#git-shallow} -DVC experiments rely on Git features which may not work properly in shallow Git -repositories. This error commonly occurs in certain CI environments which use -shallow git clones by default. When this error is encountered, try unshallowing -the Git repository and then retry the DVC command. +`dvc exp` commands use internal Git operations which may not work properly in +[shallow clones](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt). +Local Git repositories can be unshallowed with `git fetch --unshallow`. -Local Git repositories can be unshallowed by using: +Typically, however, this occurs in transient remote environments such as +Continuous Integration jobs, which use shallow clones by default. In those cases, +change their configuration to avoid shallow cloning. Common examples: -``` -$ git fetch --unshallow -``` + + When using [CML](https://cml.dev/doc), repositories can be unshallowed by using: -``` +```cli $ cml ci --unshallow ``` -In GitHub Actions, repositories can be unshallowed by setting `fetch-depth` in -the `actions/checkout` action. + + -``` +Set `fetch-depth` to `0` in the `actions/checkout` action: + +```yaml - uses: actions/checkout@v3 with: fetch-depth: 0 ``` -In GitLab CI/CD, repositories can be unshallowed by setting the `GIT_DEPTH` -environment variable: +> More info. +> [here](https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches). -``` + + + +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). + + + From 6d692e84d3a5ca826a70dbec772fc2f1ac76d418 Mon Sep 17 00:00:00 2001 From: "restyled-io[bot]" <32688539+restyled-io[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 20:27:13 -0500 Subject: [PATCH 3/8] Restyled by prettier (#3588) Co-authored-by: Restyled.io --- content/docs/user-guide/troubleshooting.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/user-guide/troubleshooting.md b/content/docs/user-guide/troubleshooting.md index 026ce0c81e..35185d4332 100644 --- a/content/docs/user-guide/troubleshooting.md +++ b/content/docs/user-guide/troubleshooting.md @@ -133,8 +133,8 @@ and retry the DVC command. Specifically, one of: Local Git repositories can be unshallowed with `git fetch --unshallow`. Typically, however, this occurs in transient remote environments such as -Continuous Integration jobs, which use shallow clones by default. In those cases, -change their configuration to avoid shallow cloning. Common examples: +Continuous Integration jobs, which use shallow clones by default. In those +cases, change their configuration to avoid shallow cloning. Common examples: @@ -166,7 +166,7 @@ Set the `GIT_DEPTH` env var to `0`: ```yaml variables: - GIT_DEPTH: "0" + GIT_DEPTH: '0' ``` > More info. From f4af90342a953fb271843b957a799f3098fa41a8 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Tue, 24 May 2022 20:35:17 -0500 Subject: [PATCH 4/8] guide: better CML mention --- content/docs/user-guide/troubleshooting.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/docs/user-guide/troubleshooting.md b/content/docs/user-guide/troubleshooting.md index 35185d4332..dabe9d9491 100644 --- a/content/docs/user-guide/troubleshooting.md +++ b/content/docs/user-guide/troubleshooting.md @@ -139,7 +139,8 @@ cases, change their configuration to avoid shallow cloning. Common examples: -When using [CML](https://cml.dev/doc), repositories can be unshallowed by using: +[CML](https://cml.dev/doc) has a convenient `--unshallow` option for it's +[`ci`](https://cml.dev/doc/ref/ci) command: ```cli $ cml ci --unshallow From ec8ffbd3593a8f00756c122754f3cb056c7c9f9c Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 2 Jun 2022 12:07:03 +0100 Subject: [PATCH 5/8] some tweaks --- content/docs/user-guide/troubleshooting.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/user-guide/troubleshooting.md b/content/docs/user-guide/troubleshooting.md index dabe9d9491..271c44cd4c 100644 --- a/content/docs/user-guide/troubleshooting.md +++ b/content/docs/user-guide/troubleshooting.md @@ -132,14 +132,14 @@ and retry the DVC command. Specifically, one of: [shallow clones](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt). Local Git repositories can be unshallowed with `git fetch --unshallow`. -Typically, however, this occurs in transient remote environments such as -Continuous Integration jobs, which use shallow clones by default. In those +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: -[CML](https://cml.dev/doc) has a convenient `--unshallow` option for it's +[CML](https://cml.dev) has a convenient `--unshallow` option for its [`ci`](https://cml.dev/doc/ref/ci) command: ```cli From d39764a8356889b906a79d2582fd6531dfdcf96d Mon Sep 17 00:00:00 2001 From: "restyled-io[bot]" <32688539+restyled-io[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 16:13:48 -0500 Subject: [PATCH 6/8] Restyled by prettier (#3614) Co-authored-by: Restyled.io --- content/docs/user-guide/troubleshooting.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/user-guide/troubleshooting.md b/content/docs/user-guide/troubleshooting.md index 271c44cd4c..8fcb154c23 100644 --- a/content/docs/user-guide/troubleshooting.md +++ b/content/docs/user-guide/troubleshooting.md @@ -132,9 +132,9 @@ and retry the DVC command. Specifically, one of: [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: +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: From 035f0936e2dd3f981133a9ad20638ba3cdbb9276 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Sat, 11 Jun 2022 16:19:50 -0500 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: Casper da Costa-Luis --- content/docs/user-guide/troubleshooting.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/content/docs/user-guide/troubleshooting.md b/content/docs/user-guide/troubleshooting.md index 8fcb154c23..97e39f7311 100644 --- a/content/docs/user-guide/troubleshooting.md +++ b/content/docs/user-guide/troubleshooting.md @@ -157,8 +157,11 @@ Set `fetch-depth` to `0` in the `actions/checkout` action: fetch-depth: 0 ``` -> More info. -> [here](https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches). + + +See the [GitHub Actions docs](https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches) for more information. + + @@ -170,8 +173,11 @@ variables: GIT_DEPTH: '0' ``` -> More info. -> [here](https://docs.gitlab.com/ee/ci/large_repositories/#shallow-cloning). + + +See the [GitLab CI/CD docs](https://docs.gitlab.com/ee/ci/large_repositories/#shallow-cloning) for more information. + + From fe81a8ff20dda466ecb872ef55bf707723bc169f Mon Sep 17 00:00:00 2001 From: "restyled-io[bot]" <32688539+restyled-io[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 16:20:21 -0500 Subject: [PATCH 8/8] Restyled by prettier (#3638) Co-authored-by: Restyled.io --- content/docs/user-guide/troubleshooting.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content/docs/user-guide/troubleshooting.md b/content/docs/user-guide/troubleshooting.md index 97e39f7311..897ab9ae13 100644 --- a/content/docs/user-guide/troubleshooting.md +++ b/content/docs/user-guide/troubleshooting.md @@ -159,7 +159,9 @@ Set `fetch-depth` to `0` in the `actions/checkout` action: -See the [GitHub Actions docs](https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches) for more information. +See the +[GitHub Actions docs](https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches) +for more information. @@ -175,7 +177,9 @@ variables: -See the [GitLab CI/CD docs](https://docs.gitlab.com/ee/ci/large_repositories/#shallow-cloning) for more information. +See the +[GitLab CI/CD docs](https://docs.gitlab.com/ee/ci/large_repositories/#shallow-cloning) +for more information.