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

Set S3 endpoint region and support OCI object storage #14134

Merged
merged 9 commits into from Oct 6, 2021

Conversation

LuQQiu
Copy link
Contributor

@LuQQiu LuQQiu commented Sep 22, 2021

What changes are proposed in this pull request?

Fixes #14133

Why are the changes needed?

Solves the issue that S3 cannot recognize endpoint region and supports OCI object storage

Does this PR introduce any user facing changes?

add an s3 region property key

@alluxio-bot alluxio-bot added the API Change Changes covering public API label Sep 22, 2021
@codecov-commenter
Copy link

codecov-commenter commented Sep 22, 2021

Codecov Report

Merging #14134 (f184ca6) into master (fc0cc6f) will decrease coverage by 0.17%.
The diff coverage is 37.25%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #14134      +/-   ##
============================================
- Coverage     43.25%   43.08%   -0.18%     
- Complexity     9209     9294      +85     
============================================
  Files          1428     1437       +9     
  Lines         82577    83676    +1099     
  Branches       9987    10131     +144     
============================================
+ Hits          35717    36049     +332     
- Misses        43894    44636     +742     
- Partials       2966     2991      +25     
Impacted Files Coverage Δ
...ster/meta/RetryHandlingMetaMasterMasterClient.java 0.00% <0.00%> (ø)
...luxio/client/job/RetryHandlingJobMasterClient.java 9.52% <0.00%> (ø)
...va/alluxio/master/file/FileSystemMasterClient.java 0.00% <0.00%> (ø)
...luxio/worker/job/RetryHandlingJobMasterClient.java 0.00% <0.00%> (ø)
...o/client/table/RetryHandlingTableMasterClient.java 0.00% <0.00%> (ø)
...n/java/alluxio/underfs/s3a/S3AUnderFileSystem.java 18.25% <0.00%> (-1.58%) ⬇️
...e/common/src/main/java/alluxio/AbstractClient.java 59.47% <100.00%> (-12.90%) ⬇️
...common/src/main/java/alluxio/conf/PropertyKey.java 99.41% <100.00%> (-0.04%) ⬇️
.../security/authentication/ChannelAuthenticator.java 80.00% <100.00%> (ø)
...src/main/java/alluxio/util/ConfigurationUtils.java 72.47% <100.00%> (ø)
... and 94 more

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 0a5669c...f184ca6. Read the comment docs.

@LuQQiu LuQQiu changed the title Set S3 endpoint region [WIP] Set S3 endpoint region Sep 23, 2021
@LuQQiu LuQQiu changed the title [WIP] Set S3 endpoint region Set S3 endpoint region and support OCI object storage Oct 1, 2021
@LuQQiu
Copy link
Contributor Author

LuQQiu commented Oct 1, 2021

@yuzhu PTAL, thanks!

Copy link
Contributor

@ggezer ggezer left a comment

Choose a reason for hiding this comment

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

Thanks! just few minor asks...

.standard()
.withCredentials(credentials)
.withClientConfiguration(clientConf)
.withPathStyleAccessEnabled(Boolean.parseBoolean(conf
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't want to override whatever is the default if withPathStyleAccessEnabled is not called.
So ideally, not even call withPathStyleAccessEnabled when Boolean.parseBoolean(conf.get(PropertyKey.UNDERFS_S3_DISABLE_DNS_BUCKETS) is false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! Only set when alluxio conf is set that property, PTAL, thanks

String region;
if (conf.isSet(PropertyKey.UNDERFS_S3_ENDPOINT_REGION)) {
region = conf.get(PropertyKey.UNDERFS_S3_ENDPOINT_REGION);
} else if (!ServiceUtils.isS3USStandardEndpoint(endpoint)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain this a little bit more in comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, reorganize the code to make it more clear.
If ends with s3.amazonaws.com, that's the standard endpoint with default region so no need to set region

@LuQQiu
Copy link
Contributor Author

LuQQiu commented Oct 5, 2021

@ggezer Thanks for the review! Addressed all the comments, PTAL

.get(PropertyKey.UNDERFS_S3_DISABLE_DNS_BUCKETS)));
.withClientConfiguration(clientConf);

if (conf.isSet(PropertyKey.UNDERFS_S3_DISABLE_DNS_BUCKETS)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It'll always be set because it has a default value defined. So this if statement is redundant.
Earlier we were calling withPathStyleAccessEnabled only if it was set and true.

@LuQQiu
Copy link
Contributor Author

LuQQiu commented Oct 5, 2021

@ggezer Addressed the comments, PTAL, thanks!

Copy link
Contributor

@ggezer ggezer left a comment

Choose a reason for hiding this comment

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

Thanks for this new capability!

@LuQQiu
Copy link
Contributor Author

LuQQiu commented Oct 6, 2021

alluxio-bot, merge this please

@alluxio-bot alluxio-bot merged commit 36a4d5c into Alluxio:master Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Change Changes covering public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Oracle cloud infrastructure (OCI) object storage with S3 client
4 participants