Skip to content

fix(serve): support aliased hub content names in private hub deploys#6039

Open
e-davidson wants to merge 2 commits into
aws:masterfrom
e-davidson:fix/private-hub-aliased-content-name
Open

fix(serve): support aliased hub content names in private hub deploys#6039
e-davidson wants to merge 2 commits into
aws:masterfrom
e-davidson:fix/private-hub-aliased-content-name

Conversation

@e-davidson

Copy link
Copy Markdown
Contributor

Issue

Deploying a JumpStart model from a private hub via ModelBuilder.from_jumpstart_config(hub_name=...) fails with ResourceNotFound when the hub's ModelReference was created with a custom HubContentName. The CreateHubContentReference API accepts an aliased name, but the SDK always looks up hub content by model_id, so aliased references are unreachable.

This is the remaining defect after #5985 (hub_arn derivation) and #6036 (model_reference_arn propagation / HubAccessConfig).

Fix

Optional hub_content_name on JumpStartConfig, threaded through from_jumpstart_config; when set, _build_for_jumpstart resolves hub content by the reference's actual name (3 files, +17 lines).

Test coverage

This PR also adds the regression coverage that would have caught the HubAccessConfig regression that shipped in v3.15.1-v3.16.0:

Unit (tests/unit/test_private_hub_artifact_resolution.py, extends the #5985 file):

  • model_reference_arn propagation regression test guarding the Fix private hub #6036 fix (supersedes the subset assertions added there)
  • CreateModel payload chain test: drives the real unmocked path _build_for_jumpstart -> _prepare_container_def_base and asserts the container definition carries S3DataSource.HubAccessConfig.HubContentArn for hub builds and omits it for public builds
  • hub_content_name lookup + config threading tests
  • Shared setup hoisted to a module-level _build_jumpstart_builder() helper per package convention

Integration (tests/integ/test_private_hub_artifact_resolution.py, slow_test, self-provisioning with full teardown):

  • test_deploy_with_no_s3_execution_role: creates an execution role with zero S3 permissions, deploys from a private hub, asserts the created Model carries HubAccessConfig (the service-side brokered-access contract unit tests cannot reach)
  • test_deploy_with_aliased_hub_content_name: deploys a reference named differently from the model_id

Verification (red -> green at every layer)

Layer Baseline v3.16.0 With fix
Unit (17 tests) 4 discriminating tests FAIL 17/17 pass
Integ, live us-east-1 2 FAIL 2 pass (38s), both with the zero-S3 role

Live runs used a real private hub + ModelReference and an IAM role with no S3 permissions; all resources (hub, references, role, endpoints) cleaned up.

Replaces #6035, which predated #6036 and carried a now-redundant duplicate of the propagation fix.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Eli Davidson added 2 commits July 17, 2026 00:08
CreateHubContentReference accepts a custom HubContentName, but the SDK
always looks up hub content by model_id, so a reference named
differently from the public model id fails with ResourceNotFound.

Add optional hub_content_name to JumpStartConfig and thread it through
from_jumpstart_config; when set, _build_for_jumpstart resolves hub
content by the reference's actual name.

Verified E2E against a live private hub with an execution role that has
zero S3 permissions: an aliased ModelReference now deploys successfully
with SageMaker brokering artifact access through the hub content
reference.
…aliased names

Unit tests (extends the aws#5985 file, shared setup hoisted to a
module-level _build_jumpstart_builder helper per package convention):
- model_reference_arn propagation regression test guarding the aws#6036
  fix (supersedes the subset assertions added there)
- CreateModel payload chain test: drives the real unmocked path
  _build_for_jumpstart -> _prepare_container_def_base and asserts the
  container definition carries S3DataSource.HubAccessConfig.HubContentArn
  for hub builds and omits it for public builds -- the assertion that
  would have caught the v3.15.1-v3.16.0 regression
- hub_content_name lookup and config threading tests

Integration tests (slow_test, self-provisioning with full teardown):
- test_deploy_with_no_s3_execution_role: zero-S3 execution role deploy,
  asserts HubAccessConfig on the created Model (service-side contract)
- test_deploy_with_aliased_hub_content_name: aliased reference deploy

Verified red->green at every layer: 4 unit tests and both integ tests
fail on v3.16.0 baseline; all pass with the fixes (integ verified live
in us-east-1 with a real hub, zero-S3 role, 2 passed in 38s).
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