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

Support for non-Amazon S3 services #356

Merged
merged 19 commits into from
Nov 29, 2017

Conversation

adamstruck
Copy link
Contributor

@adamstruck adamstruck commented Nov 21, 2017

New features:

  • support multiple S3 implementations (ceph, minio, etc)
  • support for S3 URIs of the form s3://<endpoint>/<bucket>/<key>
  • standardized cloud storage backends and e2e tests

Fixes issues:

Known issues:

  • All non amazon S3 backends are hardcoded to use the V2 signing method.

Example config:

Worker:
  Storage:
    AmazonS3:
      Key: ""
      Secret: ""
    GenericS3:
      - Endpoint: "localhost:8080"
        Key: "access_key"
        Secret: "secret_access_key"

storage/local.go Outdated
if !ok {
return fmt.Errorf("local storage does not support put on %s", url)
return fmt.Errorf("Must provided an absolute path")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please ensure the rawurl is included in the final error message, whether here or by the worker code.

storage/local.go Outdated
if !isAllowed(path, local.allowedDirs) {
return fmt.Errorf("Can't access file, path is not in allowed directories: %s", url)
return fmt.Errorf("Can't access file, path is not in allowed directories: %s", path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should stay url (or rawurl) so that the error relates directly to the task message, without transformation.

}

if !l.Supports("/path/to/foo.txt", "/host/path", tes.FileType_FILE) {
t.Fatal("Expected normal file path to be supported")
err = l.Supports("/path/to/foo.txt")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is surprising. I thought we were requiring file://?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change any behavior here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test contrary to this comment? #291 (review)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily. We can support both file URIs and linux style absolute paths. Windows users are just restricted to file URIs.

Either way, we have supported this for a long time now. This PR isn't changing any behavior in the local backend.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, thanks. Filed #364 to clean this up.

storage/swift.go Outdated
var writer io.WriteCloser
var err error

// TODO turn on checkHash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please do turn this on. If I understand correctly, it was previously on and was critical for preventing corrupted files in smc-het.

case Directory:
// Create a done channel.
doneCh := make(chan struct{})
defer close(doneCh)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a strange API choice by minio...

@buchanae
Copy link
Contributor

A few minor issues, but otherwise tons of great work here.

Also, this: rabix/bunny#382 (comment)

@buchanae buchanae merged commit 4f4c8f3 into ohsu-comp-bio:master Nov 29, 2017
@adamstruck adamstruck deleted the generic-s3 branch December 14, 2017 22:17
@buchanae buchanae added this to the 0.5.0 milestone Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants