Fix/jumpstart network isolation#5833
Open
lhnealreilly wants to merge 6 commits intoaws:masterfrom
Open
Conversation
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
previously approved these changes
May 6, 2026
Narrohag
approved these changes
May 6, 2026
varunmoris
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.
Narrohag
approved these changes
May 6, 2026
JGuinegagne
approved these changes
May 6, 2026
aviruthen
approved these changes
May 6, 2026
cj-zhang
approved these changes
May 6, 2026
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.
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.