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

[#5894] feat(iceberg): support Azure account key credential #5938

Merged
merged 5 commits into from
Dec 22, 2024

Conversation

orenccl
Copy link
Collaborator

@orenccl orenccl commented Dec 20, 2024

What changes were proposed in this pull request?

Support Azure account key credential

Why are the changes needed?

Fix: #5894

Does this PR introduce any user-facing change?

No

How was this patch tested?

Unit Test IcebergRESTADLSAccountKeyIT at iceberg 1.6.0

@orenccl orenccl requested a review from FANNG1 December 20, 2024 16:51
@orenccl orenccl self-assigned this Dec 20, 2024
@FANNG1
Copy link
Contributor

FANNG1 commented Dec 21, 2024

LGTM, just one naming issue.

@orenccl orenccl marked this pull request as draft December 21, 2024 08:19
@orenccl orenccl marked this pull request as ready for review December 21, 2024 08:21
@orenccl
Copy link
Collaborator Author

orenccl commented Dec 21, 2024

@FANNG1
I didn't check carefully earlier.

I think we should use ADLSAccountKeyProvider and ADLSAccountKeyCredential. We can use ADLSAccountKeyProvider to generate ADLSAccountKeyCredential.

public class ADLSAccountKeyCredential implements Credential {
  public static final String ADLS_ACCOUNT_KEY_CREDENTIAL_TYPE = "adls-account-key";
  public static final String GRAVITINO_ADLS_STORAGE_ACCOUNT_NAME = "adls-storage-account-name";
  public static final String GRAVITINO_ADLS_STORAGE_ACCOUNT_KEY = "adls-storage-account-key";

CredentialPropertyUtils should recognize it and convert it to Iceberg configuration like this:

@VisibleForTesting static final String ICEBERG_ADLS_ACCOUNT_NAME = "adls.auth.shared-key.account.name";
@VisibleForTesting static final String ICEBERG_ADLS_ACCOUNT_KEY = "adls.auth.shared-key.account.key";

ImmutableMap.of(
  ADLSAccountKeyCredential.GRAVITINO_ADLS_STORAGE_ACCOUNT_NAME,
  ICEBERG_ADLS_ACCOUNT_NAME,
  ADLSAccountKeyCredential.GRAVITINO_ADLS_STORAGE_ACCOUNT_KEY,
  ICEBERG_ADLS_ACCOUNT_KEY);

 if(credential instanceof ADLSAccountKeyCredential) {
   return transformProperties(credential.credentialInfo(), icebergCredentialPropertyMap);
 }

Iceberg use adls.auth.shared-key.account.name, adls.auth.shared-key.account.key, to determine that it will use ADLS.

We could change ADLSCredentialConfig to AzureCredentialConfig, as it's more general.

WDYT?

@FANNG1
Copy link
Contributor

FANNG1 commented Dec 21, 2024

@FANNG1 I didn't check carefully earlier.

I think we should use ADLSAccountKeyProvider and ADLSAccountKeyCredential. We can use ADLSAccountKeyProvider to generate ADLSAccountKeyCredential.

public class ADLSAccountKeyCredential implements Credential {
  public static final String ADLS_ACCOUNT_KEY_CREDENTIAL_TYPE = "adls-account-key";
  public static final String GRAVITINO_ADLS_STORAGE_ACCOUNT_NAME = "adls-storage-account-name";
  public static final String GRAVITINO_ADLS_STORAGE_ACCOUNT_KEY = "adls-storage-account-key";

CredentialPropertyUtils should recognize it and convert it to Iceberg configuration like this:

@VisibleForTesting static final String ICEBERG_ADLS_ACCOUNT_NAME = "adls.auth.shared-key.account.name";
@VisibleForTesting static final String ICEBERG_ADLS_ACCOUNT_KEY = "adls.auth.shared-key.account.key";

ImmutableMap.of(
  ADLSAccountKeyCredential.GRAVITINO_ADLS_STORAGE_ACCOUNT_NAME,
  ICEBERG_ADLS_ACCOUNT_NAME,
  ADLSAccountKeyCredential.GRAVITINO_ADLS_STORAGE_ACCOUNT_KEY,
  ICEBERG_ADLS_ACCOUNT_KEY);

 if(credential instanceof ADLSAccountKeyCredential) {
   return transformProperties(credential.credentialInfo(), icebergCredentialPropertyMap);
 }

Iceberg use adls.auth.shared-key.account.name, adls.auth.shared-key.account.key, to determine that it will use ADLS.

We could change ADLSCredentialConfig to AzureCredentialConfig, as it's more general.

WDYT?

For Iceberg it just supports ADLS, but this credential will be used by Gravitino server too, and if supports ABS storage, it will be odd to use ADLSxxxCredential.

@orenccl orenccl marked this pull request as draft December 21, 2024 15:13
@orenccl orenccl marked this pull request as ready for review December 21, 2024 15:35
@FANNG1
Copy link
Contributor

FANNG1 commented Dec 22, 2024

LGTM, @tengqm any other comments?

@FANNG1 FANNG1 changed the title [#5894] feat(iceberg): support ADLS account key credential [#5894] feat(iceberg): support Azure account key credential Dec 22, 2024
@tengqm
Copy link
Contributor

tengqm commented Dec 22, 2024

LGTM, @tengqm any other comments?

All good from my side.

@FANNG1 FANNG1 merged commit d35e5f5 into apache:main Dec 22, 2024
26 checks passed
@orenccl orenccl deleted the feature/adlsKey branch December 22, 2024 09:24
jerryshao pushed a commit that referenced this pull request Dec 24, 2024
…nnector (#5952)

### What changes were proposed in this pull request?

1. Most code work is implemented in #5938 #5737 including catalog
properties convert and add Iceberg azure bundle jar, this PR mainly
about test and document.
2. Remove hidden properties of the cloud secret key from the Iceberg
catalog, as Gravitino doesn't have an unified security management yet
and Iceberg REST server need to fetch catalog cloud properties to
initiate `IcebergWrapper` dymaticly. Another benefit is spark connector
does not need to specify the secret key explictly.

Supports ADLS for Iceberg catalog and spark connector

### Why are the changes needed?
Fix: #5954 

### Does this PR introduce _any_ user-facing change?
Yes, the user no need to specify the cloud secret key in spark
connector.

### How was this patch tested?
test in local enviroment
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this pull request Dec 29, 2024
…ache#5938)

### What changes were proposed in this pull request?

Support Azure account key credential

### Why are the changes needed?

Fix: apache#5894

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Unit Test IcebergRESTADLSAccountKeyIT at iceberg 1.6.0
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this pull request Dec 29, 2024
…ark connector (apache#5952)

### What changes were proposed in this pull request?

1. Most code work is implemented in apache#5938 apache#5737 including catalog
properties convert and add Iceberg azure bundle jar, this PR mainly
about test and document.
2. Remove hidden properties of the cloud secret key from the Iceberg
catalog, as Gravitino doesn't have an unified security management yet
and Iceberg REST server need to fetch catalog cloud properties to
initiate `IcebergWrapper` dymaticly. Another benefit is spark connector
does not need to specify the secret key explictly.

Supports ADLS for Iceberg catalog and spark connector

### Why are the changes needed?
Fix: apache#5954 

### Does this PR introduce _any_ user-facing change?
Yes, the user no need to specify the cloud secret key in spark
connector.

### How was this patch tested?
test in local enviroment
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.

[Subtask] support Azure account key credential
3 participants