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 init: initialize dvc repo if uninitialized #6868

Closed
wants to merge 1 commit into from

Conversation

skshetry
Copy link
Member

@skshetry skshetry commented Oct 26, 2021

Also autostages dvc.yaml/.gitignore/param files by default.

The whole solution feels a bit hacky, as we need to create an uninitialized dvc repo, create a stage in memory and initialize dvc repo if there is no .dvc directory. The "creating stage" part does not really work without creating a proper DVC repo, so we have to hack it around.
For now, removing the RemoteCacheRequired exception throwing does seem to make it work, but it's hard to guarantee that as we have never supported that before.

Part of #6446.

dvc/output.py Outdated Show resolved Hide resolved
@skshetry skshetry force-pushed the exp-init-dvc-init branch 3 times, most recently from 76e925a to 65c80e5 Compare October 26, 2021 12:34
@skshetry skshetry force-pushed the exp-init-dvc-init branch 2 times, most recently from b70b1cd to 2090335 Compare November 2, 2021 08:46
@dberenbaum
Copy link
Collaborator

So if the command fails or the user decides not to keep the stage, is the dvc repo initialized? Would it be better to add a hint to dvc init when running a command outside of a dvc repo?

@daavoo
Copy link
Contributor

daavoo commented Nov 15, 2021

So if the command fails or the user decides not to keep the stage, is the dvc repo initialized? Would it be better to add a hint to dvc init when running a command outside of a dvc repo?

Upvoting for hint + docs updates

@skshetry
Copy link
Member Author

Closing for now, some of the pre-requisite were backported. It's a bit tricky considering we depend on Repo for so many things, and can be opened again if we think it's important to have.

@skshetry skshetry closed this Jan 21, 2022
@skshetry
Copy link
Member Author

So if the command fails or the user decides not to keep the stage, is the dvc repo initialized? Would it be better to add a hint to dvc init when running a command outside of a dvc repo?

No, this PR initialized repo at the very end just before creating dvc.yaml file, but after getting confirmation from the user for stage.

@skshetry skshetry deleted the exp-init-dvc-init branch January 21, 2022 05:21
@skshetry skshetry restored the exp-init-dvc-init branch April 27, 2022 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants