Skip to content

Commit 819397b

Browse files
committed
Add support for using Azure storage
Adds dds command line tool with the same interface as ddsclient. The `dds` command only works with Azure blob storage. The `azcopy` command is required to upload and download. Additional configuration is required to specify the storage account and bucket(container) where the files will be stored.
1 parent 8b0f889 commit 819397b

21 files changed

Lines changed: 1565 additions & 220 deletions

.circleci/config.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 2
55
jobs:
66
build:
77
docker:
8-
- image: circleci/python:3.6
8+
- image: circleci/python:3.7
99
working_directory: ~/DukeDSClient
1010
steps:
1111
- checkout:
@@ -19,6 +19,7 @@ jobs:
1919
command: |
2020
python3 -m venv venv
2121
. venv/bin/activate
22+
pip install --upgrade pip
2223
python setup.py install
2324
pip install -r devRequirements.txt
2425
pip install coveralls
@@ -36,7 +37,7 @@ jobs:
3637
coverage run --source=ddsc setup.py test
3738
deploy:
3839
docker:
39-
- image: circleci/python:3.6
40+
- image: circleci/python:3.7
4041
steps:
4142
- checkout
4243

ddsc/azure/__init__.py

Whitespace-only changes.

ddsc/azure/__main__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""Duke data service command line project management utility."""
2+
import sys
3+
from ddsc.ddsclient import DDSClient, AZURE_BACKING_STORAGE
4+
from ddsc.exceptions import DDSUserException
5+
6+
7+
def main(args=None):
8+
if args is None:
9+
args = sys.argv[1:]
10+
client = DDSClient(backing_storage=AZURE_BACKING_STORAGE)
11+
try:
12+
client.run_command(args)
13+
except DDSUserException as ex:
14+
if client.show_error_stack_trace:
15+
raise
16+
else:
17+
error_message = '\n{}\n'.format(str(ex))
18+
sys.stderr.write(error_message)
19+
sys.exit(2)
20+
21+
22+
if __name__ == '__main__':
23+
main()

0 commit comments

Comments
 (0)