-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ls/import/get: introduce --config #9747
Conversation
f28cb7d
to
69c06fd
Compare
Adds support for `--config` to all three commands. For `ls` and `get`, it is a purely runtime option that will merge the config you provide with target repo's configs (similar to how .dvc/config.local works). E.g. ``` $ cat myconfig [remote "myremote"] access_key_id = 12345 secret_access_key = 98765 $ dvc get https://github.com/efiop/mydataregistry recent-grads.csv --config myconfig ``` In case of `dvc import`, the semantics are the same, but the value is also recorded in the resulting dvcfile. E.g. ``` $ dvc import https://github.com/efiop/mydataregistry recent-grads.csv --config myconfig ... $ cat recent-grads.csv.dvc md5: 85c86eeb3afa6d1f7d11beedc644d28e frozen: true deps: - path: recent-grads.csv repo: url: https://github.com/efiop/mydataregistry config: myconfig rev_lock: af22e06bbfe34d62a140437abf32f48b535944a7 outs: - md5: f447e23a170a9f25a7799f069a1ba934 size: 26872 hash: md5 path: recent-grads.csv ``` This is the most general and powerful mechanism that we can give, that works for everything from reconfiguring your default remote to completely changing your remote layout and beyond (will be handy in the future). Fixes iterative#2466
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #9747 +/- ##
==========================================
- Coverage 90.47% 90.45% -0.02%
==========================================
Files 480 480
Lines 36534 36572 +38
Branches 5252 5259 +7
==========================================
+ Hits 33053 33081 +28
- Misses 2887 2892 +5
- Partials 594 599 +5
☔ View full report in Codecov by Sentry. |
After this change, I'm getting:
Also, similar to #9656, can we introduce |
I agree with this. I didn't have nearly enough time to spend on thinking about the task and how it can look like and the workflow. But it seems too low level for me, very low level. (and there might be a good reason). |
Taking a look at that error, thanks! #9750 Regarding |
Leftover from iterative#9747
I guess you don't want to use Can md5: 85c86eeb3afa6d1f7d11beedc644d28e
frozen: true
deps:
- path: recent-grads.csv
repo:
url: https://github.com/efiop/mydataregistry
config:
core:
remote: myremote
myremote:
access_key_id: 12345
secret_access_key: 98765
rev_lock: af22e06bbfe34d62a140437abf32f48b535944a7
outs:
- md5: f447e23a170a9f25a7799f069a1ba934
size: 26872
hash: md5
path: recent-grads.csv |
@dberenbaum Totally that would work, but what I don't like about that is that you are forced to put your secret keys into your dvcfile, which is pretty bad. With |
@dberenbaum Actually those are clearly separated. If this |
Okay, I get it now. So for |
@dberenbaum I actually really like the way you did it in the example. Both remote and remote-config under |
Adds support for
--config
to all three commands. Forls
andget
, it is a purely runtime option that will merge the config you provide with target repo's configs (similar to how .dvc/config.local works). E.g.In case of
dvc import
, the semantics are the same, but the value is also recorded in the resulting dvcfile. E.g.This is the most general and powerful mechanism that we can give, that works
for everything from reconfiguring your default remote to completely changing
your remote layout and beyond (will be handy in the future).
Fixes #2466