fix: ModelBuilder resolves private hub artifacts correctly#5985
Open
lhnealreilly wants to merge 1 commit into
Open
fix: ModelBuilder resolves private hub artifacts correctly#5985lhnealreilly wants to merge 1 commit into
lhnealreilly wants to merge 1 commit into
Conversation
73c3510 to
c85e4c4
Compare
c85e4c4 to
f265dce
Compare
f265dce to
5cc330b
Compare
5cc330b to
93c38e7
Compare
Fix three defects causing ModelBuilder to ignore private hub when resolving model artifacts, forcing the execution role to access the public JumpStart S3 cache bucket. Defect 1: from_jumpstart_config sets hub_name AFTER __init__ has already called _initialize_jumpstart_config(), which takes the else branch and sets hub_arn = None. Fix: derive hub_arn inline after setting hub_name. Defect 2: _build_for_jumpstart does not forward hub_arn or sagemaker_session to get_init_kwargs, causing model data to resolve from the public catalog. Fix: pass hub_arn (when set) and sagemaker_session to all get_init_kwargs call sites in the build path. Defect 3: The v3 Session class (sagemaker.core.helper.session_helper.Session) is missing hub API methods (describe_hub_content, list_hub_content_versions, list_hub_contents) that the JumpStart cache calls during hub content resolution. Fix: add these methods as thin wrappers around the boto3 sagemaker_client calls. Impact: Customers deploying from private hubs via ModelBuilder no longer need to grant their execution role s3:GetObject on the public JumpStart cache bucket. Testing: - 8 new unit tests covering hub_arn derivation, forwarding, and e2e flow - 2 existing unit tests updated to match new call signatures
93c38e7 to
ae1f6cf
Compare
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.
Fix two defects causing ModelBuilder to ignore private hub when resolving model artifacts, forcing the execution role to access the public JumpStart S3 cache bucket.
Defect 1: from_jumpstart_config sets hub_name AFTER init has already called _initialize_jumpstart_config(), which takes the else branch and sets hub_arn = None. Fix: call _initialize_jumpstart_config() again after setting hub_name so hub_arn is correctly derived.
Defect 2: _build_for_jumpstart does not forward hub_arn to get_init_kwargs, causing model data to resolve from the public catalog. Fix: pass hub_arn=getattr(self, 'hub_arn', None) to all get_init_kwargs call sites in the build path (_build_for_jumpstart, _detect_jumpstart_image).
Impact: Customers deploying from private hubs via ModelBuilder no longer need to grant their execution role s3:GetObject on the public JumpStart cache bucket.
Testing:
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.