File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
tests/unit/sagemaker/serve/builder Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1818from pathlib import Path
1919from copy import deepcopy
2020
21+ from sagemaker .model import Model
2122from sagemaker .serve import SchemaBuilder
2223from sagemaker .serve .builder .model_builder import ModelBuilder
2324from sagemaker .serve .mode .function_pointers import Mode
@@ -3300,6 +3301,19 @@ def test_optimize_sharding_with_override_for_js(
33003301
33013302 assert not model ._enable_network_isolation
33023303
3304+ def test_model_sharding_with_eni_fails (self ):
3305+ test_model = Model (role = "mock role" )
3306+ test_model ._is_sharded_model = True
3307+ test_model ._enable_network_isolation = True
3308+ self .assertRaisesRegex (
3309+ ValueError ,
3310+ (
3311+ "EnableNetworkIsolation cannot be set to True since "
3312+ "SageMaker Fast Model Loading of model requires network access."
3313+ ),
3314+ lambda : test_model .deploy (initial_instance_count = 1 , instance_type = "ml.g5.24xlarge" ),
3315+ )
3316+
33033317
33043318class TestModelBuilderOptimizeValidations (unittest .TestCase ):
33053319
You can’t perform that action at this time.
0 commit comments