-
Notifications
You must be signed in to change notification settings - Fork 3k
Aliyun: Add RRSA support for OSS authentication #14443
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @zhaoyunjiong , thanks for the contribution ! Could you please refer me the alibaba cloud document about the RRSA please ? I don't have much context about this, if there is one, i'd love to read and understand it, thanks. |
| } | ||
|
|
||
| static class DefaultAliyunClientFactory implements AliyunClientFactory { | ||
| private static final Logger LOG = LoggerFactory.getLogger(DefaultAliyunClientFactory.class); |
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: We ususally define the LOG in the class file rather than the inner class in apache iceberg. Maybe we can move it to the AliyunClientFactories.
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.
If we move to AliyunClientFactories, the class name from LOG will be "AliyunClientFactories", which will make log messages confusing.
| DefaultAliyunClientFactory() {} | ||
|
|
||
| /** | ||
| * Check if RRSA environment variables are present. RRSA requires |
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 it possible to add more description about the RRSA ? Actually I also don't have much context about this, which I think we need to provide more context for others to understand and mantain this.
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.
Added.
aliyun/src/main/java/org/apache/iceberg/aliyun/AliyunClientFactories.java
Show resolved
Hide resolved
aliyun/src/main/java/org/apache/iceberg/aliyun/AliyunClientFactories.java
Show resolved
Hide resolved
aliyun/src/main/java/org/apache/iceberg/aliyun/AliyunClientFactories.java
Show resolved
Hide resolved
aliyun/src/main/java/org/apache/iceberg/aliyun/AliyunClientFactories.java
Outdated
Show resolved
Hide resolved
aliyun/src/main/java/org/apache/iceberg/aliyun/AliyunClientFactories.java
Show resolved
Hide resolved
aliyun/src/main/java/org/apache/iceberg/aliyun/AliyunClientFactories.java
Show resolved
Hide resolved
|
Hi @zhaoyunjiong , Basically I understand your idea, we want to use the customized credentials provider to automatically get the temporary credentials, rather than configuring the static credentials inside the iceberg table properties (which is not safe). Then is it possible to follow the Please see the
And with this, you can configure what kind of credentials provider implementation that you want. iceberg/aws/src/main/java/org/apache/iceberg/aws/AwsClientProperties.java Lines 211 to 235 in fb0af7e
And another key question from my side is: How do we gurantee the credential expiration won't interrupt the long-running job ? |
You can find RRSA document here: https://www.alibabacloud.com/help/en/ack/ack-managed-and-ack-dedicated/user-guide/use-rrsa-to-authorize-pods-to-access-different-cloud-services |
We have multiple different components that will need to use iceberg-aliyun. It's possible to pass a custom Credentials Provider, but it will be very difficult and time-consuming to change multiple different projects to support that.
The OSS client constructor only stores the CredentialsProvider reference. Before sending a request to the OSS service, inside doOperation(), it will call createDefaultContext(), which will call credsProvider.getCredentials(). This will automatically refresh the credentials if they expired or are within a 3-minute window. You can find the code here: |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
Hi @zhaoyunjiong Could you please help to resolve the conflicts ? Thanks. |
|
Hi @zhaoyunjiong, I will suggest to solve this problem in an more abstraction approach, as we discussed before.
Since the That's why I highly suggest we introduce the abstraction to support the general customized |
|
The usage may like this ( let's take the spark and hive catalog as an example): SET spark.sql.catalog.demo= org.apache.iceberg.spark.SparkCatalog;
SET spark.sql.catalog.demo.type = hive;
SET spark.sql.catalog.demo.uri=thrift://hms-host:9083;
SET spark.sql.catalog.demo.warehouse=oss://my-bucket/iceberg/warehouse;
SET spark.sql.catalog.demo.io-impl=org.apache.iceberg.aliyun.oss.OSSFileIO;
-- with this catalog configuration, we can direct the iceberg catalog to use the customized aliyun credentials provider
-- and then people can use any kind of the credentials provider implementation to access the correct credentials.
SET spark.sql.catalog.demo.client.credentials-provider=com.test.CustomizedCredentialsProviderImplementations;
USE demo; |
One thing I forgot to mention is that this will only be a temporary solution until the Alibaba Cloud OSS SDK for Java V2 is production-ready. Once V2 is ready, the correct approach will be to upgrade to it, as it will support the use case I need. |
We plan to run the Iceberg REST Catalog (IRC) and PySpark within an Alibaba Cloud ACK cluster. Since using AccessKey ID, AccessKey Secret, and SecurityToken for OSS authentication is not feasible in our setup, we have chosen to adopt RRSA as the authentication method. This PR introduces that change.