1

我有一台 Linux 机器和一台 Windows 机器用于开发。对于数据共享,我们在另一台 Windows 机器上设置了一个共享的 Windows 目录,我的 Linux 和 Windows 都可以访问。

我现在使用DVC对共享数据进行版本控制。为了方便起见,我将共享的 Windows 文件夹安装在 Windows 和 Linux 开发机器中。在 Windows 中,它看起来像

 [core]
    analytics = false
    remote = remote_storage
['remote "remote_storage"']
    url = \\my_shared_storage\project_dir

在 Linux 中,它看起来像:

[core]
    analytics = false
    remote = remote_storage
['remote "remote_storage"']
    url = /mnt/mount_point/project_dir

如您所见,Windows 和 Linux 具有不同的挂载点。所以我的问题是:有没有办法让 Windows 和 Linuxùrl在 DVC 配置文件中具有相同的功能?

如果这是不可能的,DVC 是否有另一种替代解决方案将数据保存在远程共享 Windows 文件夹中?谢谢。

4

1 回答 1

2

如果您以这种方式使用本地远程,您将无法url在两个平台上使用相同的安装点,因为安装点不同(正如您已经意识到的那样)。

最简单的配置方法是选择一个(Linux 或 Windows)url作为默认情况,让 git-committed 进入.dvc/config. 在另一个平台上,您(或您的用户)可以覆盖url本地配置文件中的内容:.dvc/config.local.

(请注意,这.dvc/config.local是一个被 git 忽略的文件,不会包含在任何提交中)

因此,如果您希望 Windows 成为默认情况,.dvc/config您将拥有:

 [core]
    analytics = false
    remote = remote_storage
['remote "remote_storage"']
    url = \\my_shared_storage\project_dir

在您的 Linux 机器上,您将添加包含以下内容的文件.dvc/config.local

['remote "remote_storage"']
    url = /mnt/mount_point/project_dir

dvc config --local有关详细信息,请参阅 DVC 文档dvc remote modify --local

于 2022-01-03T03:08:55.767 回答