fix: Inject S3 credentials for SAIA v1 and Ray on AWS s3 storage#92
Merged
Conversation
… stores k0s and other non-EKS clusters use static keys in minio-credentials rather than IRSA/instance profiles. SAIA v1 calls boto3 directly but only received S3COMPAT_* env vars, causing NoCredentialsError at startup while v2 worked. Ray Serve replicas could misclassify regional AWS S3 URLs as s3compat and omit AWS_* credentials, breaking model/artifact access. Changes: - SAIA: add appendSAIABoto3Env() in buildSAIABaseEnv (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_ENDPOINT_URL when configured); reconcile v1 deployment via buildSAIABaseEnv instead of duplicating env. - Ray builder: classify s3:// + *.amazonaws.com as aws; inject credentials when secretRef is set; add object_storage_test.go. - applications.yaml: template AWS_* vars for all Serve runtime env blocks. - k0s_cluster_with_stack.sh: type=aws omits endpoint on AIPlatform CR, uses cluster region, rejects STS keys, type-specific preflight for endpoints. Tested on k0s (ap-southeast-2 S3): SAIA v1/v2 Running, Ray workers healthy after IAM policy + operator image with these changes.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes AWS S3 credential injection and object-storage classification so SAIA v1 and Ray Serve replicas can authenticate correctly on non-EKS clusters (e.g., k0s) that rely on static keys in minio-credentials, and avoids misclassifying AWS regional S3 endpoints as s3compat.
Changes:
- SAIA: centralize and inject boto3-standard
AWS_*env vars viabuildSAIABaseEnv()for both v1 and v2; update SAIA v1 deployment reconcile to use the shared base env. - Ray builder: introduce object-storage classification helpers (including AWS regional endpoint detection), inject credentials for AWS as well as s3compat, and add unit tests.
- Installer/templates: update k0s installer object-storage preflights/CR rendering (type-specific endpoint behavior, region propagation, STS-key rejection) and template
AWS_*variables into all Serveruntime_envblocks.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/cluster_setup/k0s_cluster_with_stack.sh | Adds YAML parse validation, improves object-store preflights, adjusts endpoint/region handling for type=aws, and refines node disk preflight SSH logic. |
| pkg/ai/raybuilder/builder.go | Adds classifyObjectStorage() / isAWSRegionalEndpoint() helpers, injects credentials for AWS paths when secretRef is set, and passes region through to app templating. |
| pkg/ai/raybuilder/object_storage_test.go | Adds unit tests for object-storage classification and AWS endpoint detection. |
| pkg/ai/features/saia/impl.go | Adds shared boto3 AWS_* env injection for SAIA v1/v2 and removes duplicated v2-only AWS env logic. |
| pkg/ai/features/saia/impl_test.go | Updates/relocates tests to validate AWS env injection via buildSAIABaseEnv(). |
| config/configs/applications.yaml | Templates boto3-standard AWS_* env vars into all Ray Serve runtime env blocks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
kupratyu-splunk
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
k0s and other non-EKS clusters use static keys in minio-credentials rather than
IRSA/instance profiles. SAIA v1 calls boto3 directly but only received
S3COMPAT_* env vars, causing NoCredentialsError at startup while v2 worked.
Ray Serve replicas could misclassify regional AWS S3 URLs as s3compat and omit
AWS_* credentials, breaking model/artifact access.
Changes:
AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_ENDPOINT_URL when configured);
reconcile v1 deployment via buildSAIABaseEnv instead of duplicating env.
when secretRef is set; add object_storage_test.go.
cluster region, rejects STS keys, type-specific preflight for endpoints.
Tested on k0s (ap-southeast-2 S3): SAIA v1/v2 Running, Ray workers healthy
after IAM policy + operator image with these changes.
Description
Related Issues
Type of Change
Changes Made
Testing Performed
make test)make lint)Test Environment
Test Steps
Documentation
Checklist
Breaking Changes
Impact:
Migration Path:
Screenshots/Recordings
Additional Notes
Reviewer Notes
Please pay special attention to:
Commit Message Convention: This PR follows Conventional Commits