Repository navigation
fix(serve): expose orchestrator deployment fields - #6467
lucasjia-aws wants to merge 1 commit into
Conversation
Restore ModelBuilder constructor support for resource requirements and inference component names, preserving them in custom orchestrator deployables. Fixes aws#6198
There was a problem hiding this comment.
🤖 AI code review
This PR exposes resource_requirements and inference_component_name as trailing optional ModelBuilder dataclass fields so documented constructor usage no longer fails with "unexpected keyword argument", and simplifies the now-redundant getattr/hasattr fallbacks that were only there because the attributes weren't declared. The field placement correctly preserves positional ordering of existing constructor args, the removal of the _initialize_jumpstart_config fallback for resource_requirements is safe because the dataclass field now guarantees the attribute, and the direct attribute access in _deploy_core_endpoint is likewise safe. The added tests verify constructor acceptance and that CustomOrchestrator deployables retain both values. The change is correct and adequately tested; no issues found.
Reviewed commit 3dfd6e8. Automated review; verify before acting.
Summary
ModelBuilder already reads
resource_requirementsandinference_component_namewhile building CustomOrchestrator deployables, but neither value is declared as a dataclass constructor field. Documented constructor usage therefore fails with an unexpected keyword argument error.This change exposes both values as trailing optional ModelBuilder fields, preserving the positional order and defaults of existing constructor arguments. CustomOrchestrator deployables retain both values during build.
Testing
git diff --checkpassed.sagemaker-servewheel and source distribution successfully.Fixes #6198