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

dvc: replace pkg concept with external repo #2160

Merged
merged 1 commit into from
Jun 21, 2019
Merged

Conversation

efiop
Copy link
Contributor

@efiop efiop commented Jun 19, 2019

dvc import is now renamed to dvc import-url. dvc pkg import renamed into dvc import and dvc pkg get into dvc get. Also, for symmetry, introduced dvc get-url. Along with some other minor modifications. The workflow now looks like:

# downloads and creates dvc file
dvc import https://github.com/iterative/dvc path/data --rev 0.41.3

# only downloads data
dvc get https://github.com/iterative/dvc path/data --rev 0.41.3

Signed-off-by: Ruslan Kuprieiev [email protected]

  • 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.


@efiop efiop force-pushed the repo branch 3 times, most recently from 1951506 to 278b9f7 Compare June 20, 2019 16:58
@efiop efiop changed the title [WIP] dvc: replace pkg concept with external repo dvc: replace pkg concept with external repo Jun 20, 2019
@efiop efiop force-pushed the repo branch 5 times, most recently from 628b3e4 to f675e72 Compare June 20, 2019 22:07
@shcheklein shcheklein requested a review from Suor June 21, 2019 02:20
@efiop efiop merged commit 95096e5 into iterative:master Jun 21, 2019
@efiop efiop deleted the repo branch June 21, 2019 07:36
return

try:
os.makedirs(self.repos_dir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not compat makedirs?

#
# Note that tempfile.TemporaryDirectory is using symlinks to tmpfs, so
# we won't be able to use move properly.
tmp_dir = os.path.join(self.repos_dir, "." + str(uuid.uuid4()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use pathlib?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, our Repo and other stuff are not meant to be used with it.

cache_config.set_dir(cache_dir, level=Config.LEVEL_LOCAL)
repo.scm.git.close()

if self.installed:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be probably part of the def install

formatter_class=argparse.RawDescriptionHelpFormatter,
)
get_parser.add_argument(
"url", help="See `dvc import-url -h` for full list of supported URLs."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import-url -> get-url

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, it's intentional, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

src = os.path.abspath(url)
out = os.path.abspath(out)

dep, = dependency.loads_from(None, [src])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will it support remote:// protocol? it needs to read a global config for that, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't, at least for now. get-url doesn't care about Repo's at all. I would keep it this way untill someone asks for this feature.

out = out or os.path.basename(urlparse(url).path)

if os.path.exists(url):
src = os.path.abspath(url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src is undefined if not os.path.exists(url) and is referenced below

efiop added a commit to efiop/dvc that referenced this pull request Jun 21, 2019
efiop added a commit that referenced this pull request Jun 21, 2019
dvc: address review from #2160
@efiop efiop added the enhancement Enhances DVC label Jun 21, 2019
@ghost
Copy link

ghost commented Jun 25, 2019

what about backwards compatibility, @efiop ? dvc import -> dvc import-url, if this is already released, should we let know the users somehow?

@efiop
Copy link
Contributor Author

efiop commented Jun 25, 2019

@MrOutis We do let them know with a warning in dvc/command/imp.py.

@ghost
Copy link

ghost commented Jun 25, 2019

True, @efiop 👍

@guysmoilov
Copy link
Contributor

Hey guys, I just tripped all over this when running our tutorial at https://dagshub.com/docs/pipeline/
in preparation for the workshop on DVC we're planning to do on Sunday.
I guess I'm out of date here, but why rename import to import-url instead of giving the new command the new name?
Also, the docs in the main site are out of date: https://dvc.org/doc/commands-reference/import

@guysmoilov
Copy link
Contributor

I would also consider people who may have written shell scripts with dvc import, a warning message would not really be relaxing for them...

@efiop
Copy link
Contributor Author

efiop commented Jun 26, 2019

@guysmoilov Thanks for the feedback! We've decided to rename it so that a more powerful repo-import feature would have a better name(we've also introduced new dvc get command for downloading from repos, and it felt weird having it in pair with repo-import or import-repo, so we've decided to sacrifice import-url). Sorry for the inconvenience. We've added a warning and bumped the version to something significant(not a major version though 🙁) to help somewhat mitigate that, but it was clearly not enough.

As to docs, we are working on it right now. We've decided to do a release anyway, because there were a lot of important features/bugfixes stacked up already. Also we felt like we were ready to collect some feedback about new features.

@ghost
Copy link

ghost commented Jun 26, 2019

Agree, @guysmoilov ! @efiop , maybe writing something in the #announcements channel on Discord?

@ghost
Copy link

ghost commented Jun 26, 2019

@shcheklein just did it 😅

@shcheklein
Copy link
Member

@MrOutis @efiop I have posted an announcement. @guysmoilov sorry for the confusion and inconvenience :( It was not an easy decision.I really hope that you will try the new set of commands that are in a preview mode - import and get. I think they alone can create lot of value to users and enable really great use cases around them.

As for the documentation update - it's in progress. Import will be renamed in a few hours.

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Jun 29, 2019

Probably too late but I agree with Guy. Reusing a previous command name for a similar feature as before seems really confusing and unnecessary. There's an endless number of other words that could've been used. Anyway, probably not the end of the world and I'm sure there was a deep discussion about it and good reasons to do it so, moving on... Working on the full doc updates in PR iterative/dvc.org#464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances DVC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants