Skip to content

Refresh the s3 credential automatically so that we can support long-running spark jobs. #1086

Closed

Description

Activity

  1. added
    enhancement
    on Sep 26, 2025
  2. openinx commented on Sep 26, 2025

    @openinx
    CollaboratorAuthor

    Essentially, we do the following steps to get the credential for s3/gcp/azure:

    • (client) --> (uc server) : client request to uc server to get a correct TemporaryCredentials.
    • (client) --> Table : client use the TemporaryCredentials to configure the Hadoop configuration.
      • fs.s3a.access.key
      • fs.s3a.secret.key
      • fs.s3a.session.token
    • (spark-drvier) : use this hadoop configuration to read s3 object.
    • (spark-executor): use this hadoop configuration to read parquet files from the underlying object storage.

    So for both the spark-driver and spark-executor need to refresh the credential if there is any expiration. And the key point is : we are using the Hadoop S3AFilesytem to auth the s3 object storage, and it's a components that we cannot change or custormize. But the good thing is, according to the hadoop s3a document: https://hadoop.apache.org/docs/r3.4.1/hadoop-aws/tools/hadoop-aws/index.html#Using_Session_Credentials_with_TemporaryAWSCredentialsProvider

    It actually provides the configure key to specify our own customized the CredentialsProvider via the fs.s3a.aws.credentials.provider. So the correct approach that I will suggest is: Just customize a new Credentialsprovider and inside that credentials provider we can automatically refresh the credentials, based on all the information that we need to.

  3. openinx commented on Sep 26, 2025

    @openinx
    CollaboratorAuthor

    For aws s3, I think we need to add new implementation for the AwsCredentialsProvider https://github.com/apache/hadoop/blob/d44ac28e326c786b183d1793c4c9e46d03ec2380/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/CredentialProviderListFactory.java#L247.

    For azure, there is also a similar approach for people to customize the token provider. The configure key is fs.adl.oauth2.access.token.provider, and the related classes is :

    For gcp, we need to find out what's the correct approach. --> Oh, I see, @bijanhoule worked on this before, he introduced a GcsVendedTokenProvider without any refresh, so I think gcp totally support the customized credentials provider, we only need to implement the refreshable credentials provider here.

    So in summary, I think all of the aws/gcp/azure support the customized credentials provider. Then I think we can use this approach to fix this renew issue.

    I will provide several PRs for this.

  4. pelegtjfrog commented on Oct 20, 2025

    @pelegtjfrog

    Hey, we need this ability for a use-case in our company, I'm following the active PRs and we will be happy to contribute to help this to be released. Will it be released to Maven after all of the sub-issues will be completed? Because I noticed some changes on main branch are not released yet.
    @openinx Please let me know if there is any way I can help.

  5. openinx commented on Oct 20, 2025

    @openinx
    CollaboratorAuthor

    Hi @pelegtjfrog, thanks for the info. Yes, we are planning to release the 0.4.0. and also we finally will backport this feature to 0.3.1 and make the release. I think the ETA will be the end of Oct. Thanks.

  6. openinx commented on Dec 2, 2025

    @openinx
    CollaboratorAuthor

    All those PR has been done, close now. Let's wait for the release 0.3.1 cut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions