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

Have 'dvc list' use 'config.local' when pointed to local git repo #4572

Closed
chetnieter opened this issue Sep 14, 2020 · 6 comments
Closed

Have 'dvc list' use 'config.local' when pointed to local git repo #4572

chetnieter opened this issue Sep 14, 2020 · 6 comments

Comments

@chetnieter
Copy link

I have been exploring the use of DVC to manage remote Data Registries. Currently I am using ssh to manage the remote caches. Some of the users have different usernames on their local systems from their usernames on the system hosting the remote cache, so they are specifying the username for the remote in the config.local. On challenge we are facing is that it appears that dvc list not make use of of the config.local file when it is pointed to an offline git repo on disk. I assume this is due to dvc list making a temporary clone of the git repo even if it is on the local disk. Is there a way to make dvc list be aware of local settings contained in the config.local by either copying to the temporary cloned repo or working directly off a the local git repo rather cloning it.

@shcheklein
Copy link
Member

@chetnieter thanks for the issue! A few questions/suggestions:

Is there a way to make dvc list be aware of local settings contained in the config.local

Just to clarify - do you mean that it should be aware about the config.local located in the repo we are running dvc list for?

(e.g. if have a repo A with config.local and B with a different config.local and run dvc list B from the repo A directory it should be using config.local from the repo B)

by either copying to the temporary cloned repo or working directly off a the local git repo rather cloning it.

I like this idea, also we discussed that we should be treating the current repo dvc list . as a special case for performance and some other UI/UX reasons.

The question here is- we are changing semantics a bit here. If we don't clone then it might rely on staged/uncommitted changes in the workspace (or we decide that we don't want to do that). What would be the best in this case?

On challenge we are facing is that it appears that dvc list not make use of of the config.local file

Now, the workaround that might work for you. You could put certain settings into --global or --system config files. It works in a similar way to --local in a sense that it merges different options related to the same remote from the different config files. dvc list should definitely respect settings defined there. What do you think? Would it work for you?

@shcheklein shcheklein added the awaiting response we are waiting for your reply, please respond! :) label Sep 14, 2020
@chetnieter
Copy link
Author

@chetnieter thanks for the issue! A few questions/suggestions:

Is there a way to make dvc list be aware of local settings contained in the config.local

Just to clarify - do you mean that it should be aware about the config.local located in the repo we are running dvc list for?

(e.g. if have a repo A with config.local and B with a different config.local and run dvc list B from the repo A directory it should be using config.local from the repo B)

Yes. I was primary thinking of the case where you run dvc list <local repo> path. If there was a config.local in the local repo I think it would make since to use it.

by either copying to the temporary cloned repo or working directly off a the local git repo rather cloning it.

I like this idea, also we discussed that we should be treating the current repo dvc list . as a special case for performance and some other UI/UX reasons.

I think I like this idea. Perhaps this is the only case where it uses config.local. This would certainly satisfy our needs.

The question here is- we are changing semantics a bit here. If we don't clone then it might rely on staged/uncommitted changes in the workspace (or we decide that we don't want to do that). What would be the best in this case?

That is a good question and I don't have a strong opinion one way or the other. Perhaps if dvc list . is made a special case then in that case only would it rely on staged/uncommitted changes.

On challenge we are facing is that it appears that dvc list not make use of of the config.local file

Now, the workaround that might work for you. You could put certain settings into --global or --system config files. It works in a similar way to --local in a sense that it merges different options related to the same remote from the different config files. dvc list should definitely respect settings defined there. What do you think? Would it work for you?

Thank You! This helps out a lot. Out of curosity, where on MacOS is the global configuration written. I see that on Linux it is put in ~/.config/dvc/config but that does not appear to be the case on my Mac. Things appear to work fine when I set a global remote and user name on Mac, I just can't find the location of the global configuration file.

@shcheklein
Copy link
Member

I think I like this idea. Perhaps this is the only case where it uses config.local. This would certainly satisfy our needs.

does it mean that the only case when you run dvc list is this edge case - dvc list . path ?

Things appear to work fine when I set a global remote and user name on Mac, I just can't find the location of the global configuration file.

probably we should updated this doc https://dvc.org/doc/command-reference/config to include locations on different system (we had a similar question about Windows at some point) cc @jorgeorpinel

I think it is /Library/Application Support/dvc for the --system (and you need sudo to change it)
And it is in the /Library/Application\ Support/dvc/config for the --user.

@jorgeorpinel

This comment has been minimized.

@jorgeorpinel
Copy link
Contributor

probably we should updated this doc https://dvc.org/doc/command-reference/config to include locations on different system (we had a similar question about Windows

@shcheklein please see #1786 about this. Thanks

@pmrowla pmrowla removed the awaiting response we are waiting for your reply, please respond! :) label Nov 2, 2020
@pmrowla
Copy link
Contributor

pmrowla commented Nov 2, 2020

Closing as a duplicate of #4604, since 4604 is the one being tracked in our sprints

@pmrowla pmrowla closed this as completed Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants