Commit Graph
83 Commits
Author SHA1 Message Date
Saugat Pachhai 2859b53cae dvc: fix typo in data_cloud.py module docstring 2019-11-24 15:38:54 +05:45
Ruslan Kuprieiev 95fe1578bb dvc: automatically reorder imports 2019-11-05 02:34:40 +02:00
Alexander Schepanovski 33b0eefec0 dvc: dedup used cache (#2630)
* dvc: dedup used cache

This is a preparation step to make garbage collector work with more
commits. It has a value of its own:
- less exists calls to show cloud status or prepare push/pull
- same names are not repeated in status and pbar texts

* dvc: delay checksum names concatenation
2019-10-21 12:12:56 +03:00
Alexander Schepanovski 4006c6434e dvc: remove dead code in DataCloud 2019-09-23 20:00:19 +07:00
Mr. OutisandRuslan Kuprieiev ae90904fb3 pull: download data from imported stages (#2499)
* wip - pull is working

* use fetch instead of reproduce

* test pull and fetch

* style changes

* fetch: catch config error on fetch instead of get_remote

* output: remove unused guard clause

* fetch: define a more specific error instead of ConfigError

* fetch: display number of errors correctly

* exceptions: remove "Failed" prefix to download/upload

* fetch: catch other exceptions that might halt the download

* fetch: log catched exceptions

* fetch: reformat exception

Co-Authored-By: Ruslan Kuprieiev <[email protected]>

* fix formatting
2019-09-22 01:28:12 +03:00
pawel 14c4a9c52f data_cloud: remove backward compatibilty on get_remote 2019-07-17 23:02:13 +02:00
Ruslan Kuprieiev 9e9e078de3 config: move logic from CLI to API
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2019-06-06 14:41:02 +03:00
Ruslan Kuprieiev 31848d5c7f remote: support remote:// notation for push/pull/gc
Fixes #2066

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2019-05-29 12:54:31 +03:00
Alexander Schepanovski ca93dbcf13 dvc: add get_url()/open() API
As a part of this:
- DataCloud._cloud was refactored into `.get_remote()`
- data stopped using internal _cloud
- added a parametrization for remote tests
2019-05-27 17:56:31 +07:00
Ruslan Kuprieiev b4143b19dd remote: unify class names
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2019-05-12 17:29:38 +03:00
nanaya-tachibana 7ceaf88c54 remote: add support for aliyun oss (#1961)
* remote: add support for aliyun oss

Usage:
$ dvc remote add myremote oss://my-bucket.endpoint/path
Set key id and key secret using modify command
$ dvc remote modify myremote oss_key_id my-key-id
$ dvc remote modify myremote oss_key_secret my-key-secret
or environment variables
$ export OSS_ACCESS_KEY_ID="my-key-id"
$ export OSS_ACCESS_KEY_SECRET="my-key-secret"

Ref:
oss python SDK: https://www.alibabacloud.com/help/doc-detail/32026.htm

* Not needed, since we don't support external dependencies/outputs on OSS.
See https://github.com/iterative/dvc/pull/1961.

* Add a way to test oss storage using docker.

Start a container running an oss emulator.
$ git clone https://github.com/nanaya-tachibana/oss-emulator.git
$ docker image build -t oss:1.0 oss-emulator
$ docker run --detach -p 8880:8880 --name oss-emulator oss:1.0
Setup environment variables.
$ export OSS_BUCKET='my-bucket'
$ export OSS_ENDPOINT='localhost:8880'
$ export OSS_ACCESS_KEY_ID='AccessKeyID'
$ export OSS_ACCESS_KEY_SECRET='AccessKeySecret'

* Use default key id and key secret when they are not given,
which gives read access to public read bucket and public bucket.

* test: add oss tests to appveyor.

* remove unneeded tests.

* remote: use s3 style url for oss storage and make endpoint a configurable value.

Usage:
$ dvc remote add myremote oss://my-bucket/path
Set key id, key secret and endpoint using modify command
$ dvc remote modify myremote oss_key_id my-key-id
$ dvc remote modify myremote oss_key_secret my-key-secret
$ dvc remote modify myremote oss_endpoint endpoint
or environment variables
$ export OSS_ACCESS_KEY_ID="my-key-id"
$ export OSS_ACCESS_KEY_SECRET="my-key-secret"
$ export OSS_ENDPOINT="endpoint"

* remote: fallback to [] if there are no cinfos

Signed-off-by: Ruslan Kuprieiev <[email protected]>

* test: remote: add oss CLI test

Signed-off-by: Ruslan Kuprieiev <[email protected]>

* travis: use iterative's fork of oss-emulator

Just to keep things in-house.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2019-05-09 15:35:41 +03:00
Mr. Outis 29f58bda9b status: optimization for already downloaded files
Fix #1839
2019-04-30 17:09:04 -07:00
Mr. Outis 85cd344152 logger: Use a more _pythonic_ logging
- Uses a formatter for coloring output
- Move the `progress_aware` decorator logic to the logger itself
- Refactor modules so each one uses their own instance of a logger

Close #1753
2019-04-06 18:19:32 -06:00
Ruslan Kuprieiev ba8d83e9b1 dvc: refactor dvc project class
1) split Project's methods into separate files;
2) rename Project into Repo(similar to gitpython's Repo)

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2019-02-13 03:31:23 +02:00
Paweł Redzyński 31426c1548 data cloud: lowercase remote name to match config values (#1575) 2019-02-04 22:49:15 +02:00
Ruslan Kuprieiev 4069e34130 dvc: use black instead of flake8
Fixes #1546

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2019-01-30 03:48:36 +02:00
Mr. Outis 0d46921ec7 py2: add unicode literals
Fix #1512
2019-01-27 20:40:21 -06:00
Ruslan Kuprieiev 6fec8b16cd RFC: conform to pylint
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2019-01-16 14:12:19 +02:00
Ruslan Kuprieiev 484f318c27 remote: local: support relative paths
Fixes #1421

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2019-01-04 21:14:03 +02:00
Mr. Outis 4c420d5f4d logger [rfc]: Use a module instead of a class
- Remove deprecation warnings
- Format error output and remove duplicated info

Close #1086
2018-12-23 21:06:39 -06:00
Ruslan Kuprieiev e02a33f934 logger: shortcut logger in quiet and normal modes
In scenarios with millions of files, late shorcutting of
debug msgs results in massive overhead. In order to avoid
that, just shortcut logger messages ASAP if verbose mode
is not enabled.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-12-11 12:07:28 +02:00
Ruslan Kuprieiev 75ab3074a1 dvc: dynamically load default cloud
Fixes #1390

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-12-01 01:45:18 +02:00
Mr. Outis 1e3d752917 remote: HTTP implemented (support only for downloading) (#1350)
* remote: HTTP implemented (support only for downloading)

* Remove duplicated content in the schema

* Chomp trailing spaces in test_remote

* remote http: Implement pull/fetch

* add some tests

* Update dvc/remote/http.py

Co-Authored-By: mroutis <[email protected]>

* Update dvc/remote/http.py

Co-Authored-By: mroutis <[email protected]>

* correct test

* rehprase error message

* add __init__ for utils

* try to fix windows test
2018-11-24 21:22:05 +02:00
Ruslan Kuprieiev 78a20a3895 remote: properly check reqs for a legacy config
Fixes #1231

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-10-18 03:12:47 +03:00
Ruslan Kuprieiev b261554818 dvc: remote: format "No Remote repository" error
Fixes #988

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-08-11 05:37:08 +03:00
Ruslan Kuprieiev 7e4f39d8eb dvc: show filenames in push/pull output
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-07-26 16:50:25 +03:00
Ruslan Kuprieiev 0e9774a3f8 RFC: follow flake8 rules
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-07-25 17:28:58 +03:00
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