remote: allow AZURE cache

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-07-11 22:27:13 +03:00
parent d24457c14f
commit 716c554b93
4 changed files with 7 additions and 1 deletions
+1
View File
@@ -30,6 +30,7 @@ class Cache(object):
self.gs = self._get_remote(project, config, Config.SECTION_CACHE_GS)
self.ssh = self._get_remote(project, config, Config.SECTION_CACHE_SSH)
self.hdfs = self._get_remote(project, config, Config.SECTION_CACHE_HDFS)
self.azure = self._get_remote(project, config, Config.SECTION_CACHE_AZURE)
def _get_remote(self, project, config, name):
from dvc.remote import Remote
+2
View File
@@ -46,12 +46,14 @@ class Config(object):
SECTION_CACHE_GS = 'gs'
SECTION_CACHE_SSH = 'ssh'
SECTION_CACHE_HDFS = 'hdfs'
SECTION_CACHE_AZURE = 'azure'
SECTION_CACHE_SCHEMA = {
schema.Optional(SECTION_CACHE_LOCAL): str,
schema.Optional(SECTION_CACHE_S3): str,
schema.Optional(SECTION_CACHE_GS): str,
schema.Optional(SECTION_CACHE_HDFS): str,
schema.Optional(SECTION_CACHE_SSH): str,
schema.Optional(SECTION_CACHE_AZURE): str,
# backward compatibility
schema.Optional(SECTION_CACHE_DIR, default='cache'): str,
+3
View File
@@ -307,6 +307,9 @@ class Project(object):
if self.cache.hdfs:
self.cache.hdfs.gc(clist)
if self.cache.azure:
self.cache.azure.gc(clist)
def push(self, target=None, jobs=1, remote=None, all_branches=False):
self.cloud.push(self._used_cache(target, all_branches)['local'], jobs, remote=remote)
+1 -1
View File
@@ -211,7 +211,7 @@ class RemoteAzure(RemoteBase):
progress.finish_target(name)
def gc(self, checksum_infos):
used_etags = [info[self.PARAM_ETAG] for info in checksum_infos]
used_etags = [info[self.PARAM_ETAG] for info in checksum_infos['azure']]
all_blobs = self.blob_service.list_blobs(self.bucket)