Skip to content

Fix S3 persistence tests for OIDC session token and multi-account credentials - #16892

Open
silvarohan18 wants to merge 3 commits into
rel-3.46.0from
rohan/fix-s3-session-token-tests-rel-3.46.0
Open

Fix S3 persistence tests for OIDC session token and multi-account credentials#16892
silvarohan18 wants to merge 3 commits into
rel-3.46.0from
rohan/fix-s3-session-token-tests-rel-3.46.0

Conversation

@silvarohan18

@silvarohan18 silvarohan18 commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Pass AWS session token to set_s3_credentials() in S3 persistence tests, required for OIDC-based credential flows (temporary credentials include a session token)
  • Support multi-account S3 credentials via per-test env var prefixes (AWS_CREDS_PREFIX_S3_PROD / AWS_CREDS_PREFIX_S3_DEV), with backward-compatible fallback to AWS_CREDS_PREFIX and then empty string

Context

Backport of #16891 to rel-3.46.0.

The h2o-3-enterprise nightly CI migrated from long-lived IAM user credentials to OIDC role assumption. OIDC produces temporary credentials (access key + secret key + session token), but the S3 tests only passed access key and secret key to set_s3_credentials(). The S3 test data also spans two AWS accounts (PROD for h2o-public-test-data, DEV for test.0xdata.com), requiring per-test credential selection via environment variable prefixes.

Changes

  • pyunit_set_s3_credentials.py — Uses AWS_CREDS_PREFIX_S3_DEV prefix (test.0xdata.com is in DEV account); passes session token to set_s3_credentials()
  • pyunit_import_s3_parquet.py — Uses AWS_CREDS_PREFIX_S3_PROD prefix (h2o-public-test-data is in PROD account); passes session token to set_s3_credentials()
  • runit_pubdev_6188.R — Uses AWS_CREDS_PREFIX_S3_DEV prefix; passes session token to h2o.set_s3_credentials()

All prefix lookups fall back gracefully: AWS_CREDS_PREFIX_S3_DEVAWS_CREDS_PREFIX"", preserving compatibility with Jenkins IAM user credential flows.

Test plan

  • pyunit_import_s3_parquet.py passes in nightly CI with PROD OIDC credentials
  • pyunit_set_s3_credentials.py blocked by bucket policy (DevOps ticket pending for s3:GetObject on test.0xdata.com)
  • runit_pubdev_6188.R blocked by OIDC token expiration in long R test suites (DevOps ticket pending for MaxSessionDuration increase)

silvarohan18 and others added 2 commits July 11, 2026 08:36
The S3 tests call set_s3_credentials(key, secret) but omit the
session_token parameter that already exists in the API. When running
with OIDC-based temporary credentials (e.g., GitHub Actions), the
missing session token causes AWS to reject requests.

Read AWS_SESSION_TOKEN from the environment alongside the existing
key and secret, and pass it to set_s3_credentials(). When the env
var is not set (static IAM credentials), it passes None/NULL which
preserves existing behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests accessing test.0xdata.com (DEV account) use AWS_CREDS_PREFIX_S3_DEV,
tests accessing h2o-public-test-data (PROD account) use AWS_CREDS_PREFIX_S3_PROD.
Both fall back to AWS_CREDS_PREFIX and then to unprefixed env vars for
backward compatibility with Jenkins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@silvarohan18 silvarohan18 self-assigned this Jul 11, 2026
Support S3_CREDS_TEST_PATH and S3_CREDS_TEST_PREFIX env vars to allow
different CI environments to use different S3 buckets and credential
sources. Defaults unchanged (test.0xdata.com with DEV credentials).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant