Skip to content

import: get from source project cache if url/path are in the local system #2599

@jorgeorpinel

Description

@jorgeorpinel

UPDATE: Jump to #2599 (comment) (notice also #2599 (comment))

DVC version: 0.62.1
Python version: 3.7.3
Platform: Darwin-18.7.0-x86_64-i386-64bit
Binary: False
Filesystem type (workspace): ('apfs', '/dev/disk1s1')

I create a DVC project in /path/to/data-reg and dvc add a data/ directory in it.

Then I create another DVC project in /path/to/project in the same file system and try to import data/ but get:

$ dvc import /path/to/data-reg data
Importing 'data (../data-reg-test)' -> 'data'
Missing cache for directory '../../../../private/var/folders/_c/3mt_xn_d4xl2ddsx2m98h_r40000gn/T/tmpkq6tyek3dvc-repo/data'.
Cache for files inside will be lost. Would you like to continue? Use '-f' to force. [y/n] y
ERROR: failed to import 'data' from '/path/to/data-reg'. - config file error: no remote specified. Setup default remote with
    dvc config core.remote <name>
or use:
    dvc pull -r <name>


Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

A few problems:

  • The first part of the message is completely mysterious to me. I don't understand what cache dir is missing and obviously that path isn't friendly.
  • I also don't know what it's asking me to confirm so I just say y and move on 😋
  • The "no remote specified" is also kind of cryptic (doesn't specify which project is missing a remote) but OK, I get it: I didn't push data/ to a remote in the first project, so the new project can't download it. However (main point of this issue) it could simply copy it from the source project's cache, since they're on the same file system. This would be a nice-to-have feature I think. In fact it should probably try this before the default remote, for performance.
  • There's 2 new lines after dvc pull -r <name> in the error output.

UPDATE: Moved all the UI-related stuff to #2602 (per Ivan's #2599 (comment) below).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhances DVCp2-mediumMedium priority, should be done, but less important

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions