Repository navigation
Add local Abfs credential renewal integration test - #1193
Conversation
|
The failure CI caused by the flaky test: [error] Failed: Total 21, Failed 1, Errors 0, Passed 20
[info] Passed: Total 80, Failed 0, Errors 0, Passed 80
[error] Failed tests:
[error] io.unitycatalog.cli.table.CliTableCRUDTest
[info]
[info] ------- Jacoco Coverage Report ------- |
| } | ||
|
|
||
| @Override | ||
| protected String scheme() { |
There was a problem hiding this comment.
This will be overrided in the cloud vendor CredRenewFileSystem, such as S3CredFileSystem, and AbfsCredFileSystem.
| private CredentialsGenerator createCredentialsGenerator(S3StorageConfig config) { | ||
| // Dynamically load and initialize the generator if it's intentionally configured. | ||
| if (config.getCredentialGenerator() != null) { | ||
| if (config.getCredentialsGenerator() != null) { |
There was a problem hiding this comment.
Add the s to match the server property name, please see: https://github.com/unitycatalog/unitycatalog/blob/main/server/src/main/java/io/unitycatalog/server/utils/ServerProperties.java#L101
There was a problem hiding this comment.
actually.. if we have to be grammatically correct ... it should "credentialGenerator"
its like, we say "fruit market", not "fruits market"
so better to fix the property :)
There was a problem hiding this comment.
Thanks for the comment, have the same question before. I choose this because the aws credentials provider use the AwsCredentialsProvider name. Please see https://github.com/unitycatalog/unitycatalog/blob/main/connectors/spark/src/main/scala/io/unitycatalog/spark/auth/AwsVendedTokenProvider.java#L7
That's why I change to credentialsGenerator. For the aws name, seems like it's a provider which will generate many new credentials. that's why they add a s.
I don't have strong opinion about this, if you prefer the credentialGenerator. I can change it.
There was a problem hiding this comment.
The point for me is: we may need a consistent naming.
There was a problem hiding this comment.
100% agree on consistent naming.
since there is precedence on AwsCredentialsProvider, lets go with credentialsGenerator 👍
|
|
||
| @Override | ||
| public AzureCredential generate(CredentialContext ctx) { | ||
| String sasToken = |
There was a problem hiding this comment.
Abstract the original logics into a StaticAzureCredentialsGenerator , from here https://github.com/unitycatalog/unitycatalog/pull/1193/files#diff-10f5b75f81595c1c6d9b410a06b20816f2de9a194813a370407796a04b676de0L42-L51
| } | ||
| } | ||
|
|
||
| class DatalakeCredentialsGenerator implements AzureCredentialsGenerator { |
There was a problem hiding this comment.
Move the Datalake credentials generator process into a DatalakeCredentialsGenerator. the original code is here: https://github.com/unitycatalog/unitycatalog/pull/1193/files#diff-10f5b75f81595c1c6d9b410a06b20816f2de9a194813a370407796a04b676de0L59-L91
| private String clientId; | ||
| private String clientSecret; | ||
| private String credentialsGenerator; | ||
| private boolean testMode; |
There was a problem hiding this comment.
Maybe we can replace the testMode with setting credentialsGenerator to be the StaticAzureCredentialsGenerator from here, but that should be trivial, and can be a seperate PR to address.
ef54ee1 to
e1ee6ae
Compare
| serverProperties.put("s3.bucketPath.0", "s3://" + BUCKET_NAME); | ||
| serverProperties.put("s3.accessKey.0", "accessKey0"); | ||
| serverProperties.put("s3.secretKey.0", "secretKey0"); | ||
| serverProperties.put("s3.sessionToken.0", "sessionToken0"); | ||
| // Customize the test credential generator to issue a new credential every 30-second interval. | ||
| // This allows us to verify whether credential renewal is functioning correctly by checking | ||
| // if the current credential matches the expected time window. | ||
| serverProperties.put("s3.credentialsGenerator.0", AwsCredGenerator.class.getName()); |
There was a problem hiding this comment.
should we be using the server properties constants?
There was a problem hiding this comment.
Yes, it's better to define the server properties constants, and use them everywhere. So that it will always deliver the correct configuration for all places.
I think it can be a separate issue to address all the constant properties.
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
e1ee6ae to
108ec3b
Compare
Signed-off-by: Zheng Hu <[email protected]>
108ec3b to
9f3d12d
Compare
Signed-off-by: Zheng Hu <[email protected]>
|
Retry the CI. |
**PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Backport the [PR change](#1193) of [issue](#1175) to branch-0.3 The backport progress is here: #1163 After merged this #1150, there is no conflict any more. So it's a clean patch. Signed-off-by: Zheng Hu <[email protected]>
**PR Checklist** - [ ] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** This branch is currently based on @openinx's PR #1193 which creates an abstraction for integration tests. **TODO:** update this branch once his PR is merged to main. The delta for this PR can be found here: https://github.com/openinx/unitycatalog/pull/1/files <!-- Please state what you've changed and how it might affect the users. --> --------- Signed-off-by: Zheng Hu <[email protected]> Signed-off-by: TimothyW553 <[email protected]> Co-authored-by: Zheng Hu <[email protected]>
PR Checklist
docsis updatedDescription of changes
The related issue is : #1175, this PR achieved the similar local integration tests that we've did in aws s3. #1123