|
18 | 18 | from sagemaker.config.config_schema import (
|
19 | 19 | MODEL_ENABLE_NETWORK_ISOLATION_PATH,
|
20 | 20 | MODEL_EXECUTION_ROLE_ARN_PATH,
|
| 21 | + TELEMETRY_OPT_OUT_PATH, |
21 | 22 | TRAINING_JOB_ENABLE_NETWORK_ISOLATION_PATH,
|
22 | 23 | TRAINING_JOB_INTER_CONTAINER_ENCRYPTION_PATH,
|
23 | 24 | TRAINING_JOB_ROLE_ARN_PATH,
|
@@ -75,6 +76,9 @@ def config_value_impl(sagemaker_session: Session, config_path: str, sagemaker_co
|
75 | 76 | if config_path == MODEL_ENABLE_NETWORK_ISOLATION_PATH:
|
76 | 77 | return config_inference_enable_network_isolation
|
77 | 78 |
|
| 79 | + if config_path == TELEMETRY_OPT_OUT_PATH: |
| 80 | + return False # Default to telemetry enabled for tests |
| 81 | + |
78 | 82 | raise AssertionError(f"Bad config path: {config_path}")
|
79 | 83 |
|
80 | 84 |
|
@@ -130,7 +134,7 @@ def test_without_arg_overwrites_without_kwarg_collisions_with_config(
|
130 | 134 |
|
131 | 135 | estimator.deploy()
|
132 | 136 |
|
133 |
| - self.assertEqual(mock_get_sagemaker_config_value.call_count, 3) |
| 137 | + self.assertEqual(mock_get_sagemaker_config_value.call_count, 4) |
134 | 138 |
|
135 | 139 | self.assertEqual(mock_estimator_deploy.call_args[1].get("role"), config_inference_role)
|
136 | 140 |
|
@@ -200,7 +204,7 @@ def test_without_arg_overwrites_with_kwarg_collisions_with_config(
|
200 | 204 |
|
201 | 205 | estimator.deploy()
|
202 | 206 |
|
203 |
| - self.assertEqual(mock_get_sagemaker_config_value.call_count, 6) |
| 207 | + self.assertEqual(mock_get_sagemaker_config_value.call_count, 7) |
204 | 208 |
|
205 | 209 | self.assertEqual(mock_estimator_deploy.call_args[1].get("role"), config_inference_role)
|
206 | 210 |
|
@@ -280,7 +284,7 @@ def test_with_arg_overwrites_with_kwarg_collisions_with_config(
|
280 | 284 | enable_network_isolation=override_inference_enable_network_isolation,
|
281 | 285 | )
|
282 | 286 |
|
283 |
| - self.assertEqual(mock_get_sagemaker_config_value.call_count, 3) |
| 287 | + self.assertEqual(mock_get_sagemaker_config_value.call_count, 4) |
284 | 288 |
|
285 | 289 | self.assertEqual(
|
286 | 290 | mock_estimator_deploy.call_args[1].get("role"), mock_inference_override_role
|
@@ -355,7 +359,7 @@ def test_with_arg_overwrites_without_kwarg_collisions_with_config(
|
355 | 359 | enable_network_isolation=override_inference_enable_network_isolation,
|
356 | 360 | )
|
357 | 361 |
|
358 |
| - self.assertEqual(mock_get_sagemaker_config_value.call_count, 3) |
| 362 | + self.assertEqual(mock_get_sagemaker_config_value.call_count, 4) |
359 | 363 |
|
360 | 364 | self.assertEqual(
|
361 | 365 | mock_estimator_deploy.call_args[1].get("role"), mock_inference_override_role
|
@@ -421,7 +425,7 @@ def test_without_arg_overwrites_without_kwarg_collisions_without_config(
|
421 | 425 |
|
422 | 426 | mock_retrieve_model_init_kwargs.return_value = {}
|
423 | 427 |
|
424 |
| - self.assertEqual(mock_get_sagemaker_config_value.call_count, 3) |
| 428 | + self.assertEqual(mock_get_sagemaker_config_value.call_count, 4) |
425 | 429 |
|
426 | 430 | self.assertEqual(mock_estimator_deploy.call_args[1].get("role"), execution_role)
|
427 | 431 |
|
@@ -492,7 +496,7 @@ def test_without_arg_overwrites_with_kwarg_collisions_without_config(
|
492 | 496 |
|
493 | 497 | estimator.deploy()
|
494 | 498 |
|
495 |
| - self.assertEqual(mock_get_sagemaker_config_value.call_count, 6) |
| 499 | + self.assertEqual(mock_get_sagemaker_config_value.call_count, 7) |
496 | 500 |
|
497 | 501 | self.assertEqual(mock_estimator_deploy.call_args[1].get("role"), execution_role)
|
498 | 502 |
|
@@ -568,7 +572,7 @@ def test_with_arg_overwrites_with_kwarg_collisions_without_config(
|
568 | 572 | enable_network_isolation=override_inference_enable_network_isolation,
|
569 | 573 | )
|
570 | 574 |
|
571 |
| - self.assertEqual(mock_get_sagemaker_config_value.call_count, 3) |
| 575 | + self.assertEqual(mock_get_sagemaker_config_value.call_count, 4) |
572 | 576 |
|
573 | 577 | self.assertEqual(mock_estimator_deploy.call_args[1].get("role"), override_inference_role)
|
574 | 578 |
|
@@ -634,7 +638,7 @@ def test_with_arg_overwrites_without_kwarg_collisions_without_config(
|
634 | 638 | enable_network_isolation=override_enable_network_isolation,
|
635 | 639 | )
|
636 | 640 |
|
637 |
| - self.assertEqual(mock_get_sagemaker_config_value.call_count, 3) |
| 641 | + self.assertEqual(mock_get_sagemaker_config_value.call_count, 4) |
638 | 642 |
|
639 | 643 | self.assertEqual(mock_estimator_deploy.call_args[1].get("role"), override_inference_role)
|
640 | 644 |
|
|
0 commit comments