Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Azure blob storage as backend #1149

Merged
merged 10 commits into from
Aug 9, 2017
Merged

Add Azure blob storage as backend #1149

merged 10 commits into from
Aug 9, 2017

Conversation

fd0
Copy link
Member

@fd0 fd0 commented Aug 5, 2017

Main work by @diptadas, thank you very much! Successor of #1059

TODO:

Closes #609

@codecov-io
Copy link

codecov-io commented Aug 5, 2017

Codecov Report

Merging #1149 into master will increase coverage by 0.12%.
The diff coverage is 59.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1149      +/-   ##
==========================================
+ Coverage   52.71%   52.83%   +0.12%     
==========================================
  Files         122      124       +2     
  Lines       11454    11728     +274     
==========================================
+ Hits         6038     6197     +159     
- Misses       4708     4807      +99     
- Partials      708      724      +16
Impacted Files Coverage Δ
internal/backend/location/location.go 60% <ø> (ø) ⬆️
cmd/restic/global.go 21.71% <0%> (-1.2%) ⬇️
internal/backend/azure/azure.go 61.92% <61.92%> (ø)
internal/backend/azure/config.go 76.92% <76.92%> (ø)
internal/repository/index.go 65.58% <0%> (-0.8%) ⬇️
internal/archiver/archiver.go 64.73% <0%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c22ff1...c4613c5. Read the comment docs.

@fd0
Copy link
Member Author

fd0 commented Aug 6, 2017

This is good work, thank you @diptadas again! And we need to switch to Go 1.8 at minimum, otherwise a library the Azure lib depends on won't compile. https://golang.org/doc/go1.8#net_http

diptadas and others added 7 commits August 6, 2017 21:47
Environment variables:
AZURE_ACCOUNT_NAME=storage-account-name
AZURE_ACCOUNT_KEY=storage-account-key

Environment variables for test:
RESTIC_TEST_AZURE_ACCOUNT_NAME=storage-account-name
RESTIC_TEST_AZURE_ACCOUNT_KEY=storage-account-key
RESTIC_TEST_AZURE_REPOSITORY=azure:restic-test-container

Init repository:
$ restic -r azure:container-name:/prefix/dir init
@fd0 fd0 merged commit c4613c5 into master Aug 9, 2017
fd0 added a commit that referenced this pull request Aug 9, 2017
Add Azure blob storage as backend
@fd0 fd0 deleted the azure-support branch August 9, 2017 19:31
@flo82
Copy link

flo82 commented Aug 26, 2017

i tested the implementation a little bit. works functionally fine. thank you very much for the merge and pull request :-) excellent work.

i would like to mention one little thing:

the contents of the buckets are different in s3 vs. azure layout. Example:

if using s3 with repository address: RESTIC_REPOSITORY=s3:https://minio:9000/restic
you get a bucket restic and inside the bucket a folder named restic

if using azure with repository address: RESTIC_REPOSITORY=azure:restic:/
you get a bucket restic and inside the bucket there is NO folder named restic. it will start with the repository folders data, index ....

don't know if this right - but in my mind the s3 implementation could be optimized here.

Regarding the performance i got a 50mbit upload of files during the whole backup process. That maxed out my current internet connection and is on par with my current solution through minio in gateway mode. "check" and "prune" are also very fast - these functions seem to depend on the calling CPU owner.

@fd0
Copy link
Member Author

fd0 commented Aug 27, 2017

Yes, the default path within a bucket for s3 is (historically) /restic, for azure it's the path you specify (/ in your example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants