Skip to content

Conversation

@Mattral
Copy link

@Mattral Mattral commented Feb 3, 2026

fix(serve/bedrock): robust S3 manifest lookup and improved error handling

Summary

Robust S3 manifest lookup and clearer S3 error handling for Bedrock Nova models.

Files Changed

  • bedrock_model_builder.py
  • test_bedrock_model_builder.py

Description of Changes

  • Try multiple candidate manifest locations:
    • dirname/manifest.json
    • dirname/output/manifest.json
    • parent/manifest.json
  • Use ClientError (botocore) where available to detect missing keys/buckets and continue searching.
  • Provide clear ValueError when a checkpoint cannot be located.
  • Search manifest contents for checkpoint-like keys (any key containing "checkpoint"), with fallback to common names:
    • checkpoint_s3_bucket
    • checkpoint_s3_uri
    • checkpoint_s3_path
  • Add unit tests covering success and manifest-not-found cases.
  • Preserve original authors’ comments and intent; changes focus on robustness and observability.

Impact

  • Prevents opaque failures during Bedrock model import when checkpoint manifest locations vary.
  • Improves debuggability with clearer error messages and deterministic path resolution.
  • No behavioral changes for non-Nova models.

Testing

  • Added test_bedrock_model_builder.py (two tests).
  • Ran tests locally in the dev container — both tests passed.
  • Recommendation: Run CI to execute the new unit tests.

Review Notes

  • Review candidate S3 key choices and error-message wording.
  • Verify alignment with Bedrock/Training job artifact layout expectations.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

… Try multiple manifest locations (dirname/manifest.json, dirname/output/manifest.json, parent/manifest.json)\n- Use ClientError for S3 errors, with clear ValueErrors on failure\n- Search manifest keys for checkpoint-like entries and fallback to common names\n- Add unit tests for success and manifest-not-found cases
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