mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
remote: allow AZURE cache
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user