-
Notifications
You must be signed in to change notification settings - Fork 250
[FEATURE REQUEST #32] On-Premises S3 / S3 Compatible... #389
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
...s-core/src/main/java/org/apache/polaris/core/storage/s3/S3CredentialsStorageIntegration.java
Outdated
Show resolved
Hide resolved
...s-core/src/main/java/org/apache/polaris/core/storage/s3/S3CredentialsStorageIntegration.java
Outdated
Show resolved
Hide resolved
dd8d860
to
e2c296b
Compare
@@ -23,6 +23,8 @@ public enum PolarisCredentialProperty { | |||
AWS_KEY_ID(String.class, "s3.access-key-id", "the aws access key id"), | |||
AWS_SECRET_KEY(String.class, "s3.secret-access-key", "the aws access key secret"), | |||
AWS_TOKEN(String.class, "s3.session-token", "the aws scoped access token"), | |||
AWS_ENDPOINT(String.class, "s3.endpoint", "the aws s3 endpoint"), | |||
AWS_PATH_STYLE_ACCESS(Boolean.class, "s3.path-style-access", "the aws s3 path style access"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whether or not to use path-style access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many S3COMPATIBLE solutions are deployed without network devices or configurations in front of them allowing support of dynamic hosts names including buckets.
TLS certificate with private AC could also be a challenge for dynamic host name. "*. domain" can also be forbidden by some enterprise security policy
Path style is useful in many cases. In ideal world I agree it should stay deprecated...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @eric-maynard was asking if we can change the description to something like this:
AWS_PATH_STYLE_ACCESS(Boolean.class, "s3.path-style-access", "the aws s3 path style access"), | |
AWS_PATH_STYLE_ACCESS(Boolean.class, "s3.path-style-access", "whether or not to use path-style access"), |
I also agreed that we should make sure it false
by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For IBM's watsonx.data product it is set to true
by default for Minio and Ceph bucket types, reason being that it's more likely to work. Path style will work regardless of whether the customer has setup wildcard DNS, a TLS certificate with a subject-alternate-name (the wildcard), and the hostname in the zonegroup (for Ceph). Virtual host style will only work if all of those things are done.
It's not a hill I would die on, but it's worthy of consideration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, I was referring to the Polaris scope default. Users always have the option to set it to true when creating a new catalog.
.../org/apache/polaris/core/storage/s3compatible/S3CompatibleCredentialsStorageIntegration.java
Outdated
Show resolved
Hide resolved
.../org/apache/polaris/core/storage/s3compatible/S3CompatibleCredentialsStorageIntegration.java
Outdated
Show resolved
Hide resolved
Yes. I have restored helm from main branch. I have probably done a small test modification and forget it. I'm really confused. |
Thanks @lefebsy . The PR looks now a lot better from helm standpoint. We just need to address last comment from @flyrain to get this PR going 🙂 |
@lefebsy you have a conflict by the way |
# Conflicts: # polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisCredentialProperty.java
=> Hello, the conflict should be resolved since rebased :-) |
Thanks @lefebsy . Can you please address this last comment so we have this PR wrapped up? https://github.com/apache/polaris/pull/389/files#r1980741611 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @lefebsy ! Overall I think it's a valuable addition to Polaris, but I have a couple of concerns.
s3ConfigModel.getS3PathStyleAccess(), | ||
s3ConfigModel.getS3Region(), | ||
s3ConfigModel.getS3RoleArn(), | ||
new ArrayList<>(allowedLocations)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why new
array?
return S3CompatibleStorageConfigInfo.builder() | ||
.setStorageType(StorageConfigInfo.StorageTypeEnum.S3_COMPATIBLE) | ||
.setS3Endpoint(s3Config.getS3Endpoint()) | ||
.setS3ProfileName(s3Config.getS3ProfileName()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these kind of attribute copy blocks of code are easy to mess up by accidental typos... Could you add a unit test for this conversion?
@@ -241,6 +243,7 @@ public void validateMaxAllowedLocations(int maxAllowedLocations) { | |||
/** Polaris' storage type, each has a fixed prefix for its location */ | |||
public enum StorageType { | |||
S3("s3://"), | |||
S3_COMPATIBLE("s3://"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe s3
is sufficient for this PR because AWS also maps to only s3
. Other URIs schemes (like s3a
) are applicable to AWS too, but I think it is best to handle that in a follow-up PR.
if (roleArn.contains("aws-cn")) { | ||
return "arn:aws-cn:s3:::"; | ||
} else if (roleArn.contains("aws-us-gov")) { | ||
return "arn:aws-us-gov:s3:::"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this kind of special cases should not be in Polaris code, but it's ok for this PR as I understand it mimics previous AWS-specific logic.
@Nonnull Set<String> allowedReadLocations, | ||
@Nonnull Set<String> allowedWriteLocations) { | ||
|
||
String caI = System.getenv(storageConfig.getS3CredentialsCatalogAccessKeyId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm strongly opposed to storing credential env. variable name is the storage config (essentially in the catalog config).
The environment and catalog config are different management domains with different concerns.
Using a static env. variable name (e.g. AWS_ACCESS_KEY
) is ok in the short term, IMHO.
Is it strictly necessary to support different secrets for different catalogs in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I shared the same concern, see here https://github.com/apache/polaris/pull/389/files#r1980741611
StaticCredentialsProvider.create(AwsBasicCredentials.create(caI, caS))); | ||
LOGGER.debug("S3Compatible - stsClient using keys from catalog settings"); | ||
} | ||
try (StsClient stsClient = stsBuilder.build()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating an StsClient for each request is an overkill, IMHO, but we can probably refactor that later.
@@ -40,7 +40,7 @@ follows: | |||
|
|||
```shell | |||
./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true --no-build-cache | |||
docker compose -f ./regtests/docker-compose.yml up --build --exit-code-from regtest | |||
docker-compose -f ./regtests/docker-compose.yml up --build --exit-code-from regtest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be unrelated to the purpose of this PR. Please make this change in a separate PR.
- 9000:9000 | ||
volumes: | ||
- ./miniodata:/data | ||
- ./certs:/root/.minio/certs/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this strictly necessary for tests?
* @return A policy limiting scope access | ||
*/ | ||
// TODO - add KMS key access | ||
public static IamPolicy policyString( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not reuse the policy from the code the deals with AWS S3?
@lefebsy : I appreciate your work on this PR, but I'd like to submit an alternative implementation for consideration by the community. Will mention it here, when it's ready. |
Hi @dimas-b , great to know that you will contribute to this as well. Given the PR is WIP for a quite long time, can we merge this first, and make changes later? We can always improve on it and make changes as needed. |
@flyrain :
There are unaddressed concerns with this PR (as commented on specific changes). I believe they need to be resolved before merging. |
Agreed. I meant merge it after comments are addressed. |
@thotz, I'm also waiting for the original author to make the change. |
Hey @lefebsy, do you think we'll be able to revive this? If you're not available we can also copy this into another PR. I think the changes are pretty much ready to go |
I'd prefer not to copy this 1:1 as I have some concerns with some areas of this PR (as commented). If noone is actively working on this, I'd be willing to open another PR for this feature... maybe next week. |
@lefebsy Would love this PR to be merged. |
@lefebsy, @adutra , @metadaddy , @mmgaggle We are waiting for this PR to be merged. One of our customers wants to use MinIO or Dell ECS storage for Polaris. Please let me know if I can contribute to this if it is taking longer than expected. Looking forward to your response. Thank you. |
Hello, I started this PR 6 months ago, and did not realize that the review process would be so time consuming, that each new review would ask to explain the changes required during the previous review or the previous commenter, or add tests on existing code etc.. Unfortunately, since some weeks I no longer have the ability to devote more personal time to these round trips. Mabe it would be preferable to close or remove this PR. I hope not everything is to throw away. If Dimas-b wants to make another better implementation : +1 |
No worries @lefebsy! I'm sad to hear that you can't carry the PR forward but I'm thankful for your contributions so far. This is a feature I know a lot of users are excited about and it's unfortunate that it turned out to be so contentious. @dimas-b, I'll keep an eye out for your PR, thanks for offering to pick this up. |
@eric-maynard I am one of those users, I would be incredibly disappointed to see this PR be lost. I have been following it for weeks if not months at this point. |
Thanks for your contribution @lefebsy !.. even if this PR does not get merged |
I started related, but somewhat indirect refactoring in #1504 |
Description (edited) :
This is a S3 proposition of Polaris core storage implementation, copy of the aws + new parameters : endpoint, path style...
It is tested OK with :
This should works with many S3 compatible solutions like Dell ECS, NetApp StorageGRID, etc...
By default it is trying to respect the same behavior about credentials than AWS (IAM/STS). The same dynamic policy is applied, limiting the scope to the data queried.
Otherwise if STS is not available 'skipCredentialSubscopingIndirection' = true will disabling Polaris "SubScoping" of the credentials
Let me know your opinion about this design proposal.
Thank you
Included Changes:
Type of change:
Checklist:
Please delete options that are not relevant.