def _init_odb(self, name): from dvc.fs import get_cloud_fs from dvc.objects.db import get_odb cls, config, path_info = get_cloud_fs(self.repo, name=name) config["tmp_dir"] = self.repo.tmp_dir return get_odb(cls(**config), path_info, **config)
def _init_odb(self, name): from dvc.fs import get_cloud_fs from dvc.objects.db import get_odb cls, config, fs_path = get_cloud_fs(self.repo, name=name) config["tmp_dir"] = self.repo.index_db_dir return get_odb(cls(**config), fs_path, **config)
def __init__(self, fs, path_info, tmp_dir, **config): from dvc.objects.db import get_odb self.fs = fs config["tmp_dir"] = tmp_dir self.odb = get_odb(self.fs, path_info, **config) url = getattr(path_info, "fspath", path_info.url) index_name = hashlib.sha256(url.encode("utf-8")).hexdigest() self.index = self.INDEX_CLS( tmp_dir, index_name, dir_suffix=self.fs.CHECKSUM_DIR_SUFFIX )
def init_cache(self, dvc: "Repo", rev: str, run_cache: bool = True): from dvc.objects.db import ODBManager, get_odb from dvc.repo import Repo from dvc.repo.push import push cache_path = posixpath.join( self._repo_abspath, Repo.DVC_DIR, ODBManager.CACHE_DIR, ) with self.sshfs() as fs: odb = get_odb(fs, cache_path, **fs.config) push(dvc, revs=[rev], run_cache=run_cache, odb=odb)
def __init__(self, fs, tmp_dir, **config): from dvc.objects.db import get_odb self.fs = fs self.odb = get_odb(self.fs, **config) url = config.get("url") if url: index_name = hashlib.sha256(url.encode("utf-8")).hexdigest() self.index = self.INDEX_CLS(tmp_dir, index_name, dir_suffix=self.fs.CHECKSUM_DIR_SUFFIX) else: self.index = RemoteIndexNoop()