Skip to content

Fix/jumpstart network isolation#5833

Merged
aviruthen merged 6 commits intoaws:masterfrom
lhnealreilly:fix/jumpstart-network-isolation
May 7, 2026
Merged

Fix/jumpstart network isolation#5833
aviruthen merged 6 commits intoaws:masterfrom
lhnealreilly:fix/jumpstart-network-isolation

Conversation

@lhnealreilly
Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:
v3's ModelBuilder never applies inference_enable_network_isolation from JumpStart model spec metadata, causing all JumpStart models to deploy without network isolation (defaults to False). In v2, JumpStartModel read this from the spec and passed it to create_model().

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

lnealrei added 3 commits May 6, 2026 19:56
In v2, JumpStart models deployed with EnableNetworkIsolation=True because
the JumpStartModel class read inference_enable_network_isolation from the
model spec JSON. In v3's ModelBuilder, this field was never extracted from
the JumpStart init_kwargs or deploy_kwargs, causing all JumpStart models
to deploy without network isolation (defaulting to False).

This fix applies enable_network_isolation from the JumpStart model spec
in both code paths:
1. _build_for_jumpstart() - regular build path via get_init_kwargs()
2. from_jumpstart_config() - classmethod path via _retrieve_model_deploy_kwargs()

The user-provided value (via network= param) takes precedence.
Tests both code paths:
1. _build_for_jumpstart() - verifies enable_network_isolation is applied
   from init_kwargs and that user-set values are not overridden
2. from_jumpstart_config() - verifies enable_network_isolation is
   extracted from deploy_kwargs
Tests both code paths:
1. _build_for_jumpstart() - verifies enable_network_isolation is applied
   from init_kwargs and that user-set values are not overridden
2. from_jumpstart_config() - verifies enable_network_isolation is
   extracted from deploy_kwargs
…xture

The mock directly inherits _ModelBuilderServers without going through
ModelBuilder.__post_init__ which initializes this attribute.
evakravi
evakravi previously approved these changes May 6, 2026
Integration test builds a real SageMaker Model (falcon-7b) and verifies
EnableNetworkIsolation=True via describe_model API. No endpoint deployed.

Also adds _enable_network_isolation to MockModelBuilderServers fixture
to fix 7 pre-existing unit test failures.
@aviruthen
Copy link
Copy Markdown
Collaborator

aviruthen commented May 7, 2026

Failing integ tests pass on CodeBuild: sagemaker-python-sdk-ci-sagemaker-mlops-integ-tests:a35bc1f1-5cfb-4319-9809-a66d6f8677e5

Run failing tests based on PR check sagemaker-python-sdk-ci-sagemaker-mlops-integ-tests:fd8ddd22-53be-4a09-a615-72777ffc2090 (build 690) where only these three tests below failed:

tests/integ/test_feature_store.py::test_create_feature_group_with_both_stores PASSED [ 33%]
tests/integ/test_hyperparameter_tuning.py::test_hyperparameter_tuning_e2e PASSED [ 66%]
tests/integ/test_transform_job.py::test_transform_job PASSED [100%]

@aviruthen aviruthen merged commit 1b86252 into aws:master May 7, 2026
31 of 44 checks passed
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.

8 participants