Skip to content

[driver/s3] Use aws/aws-sdk-go instead of goamz for s3 driver and cloudfront - #1385

Merged
BrianBland merged 1 commit into
distribution:masterfrom
BrianBland:s3UseAWSLibrary
Feb 16, 2016
Merged

BrianBland merged 1 commit into
distribution:masterfrom
BrianBland:s3UseAWSLibrary

Conversation

@BrianBland

Copy link
Copy Markdown
Contributor

I didn't change any of the s3 driver logic, only the s3 client calls to use this other library.

Caveats: V2 auth not supported, EC2 file credentials untested, cloudfront untested.

Some very unscientific tests show a 45% time reduction for running the s3 driver tests on my local computer as compared to master, and a 40% time reduction as compared to #1381 (connection pooling enabled).

@stevvooe

Copy link
Copy Markdown
Collaborator

@BrianBland Great looking numbers.

Would it be a good idea to adopt this as a separate, experimental driver (say, aws-s3) so we don't force people over immediately?

@dmp42

dmp42 commented Jan 22, 2016

Copy link
Copy Markdown
Contributor

Definitely +1 on not forcing the new code on people.

Either a new, differently named driver, or a flag/config value in the existing driver (legacyCode: true) that would toggle it, and that we can default to false in the future.

@stevvooe

Copy link
Copy Markdown
Collaborator

Definitely +1 on not forcing the new code on people.

Not initially. We just don't know how stable this is. Long term, I don't want us to maintain two copies. 😸

@dmp42

dmp42 commented Jan 23, 2016

Copy link
Copy Markdown
Contributor

Long term, I don't want us to maintain two copies.

Surely not :) - as soon as the "new" one would be stable enough, the other one would instantly become "unmaintained, use as-is" (though still available for some time so people have time to migrate away).

@dmp42 dmp42 mentioned this pull request Jan 25, 2016
15 of 25 tasks
@BrianBland

Copy link
Copy Markdown
Contributor Author

After fixing the connection pooling in docker/goamz, the performance wins in this client change are no longer statistically significant in my testing. Whereas this does seem to have a much better v4 auth implementation, I'd rather stick with the known functional s3 client (goamz) over the auto-generated aws-sdk-go for now.

@BrianBland

Copy link
Copy Markdown
Contributor Author

Updated to keep both s3 drivers, registers new one as "s3" and "s3aws", registers old driver as "s3goamz"

@codecov-io

Copy link
Copy Markdown

Current coverage is 50.36%

Merging #1385 into master will decrease coverage by -6.69% as of 1319be2

@@            master   #1385   diff @@
======================================
  Files          123     124      +1
  Stmts        11439   12013    +574
  Branches       803     727     -76
  Methods          0       0        
======================================
- Hit           6527    6050    -477
+ Partial        803     727     -76
- Missed        4109    5236   +1127

Review entire Coverage Diff as of 1319be2


Uncovered Suggestions

  1. +0.26% via ...ge/driver/gcs/gcs.go#182...213
  2. +0.23% via ...river/s3-goamz/s3.go#166...193
  3. +0.23% via ...river/s3-goamz/s3.go#113...140
  4. See 7 more...

Powered by Codecov. Updated on successful CI builds.

@aaronlehmann

Copy link
Copy Markdown

Looks like hundreds of the files being added in this PR are from the corpus of the fuzz test for go-jmespath. Is there any sane way to have godeps exclude these test fixtures? If not, maybe this is a good opportunity to switch to native Go 1.5+ vendoring (vendor subdir).

@BrianBland

Copy link
Copy Markdown
Contributor Author
Godep does not copy:
files from source repositories that are not tracked in version control.
*_test.go files.
testdata directories.

Maybe we can make a PR to go-jmespath to move the test data into a testdata directory?
jmespath/go-jmespath#19

@BrianBland

Copy link
Copy Markdown
Contributor Author

@aaronlehmann vendoring fix upstreamed through go-jmespath -> aws-sdk-go via aws/aws-sdk-go#538

@aaronlehmann

Copy link
Copy Markdown

Nice, that was fast.

@BrianBland

Copy link
Copy Markdown
Contributor Author

Yeah, this really helps boost confidence in using this library instead of goamz

@BrianBland BrianBland changed the title [experimental] Use aws/aws-sdk-go instead of goamz for s3 driver and cloudfront [driver/s3] Use aws/aws-sdk-go instead of goamz for s3 driver and cloudfront Feb 3, 2016
@RichardScothern

Copy link
Copy Markdown

rebase please 💳

@BrianBland

Copy link
Copy Markdown
Contributor Author

Rebased

@RichardScothern

Copy link
Copy Markdown

This will need another rebase to pick up the build fix. 😿

@BrianBland
BrianBland force-pushed the s3UseAWSLibrary branch 2 times, most recently from da9c0e5 to 3c36dd3 Compare February 10, 2016 01:52
@BrianBland

Copy link
Copy Markdown
Contributor Author

Added support for custom UA strings, storage classes (reduced redundancy)

@RichardScothern

Copy link
Copy Markdown

LGTM

This PR also uses aws-sdk-go for cloudfront URL generation for which we don't test. It might be a good idea to have a fallback somehow or verify the URLs are the same as before. I'll leave that up to you.

@BrianBland

Copy link
Copy Markdown
Contributor Author

Good call, still working on testing the cloudfront signer now

@BrianBland

Copy link
Copy Markdown
Contributor Author

@RichardScothern confirmed cloudfront middleware is working, also added a bit of extra code for handling incomplete "baseurl" fields (adding the scheme and trailing slash)

@dmcgowan

Copy link
Copy Markdown
Collaborator

registry/storage/driver/s3-aws/s3.go:4

// This package leverages the AdRoll/goamz client library for interfacing with
// s3.

Keeps old s3 driver, renames to s3goamz, registers new s3 driver as both
"s3" and "s3aws"

Changes cloudfront middleware to use aws-sdk-go

Signed-off-by: Brian Bland <[email protected]>
@BrianBland

Copy link
Copy Markdown
Contributor Author

@dmcgowan updated package comments for both S3 drivers

@dmcgowan

Copy link
Copy Markdown
Collaborator

LGTM

BrianBland added a commit that referenced this pull request Feb 16, 2016
[driver/s3] Use aws/aws-sdk-go instead of goamz for s3 driver and cloudfront
@BrianBland
BrianBland merged commit b9907c4 into distribution:master Feb 16, 2016
@BrianBland
BrianBland deleted the s3UseAWSLibrary branch February 16, 2016 19:19
thaJeztah pushed a commit to thaJeztah/distribution that referenced this pull request Apr 22, 2021
[driver/s3] Use aws/aws-sdk-go instead of goamz for s3 driver and cloudfront
thaJeztah pushed a commit to thaJeztah/distribution that referenced this pull request Jan 19, 2022
[driver/s3] Use aws/aws-sdk-go instead of goamz for s3 driver and cloudfront
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.

8 participants