Skip to content

CASSANALYTICS-155: Add IAM credential support for S3 storage transport#212

Merged
rustyrazorblade merged 1 commit into
apache:trunkfrom
rustyrazorblade:iam_credentials
May 29, 2026
Merged

CASSANALYTICS-155: Add IAM credential support for S3 storage transport#212
rustyrazorblade merged 1 commit into
apache:trunkfrom
rustyrazorblade:iam_credentials

Conversation

@rustyrazorblade
Copy link
Copy Markdown
Contributor

Summary

  • Adds CredentialType enum (STATIC / IAM) to control how Spark executors and Sidecar authenticate to S3
  • STATIC (default): existing behavior — STS access key/secret/session token passed via StorageCredentials
  • IAM: no credentials passed; both executor and Sidecar use the AWS SDK default provider chain (EC2 instance profile, EKS IRSA, ECS task role)
  • New StorageAuth interface with StaticStorageAuth and IamStorageAuth implementations
  • StorageCredentialPair.iamPair(writeRegion, readRegion) factory for IAM-only pairs
  • RestoreJobSecrets updated to carry the credential type and omit secrets when IAM is used
  • Documentation updates covering the new storage_credential_type option and S3 bucket topology

Test plan

  • New unit tests in BuildRestoreJobSecretsTest, RestoreJobSecretsTest, StorageCredentialsTest, StorageCredentialPairTest, and CreateRestoreJobRequestPayloadTest cover both STATIC and IAM paths
  • StorageAccessConfigurationTest updated to reflect new auth model
  • CloudStorageStreamSessionTest updated for credential type propagation

JIRA

https://issues.apache.org/jira/browse/CASSANALYTICS-155

@rustyrazorblade rustyrazorblade force-pushed the iam_credentials branch 2 times, most recently from 6152c5c to fb1d1f5 Compare May 27, 2026 20:06
Copy link
Copy Markdown
Contributor

@yifan-c yifan-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update changes.txt.

It is sad that we have duplicate the code between Sidecar and Analytics

}

@Test
void testHashcodeAndEquals()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is also removed.

transitionalStateStart.countDown();
TestUninterruptibles.awaitUninterruptiblyOrThrow(transitionalStateStart, 4, TimeUnit.MINUTES);
TestUninterruptibles.awaitUninterruptiblyOrThrow(transitionalStateEnd, 2, TimeUnit.MINUTES);
Uninterruptibles.awaitUninterruptibly(transitionalStateEnd, 2, TimeUnit.MINUTES);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why they are changed; seemingly unrelated change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several tests routinely fail due to a race condition here. I figured a green CI would be better than not, but happy to remove it if you want.

protected void completeTransitionsAndValidateWrites(CountDownLatch transitionalStateEnd, Stream<Arguments> testInputs)
{
for (int i = 0; i < leavingNodesPerDc(); i++)
for (int i = 0; i < leavingNodes.size(); i++)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change; can we revert it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above.

Adds IAM-based authentication as an alternative to static credentials
for S3 storage transport.

Also fixes test report collection in CI: corrects Gradle output paths
for both GitHub Actions (adds missing artifact uploads with if: always())
and CircleCI (fixes SRC_REPORT_DIR and store_test_results paths so real
JUnit XML is collected instead of synthesized fallbacks).

Patch by Jon Haddad; reviewed by Yifan Cai for CASSANALYTICS-155
@rustyrazorblade rustyrazorblade force-pushed the iam_credentials branch 2 times, most recently from 79bd150 to 87c553c Compare May 29, 2026 14:47
@rustyrazorblade rustyrazorblade merged commit 87c553c into apache:trunk May 29, 2026
47 of 52 checks passed
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.

2 participants