Initial pkg implementation#2012
Conversation
7ddf5b9 to
0acc20e
Compare
76098ab to
9cd10dd
Compare
|
I think it would be better to not add knowledge about everything to config. Config should provide Knowledge about config contents will be ideally contained within specific code area and not slip anywhere else. E.g. remote will be able to configure itself from config and update config as needed: add or update a remote, set default one. |
328a014 to
84210ed
Compare
There is a config like that already. It is called ConfigObj 🙂 Our config is dealing with managing particular sections(e.g.
Do you mean something like this ? |
02733a9 to
15b4b97
Compare
1a8e7dc to
59e89bd
Compare
|
@Suor I'm not sure how you want to handle them as the same class. They are different instances, with different fields, not sure how you want to get rid of both in favor of one. The current patch at least uses factories instead of junky |
|
Moved config-related stuff to #2098 . The |
|
@efiop I just want hordes of code to be moved to mirror files only for really good reason. |
|
@Suor Unless something went wrong there, moving shouldn't have deleted the history. Like |
|
@efiop why output subslassing dependencies is better? It's the same but the other way around. So just moving code for no reason. Even if that has some sense, which I don't get, it is still not worth the hassle as code itself is not improving, i.e. won't be easier to support in the future, and making it abstractly correct in whatever sense is low value. |
4473fee to
910f9fd
Compare
|
@Suor Sorry, forgot to reply. The refactoring does make the code better, since it removes weird In the meantime, I've pushed MVP that is detached from all the previous refactorings (which are going to be submitted separately). Todo:
So currently there are three commands: |
pared
left a comment
There was a problem hiding this comment.
Shouldn't dvc/repo/_ignore() flist include self.pkg.pkg_dir ?
There was a problem hiding this comment.
not related not this PR: looks like either this message should be moved down the stack or we should add continue here.
There was a problem hiding this comment.
We shouldn't have continue here, because we should push/pull/etc cache for the locked stage file itself. We could move this warning to repo.graph(), but it would be too specific to use it there. Hence why we put this one here.
There was a problem hiding this comment.
as far as I remember we already have a mechanism to avoid caching of an output? can we reuse it here?
There was a problem hiding this comment.
@shcheklein That is an amazing idea! I didn't think about it that way. But indeed, we could treat it as --outs-no-cache. Thanks! 🙂
There was a problem hiding this comment.
Turns out it is not easy to do, since things like adding to gitignore and checking out are use_cache dependant. I've added get_used_cache method to Output to handle this more gracefully, but using --outs-no-cache is not a very good option for now.
There was a problem hiding this comment.
if feels like an output can decide if it needs to be cached or not
There was a problem hiding this comment.
Output needs to know if he is a part of import stage, so this is still used.
There was a problem hiding this comment.
not necessarily, when we create an output we can pass a flag. It can be and probably should be decided on the Cmd/API level. I can imagine we will have a flag to cache output anyway.
There was a problem hiding this comment.
Will keep that in mind in #2138 (added a comment about this discussion there as well).
There was a problem hiding this comment.
should we fail if does not exist?
There was a problem hiding this comment.
We will fail later down the line, where we will try to use this. I'll take a second look to see if failing here would provide better UX. Thanks for the heads up!
There was a problem hiding this comment.
Adjusted the error handling down the line to handle it more gracefully.
There was a problem hiding this comment.
qq - does it avoid restoring the workspace as well?
There was a problem hiding this comment.
@shcheklein Not sure what you mean. Could you elaborate?
There was a problem hiding this comment.
I mean --no-checkout option of the git clone
There was a problem hiding this comment.
Ah, nope. So we do checkout to have a default version installed. If any dependency is using some particular version, it will get it. But if you've installed some package of specific version by default, then all dependencies that don't have version set explicitly, will use that default installed version.
There was a problem hiding this comment.
btw, does it make sense to disable lock and sqllite for this case? just to make sure that this easy scenario works everywhere.
There was a problem hiding this comment.
You mean nfs and friends, right? Good point, I'll take a look if we could disable state for that purpose. Also need to disable our own .dvc/lock as well
There was a problem hiding this comment.
This is not trivial, created #2135 for it. Might be easier to just support nfs after all.
shcheklein
left a comment
There was a problem hiding this comment.
This is looks great! A few minor comments and questions.
@jorgeorpinel please, review the help messages and command description. Let's work together to make then user-friendly.
Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
Have you followed the guidelines in our
Contributing document?
Does your PR affect documented changes or does it add new functionality
that should be documented? If yes, have you created a PR for
dvc.org documenting it or at
least opened an issue for it? If so, please add a link to it.
Docs: treeverse/dvc.org#385
Todo:
uninstallcan remove corrupted pkgadd(import: add a mechanism to lock external dependencies #2139).dvc/pkg-list.ymlsimilar to https://github.com/sindresorhus/package-jsonadd(import: add a mechanism to lock external dependencies #2139).dvc/pkg-lock.ymlsimilar to https://flaviocopes.com/package-lock-json/ (installshould add an entry to it)support importing the whole package with(import: support importing the whole repo #2140)dvc import mypkg. This is going to be similar to specifying multiple datas within the package, e.g.dvc import mypkg data1 data2, but we will have to collect it ourselves for the whole package.dvc pkg getfor simply downloading data from the urldstoption into a-oflag, so that we coulddvc import mypkg -o dir;check that when running repro on import it will ask if it needs to remove modified outputs(will be implemented by run: warn and/or prompt user when deleting an output #2027)