Commit Graph
56 Commits
Author SHA1 Message Date
Clemens Wolff 6882a781a4 Add Azure Blob Storage remote
This change adds a new cloud remote based on Azure Blob Storage [1] and
the azure-storage-blob SDK [2].

The implementation closely follows the patterns laid out by the existing
cloud remotes (AWS and GCP). Notable differences include:

- No use of a lock in the progress-bar callback and no requirement to
  look up total transfer size ahead of time: the Azure Storage SDK
  provides the total transfer bytes and current transfer offset in its
  progress callback.

- When `exists` is called, check the existence of every blob instead of
  listing the entire container. Container list operations can be
  expensive so unless the number of checked files is very large, making
  separate requests is likely going to be more efficient.

- For increased flexibility, access credentials for the Azure Storage
  backend can be provided either connection-string style via the remote
  URL or via environment variables. The Azure Storage backend can be
  emulated via Azurite [3].

[1] https://azure.microsoft.com/en-us/services/storage/blobs/
[2] https://github.com/Azure/azure-storage-python
[3] https://github.com/Azure/azurite

This change was created together with @EricSchles.
2018-07-09 14:47:40 -04:00
Ruslan Kuprieiev 12edcbaa04 remote: support HDFS for push/pull/status from local repo
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-06-30 22:54:49 +03:00
Ruslan Kuprieiev 555e802ed2 RFC/perf: data cloud logic
Properly splitting jobs between thread workers and removing unnecessary logic.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-06-30 07:44:11 +03:00
Ruslan Kuprieiev c274bfee3e RFC: remove unused code
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-06-22 18:46:09 +03:00
Ruslan Kuprieiev a130a25e39 dvc: refactor data_cloud
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-01-15 21:11:25 +02:00
Ruslan Kuprieiev 1ce2633704 travis: fixups
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-01-11 00:28:09 +02:00
Ruslan Kuprieiev 487eae3f07 test: improve test coverage
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-01-10 17:15:42 +02:00
Ruslan Kuprieiev 96f9c50de8 cloud: fixup for #404
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-01-10 14:34:12 +02:00
Ruslan Kuprieiev 2b6d997fd3 dvc: remove ec2 commands
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-01-10 11:37:16 +02:00
Ruslan Kuprieiev 1c89bb50c5 test: add initial tests for LOCAL and AWS data clouds
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-01-07 22:33:26 +02:00
Ruslan Kuprieiev a779424a36 WIP RFC
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-12-23 09:37:40 +02:00
Ruslan Kuprieiev 7e90522d3f cloud: gcp: decode base64 when comparing files
Otherwise comparison with string fails on Python3, as base64 returns bytes.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-11-02 01:10:13 +02:00
Ruslan Kuprieiev 831f21f555 sync: properly collect and check data items
Fixes #282

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-11-01 22:21:04 +02:00
Ruslan Kuprieiev a813ebaeb7 dvc: use hardlinks instead of symlinks
Fixes #225
Fixes #273

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-10-30 05:05:28 +02:00
Ruslan Kuprieiev 8bb51f5efc cache: use checksums instead of commit_id
From now on, we identify our cache files by their md5sum,
so that we can avoid cache collission in branching scenario
and also dedup same data at the same time.

Fixes #250, #251

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-10-17 14:06:43 +03:00
Ruslan Kuprieiev 17f0c0de10 RFC: find and fix errors and some warning reported by pylint
Fixes #219

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-09-17 19:25:03 +03:00
Ruslan Kuprieiev cc2dff765b data: check checksum before pulling data
Fixes #205

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-09-14 22:24:50 +03:00
Ruslan Kuprieiev 0c561e7f12 google cloud: fix cloud settings and requirements
These are to allow using OAuth with your dvc, as
this is the recomended way to access gcp.

