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 18
18
from pathlib import Path
19
19
from copy import deepcopy
20
20
21
+ from sagemaker .model import Model
21
22
from sagemaker .serve import SchemaBuilder
22
23
from sagemaker .serve .builder .model_builder import ModelBuilder
23
24
from sagemaker .serve .mode .function_pointers import Mode
@@ -3300,6 +3301,19 @@ def test_optimize_sharding_with_override_for_js(
3300
3301
3301
3302
assert not model ._enable_network_isolation
3302
3303
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
+
3303
3317
3304
3318
class TestModelBuilderOptimizeValidations (unittest .TestCase ):
3305
3319
You can’t perform that action at this time.
0 commit comments