Skip to content

Commit 54534dc

Browse files
author
Eli Davidson
committed
Merge origin/master (PR aws#6036) into fix/private-hub-e2e
Upstream aws#6036 independently fixed the model_reference_arn propagation (Defect A) with the same 6-line fix. Resolution: kept upstream's propagation block as canonical (removed our duplicate at the earlier location), kept our hub_content_name lookup fix (Defect B, not covered upstream), and kept our unit test file as the superset (upstream's 2 tests assert a subset of our TestModelReferenceArnPropagation). Verified post-merge: 17/17 unit tests pass, single propagation block, no conflict markers.
2 parents ebc2a56 + 1d91877 commit 54534dc

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

‎sagemaker-serve/src/sagemaker/serve/model_builder_servers.py‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -995,13 +995,6 @@ def _build_for_jumpstart(self) -> Model:
995995
init_kwargs_params["model_id"] = hub_content_name
996996
init_kwargs = get_init_kwargs(**init_kwargs_params)
997997

998-
# Propagate the hub model reference ARN so the container definition
999-
# includes S3DataSource.HubAccessConfig.HubContentArn. Without this,
1000-
# CreateModel requires the execution role to have s3:GetObject on the
1001-
# public JumpStart cache bucket, defeating private hub brokered access.
1002-
if getattr(init_kwargs, "model_reference_arn", None):
1003-
self.model_reference_arn = init_kwargs.model_reference_arn
1004-
1005998
# Configure image URI and environment variables
1006999
self.image_uri = self.image_uri or init_kwargs.image_uri
10071000

@@ -1015,6 +1008,12 @@ def _build_for_jumpstart(self) -> Model:
10151008
):
10161009
self._enable_network_isolation = init_kwargs.enable_network_isolation
10171010

1011+
# Propagate model_reference_arn from init_kwargs so that
1012+
# _prepare_container_def_base can attach HubAccessConfig to the
1013+
# CreateModel request (required for private hub brokered access).
1014+
if getattr(init_kwargs, "model_reference_arn", None):
1015+
self.model_reference_arn = init_kwargs.model_reference_arn
1016+
10181017
# Handle model artifacts for fine-tuned models
10191018
if hasattr(init_kwargs, "model_data") and init_kwargs.model_data:
10201019
if (

0 commit comments

Comments
 (0)