Fixes #203

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-09-14 22:23:22 +03:00
Ruslan Kuprieiev fc901c03ed pull: create dirs before pulling
Fixes #201

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-09-13 21:17:28 +03:00
Ruslan Kuprieiev 42d8614837 aws: resume download/upload
Fixes #163

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-09-01 23:02:45 +03:00
Ruslan Kuprieiev 9d9a91d55d data: remove redundant code
Aws credentials are now managed by dvc/cloud/creds_aws.py

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-26 11:20:36 +03:00
Ruslan Kuprieiev fcaccfabcd data_cloud: fix cloud config for testing
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-23 22:05:46 +03:00
Dmitry Petrov 6c74a85150 Fix last merge issues 2017-08-23 01:46:36 -07:00
Dmitry Petrov 4befe3f7c6 Manual merge 2017-08-23 00:48:27 -07:00
Dmitry Petrov ee0e012f86 Config redesign 2017-08-23 00:38:28 -07:00
Ruslan Kuprieiev 6430982ef0 aws: fix progress and chunk size for multipart upload
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-21 08:30:06 +03:00
Ruslan Kuprieiev 04e66f94fc aws: use multipart to push changes, v2
Fixes #100

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-20 19:04:58 +03:00
Ruslan Kuprieiev 90762da18f cloud: fix typo
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-20 17:58:34 +03:00
Ruslan Kuprieiev 163558c9c2 Revert "aws: use multipart to push changes" 2017-08-20 17:55:23 +03:00
Ruslan Kuprieiev 78cad172c6 aws: use multipart to push changes
Fixes #100.
2017-08-20 16:12:38 +03:00
Ruslan Kuprieiev eb533f9a9c RFC: fix issues reported by codeclimate
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-20 04:53:13 +03:00
Ruslan Kuprieiev c3a43c6d84 cloud: return data_item in sync/pull/push/import
This will help us distinguish if target was processed successfully.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-19 20:10:52 +03:00
Ruslan Kuprieiev 149c921576 dvc: add status command
This command shows status for data files. I.e.

    $ dvc status data/
        new file:       .cache/Posts-train.tsv_2ccd8e7
        new file:       data/llss
        modified:       .cache/Posts.xml_512a612
        new file:       .cache/empty_0000000
        new file:       data/oss
        new file:       .cache/matrix-test.p_69b924d
        new file:       .cache/dir21111/Posts.xml.tgz_cd71d01

so it will tell us if there are any new/modified/deleted data
files that you might want to push/pull/etc.

Fixes #158

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-19 20:10:24 +03:00
Ruslan Kuprieiev 5f7f608529 import: import from clouds
From now on, 'dvc import' supports s3 and gcp links.
This patch also does some RFC to properly parse url's
scheme using urllib instead of relying on hand-made
regex. Code for downloding files from http urls is moved
to data_cloud.py in preparation for pull/push support
for http/https/ftp schemes in the future.
Also added dummy progress updates(start/finish) for gcp,
as i couldn't find an API call that allows callbacks to
update progress properly.

Fixes #49

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-19 20:10:10 +03:00
Ophir Yoktan c21261b69f return empty md5 if file doesnt exist 2017-08-14 23:27:05 +03:00
Ruslan Kuprieiev 178834e572 cloud: aws: check md5 when pulling data
Currently dvc downloads data from cloud even if we already
have the same file downloaded. This patch fixes it by checking
md5 before attempting to download.

Fixes #159

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-12 22:51:16 +03:00
Ruslan Kuprieiev f21defdc68 RFC: cloud: rename methods
New names fit much better:

    sync_to_cloud     -> push
    sync_from_cloud   -> pull
    remove_from_cloud -> remove

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-12 22:44:20 +03:00
Ruslan Kuprieiev db43e6bc91 dvc: add pull/push commands
We already have 'sync' command, but users report it to be confusing
when both local and remote files exist, so lets introduce two direct
commands to implicitly push and pull from cloud.

Fixes #157.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-12 22:44:10 +03:00
Ruslan Kuprieiev a234311980 sync/cloud: move target logic to DataCloud
This should come in handy for pull and push commands.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-12 19:44:17 +03:00
Dmitry Petrov 5c062aadaf Extract AWS credentials from data_cloud.py 2017-08-04 19:30:04 -07:00
Dmitry Petrov 2eae3d1af8 Clean data cloud code. Utils logger bugfix 2017-07-31 02:38:18 -07:00
Ruslan Kuprieiev ee34fdfa31 RFC: move cmdline parsing to cli.py and settings RFC
This will make the structure of dvc more linear
making it easier to read. Plus, these changes
are needed in preparation for libdvc, as they
move all cmdline parsing to one common place.

This patch also refactors our settings system
also make it more linear and remove abstraction
levels that are not needed and only cause confusion.
There is a lot more to be done in preparation for
dvc lib and RFC overall, but this a first step
in that long journey.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-07-31 01:39:32 +03:00
Ophir Yokatan fc9e091286 download file to temp file, and renmae only if success 2017-07-14 00:17:43 +03:00
Ophir Yokatan ba845878c0 fix typo 2017-07-04 17:11:24 +03:00
Ophir Yokatan b304786f1b Handle missing credentials file 2017-07-04 17:06:45 +03:00
Ruslan Kuprieiev 27bf57f415 sync: handle exceptions
I.e. if network is gone for some reason, report that we're
able to sync some targets instead of just throwing exceptions
about broken pipe or something.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-07-03 02:12:54 +03:00
Ruslan Kuprieiev c3ae9c3011 aws: typo fixup
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-07-02 08:13:09 +03:00
Ruslan Kuprieiev c52e561adc aws: don't forget to finish_target() after sync is done
Fixes #101

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-07-02 06:27:12 +03:00
Dmitry Petrov cfa9731b3e Remove uploading info messages 2017-06-28 01:10:17 -07:00
Dmitry Petrov a588d71a83 Small GC changes 2017-06-27 02:53:00 -07:00