我有一台Linux机器和一台Windows机器用于开发。为了进行数据共享,我们在另一台Windows机器上设置了一个共享Windows目录,我的Linux和Windows都可以访问该目录。
我现在使用DVC对共享数据进行版本控制。为了简单起见,我在Windows和Linux开发机器中安装了共享Windows文件夹。在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在DVC配置文件中具有相同的ùrl?
如果这是不可能的,DVC是否还有另一种解决方案将数据保存在远程共享Windows文件夹中?谢谢。
发布于 2022-01-03 03:08:55
如果您以这种方式使用本地远程,您将无法在两个平台上使用相同的url,因为挂载点是不同的(正如您已经意识到的)。
配置这一点的最简单方法是选择一个(Linux或Windows) url作为默认情况,将git提交到.dvc/config中。在另一个平台上,您(或您的用户)可以在本地配置文件:.dvc/config.local中覆盖该.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 remote modify --local的DVC文档:
https://stackoverflow.com/questions/70560288
复制相似问题