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

exp: CI runs require unshallow clone (fetch-depth: >1) #3416

Closed
dberenbaum opened this issue Apr 5, 2022 · 8 comments · Fixed by #3577
Closed

exp: CI runs require unshallow clone (fetch-depth: >1) #3416

dberenbaum opened this issue Apr 5, 2022 · 8 comments · Fixed by #3577
Labels
A: docs Area: user documentation (gatsby-theme-iterative) C: guide Content of /doc/user-guide C: ref Content of /doc/*-reference type: enhancement Something is not clear, small updates, improvement suggestions

Comments

@dberenbaum
Copy link
Collaborator

dberenbaum commented Apr 5, 2022

Summary: dvc exp commands will not run in CML or other Github actions (and probably the same on other Git servers?) because they will only fetch the head commit by default, which is insufficient for internal git merges. The solution is in iterative/dvc#7547 (comment).

Not sure where to document this or even whether it belongs in DVC, CML, or both. @casperdcl Maybe you have thoughts?

@casperdcl
Copy link
Contributor

casperdcl commented Apr 5, 2022

For CML workflows, cml ci --unshallow is best.

In non-CML cases (probably worth mentioning in dvc.org docs), unshallow clones are needed (actions/checkout with fetch-depth: 0)

@dberenbaum
Copy link
Collaborator Author

I never noticed cml ci before, looks great. I'm still unsure where it would be best to recommend using this when running dvc exp commands on cml or other ci workflows.

@casperdcl casperdcl changed the title cml + dvc exp requires fetch-depth > 1 exp: CI runs require unshallow clone (fetch-depth: >1) Apr 6, 2022
@daavoo
Copy link
Contributor

daavoo commented Apr 6, 2022

What about creating a new section in https://dvc.org/doc/user-guide/troubleshooting , catching the specific exception on DVC side, and make it point to that URL

@jorgeorpinel jorgeorpinel changed the title exp: CI runs require unshallow clone (fetch-depth: >1) exp: CI runs require unshallow clone (fetch-depth: >1) Apr 8, 2022
@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Apr 11, 2022

Which exp commands/ scenarios exactly do not run in shallow clones? E.g. I assume exp init works.

I'm guessing mostly exp branch/apply (due to internal git merge)? If so we can make a small note in those refs and in https://dvc.org/doc/user-guide/experiment-management/persisting-experiments

Thanks

@jorgeorpinel jorgeorpinel added the ❓ type: question Information is requested label Apr 11, 2022
@dberenbaum
Copy link
Collaborator Author

No, unfortunately even exp run (see the discussion linked from the original comment) needs a non-shallow clone.

@jorgeorpinel jorgeorpinel added C: guide Content of /doc/user-guide C: ref Content of /doc/*-reference and removed ❓ type: question Information is requested labels Apr 12, 2022
@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Apr 12, 2022

OK. Hmmm I'm not sure we need to much of a change other than perhaps a small note in https://dvc.org/doc/user-guide/experiment-management/experiments-overview and https://dvc.org/doc/command-reference/exp (/init). Seems like an edge case, or have you noticed this being a common issue out there outside of CML?

https://cml.dev/doc/cml-with-dvc should probably note this and recommend cml ci? Cc @casperdcl

@daavoo
Copy link
Contributor

daavoo commented Apr 12, 2022

Seems like an edge case, or have you noticed this being a common issue out there outside of CML?

It's an issue in many CI scenarios (with or without CML) because the default behavior in both GitHub (https://github.com/actions/checkout) and GitLab (https://docs.gitlab.com/ee/ci/large_repositories/#shallow-cloning) is a shallow clone.

casperdcl added a commit to iterative/cml.dev that referenced this issue Apr 13, 2022
@casperdcl
Copy link
Contributor

casperdcl commented Apr 13, 2022

Not sure where to document this or even whether it belongs in DVC, CML, or both

definitely docs in both because

It's an issue in many CI scenarios (with or without CML).

Makes sense to mention in:

0x2b3bfa0 pushed a commit to iterative/cml.dev that referenced this issue Apr 13, 2022
* contrib: shorten guide

- follow-up to #220

* dvc: use ci --unshallow

 - vis. iterative/dvc.org#3416 (comment)
@jorgeorpinel jorgeorpinel added type: enhancement Something is not clear, small updates, improvement suggestions A: docs Area: user documentation (gatsby-theme-iterative) labels Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: docs Area: user documentation (gatsby-theme-iterative) C: guide Content of /doc/user-guide C: ref Content of /doc/*-reference type: enhancement Something is not clear, small updates, improvement suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants