@@ -266,6 +266,10 @@ def updated_output_kms_key(sagemaker_session):
266
266
)
267
267
268
268
269
+ @pytest .mark .skipif (
270
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
271
+ reason = "ModelMonitoring is not yet supported in this region." ,
272
+ )
269
273
def test_default_monitor_suggest_baseline_and_create_monitoring_schedule_with_customizations (
270
274
sagemaker_session , output_kms_key , volume_kms_key , predictor
271
275
):
@@ -464,6 +468,10 @@ def test_default_monitor_suggest_baseline_and_create_monitoring_schedule_with_cu
464
468
assert len (summary ["MonitoringScheduleSummaries" ]) > 0
465
469
466
470
471
+ @pytest .mark .skipif (
472
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
473
+ reason = "ModelMonitoring is not yet supported in this region." ,
474
+ )
467
475
def test_default_monitor_suggest_baseline_and_create_monitoring_schedule_without_customizations (
468
476
sagemaker_session , predictor
469
477
):
@@ -637,6 +645,10 @@ def test_default_monitor_suggest_baseline_and_create_monitoring_schedule_without
637
645
assert len (summary ["MonitoringScheduleSummaries" ]) > 0
638
646
639
647
648
+ @pytest .mark .skipif (
649
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
650
+ reason = "ModelMonitoring is not yet supported in this region." ,
651
+ )
640
652
def test_default_monitor_create_stop_and_start_monitoring_schedule_with_customizations (
641
653
sagemaker_session , output_kms_key , volume_kms_key , predictor
642
654
):
@@ -792,7 +804,15 @@ def test_default_monitor_create_stop_and_start_monitoring_schedule_with_customiz
792
804
started_schedule_description = my_default_monitor .describe_schedule ()
793
805
assert started_schedule_description ["MonitoringScheduleStatus" ] == "Scheduled"
794
806
807
+ my_default_monitor .stop_monitoring_schedule ()
808
+
809
+ _wait_for_schedule_changes_to_apply (monitor = my_default_monitor )
795
810
811
+
812
+ @pytest .mark .skipif (
813
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
814
+ reason = "ModelMonitoring is not yet supported in this region." ,
815
+ )
796
816
def test_default_monitor_create_and_update_schedule_config_with_customizations (
797
817
sagemaker_session ,
798
818
predictor ,
@@ -1061,9 +1081,20 @@ def test_default_monitor_create_and_update_schedule_config_with_customizations(
1061
1081
]["EnableNetworkIsolation" ]
1062
1082
== UPDATED_NETWORK_CONFIG .enable_network_isolation
1063
1083
)
1084
+
1085
+ _wait_for_schedule_changes_to_apply (monitor = my_default_monitor )
1086
+
1087
+ my_default_monitor .stop_monitoring_schedule ()
1088
+
1089
+ _wait_for_schedule_changes_to_apply (monitor = my_default_monitor )
1090
+
1064
1091
assert len (predictor .list_monitors ()) > 0
1065
1092
1066
1093
1094
+ @pytest .mark .skipif (
1095
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
1096
+ reason = "ModelMonitoring is not yet supported in this region." ,
1097
+ )
1067
1098
def test_default_monitor_create_and_update_schedule_config_without_customizations (
1068
1099
sagemaker_session , predictor
1069
1100
):
@@ -1277,7 +1308,17 @@ def test_default_monitor_create_and_update_schedule_config_without_customization
1277
1308
is None
1278
1309
)
1279
1310
1311
+ _wait_for_schedule_changes_to_apply (monitor = my_default_monitor )
1312
+
1313
+ my_default_monitor .stop_monitoring_schedule ()
1314
+
1315
+ _wait_for_schedule_changes_to_apply (monitor = my_default_monitor )
1316
+
1280
1317
1318
+ @pytest .mark .skipif (
1319
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
1320
+ reason = "ModelMonitoring is not yet supported in this region." ,
1321
+ )
1281
1322
def test_default_monitor_attach_followed_by_baseline_and_update_monitoring_schedule (
1282
1323
sagemaker_session ,
1283
1324
default_monitoring_schedule_name ,
@@ -1421,11 +1462,20 @@ def test_default_monitor_attach_followed_by_baseline_and_update_monitoring_sched
1421
1462
== UPDATED_NETWORK_CONFIG .enable_network_isolation
1422
1463
)
1423
1464
1465
+ _wait_for_schedule_changes_to_apply (monitor = my_attached_monitor )
1466
+
1467
+ my_attached_monitor .stop_monitoring_schedule ()
1468
+
1469
+ _wait_for_schedule_changes_to_apply (monitor = my_attached_monitor )
1470
+
1424
1471
1472
+ @pytest .mark .skipif (
1473
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
1474
+ reason = "ModelMonitoring is not yet supported in this region." ,
1475
+ )
1425
1476
def test_default_monitor_monitoring_execution_interactions (
1426
1477
sagemaker_session , default_monitoring_schedule_name
1427
1478
):
1428
-
1429
1479
my_attached_monitor = DefaultModelMonitor .attach (
1430
1480
monitor_schedule_name = default_monitoring_schedule_name , sagemaker_session = sagemaker_session
1431
1481
)
@@ -1462,6 +1512,10 @@ def test_default_monitor_monitoring_execution_interactions(
1462
1512
assert constraint_violations .body_dict ["violations" ][0 ]["feature_name" ] == "store_and_fwd_flag"
1463
1513
1464
1514
1515
+ @pytest .mark .skipif (
1516
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
1517
+ reason = "ModelMonitoring is not yet supported in this region." ,
1518
+ )
1465
1519
def test_byoc_monitor_suggest_baseline_and_create_monitoring_schedule_with_customizations (
1466
1520
sagemaker_session , output_kms_key , volume_kms_key , predictor
1467
1521
):
@@ -1666,10 +1720,20 @@ def test_byoc_monitor_suggest_baseline_and_create_monitoring_schedule_with_custo
1666
1720
== NETWORK_CONFIG .enable_network_isolation
1667
1721
)
1668
1722
1723
+ _wait_for_schedule_changes_to_apply (monitor = my_byoc_monitor )
1724
+
1725
+ my_byoc_monitor .stop_monitoring_schedule ()
1726
+
1727
+ _wait_for_schedule_changes_to_apply (monitor = my_byoc_monitor )
1728
+
1669
1729
summary = sagemaker_session .list_monitoring_schedules ()
1670
1730
assert len (summary ["MonitoringScheduleSummaries" ]) > 0
1671
1731
1672
1732
1733
+ @pytest .mark .skipif (
1734
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
1735
+ reason = "ModelMonitoring is not yet supported in this region." ,
1736
+ )
1673
1737
def test_byoc_monitor_suggest_baseline_and_create_monitoring_schedule_without_customizations (
1674
1738
sagemaker_session , predictor
1675
1739
):
@@ -1850,10 +1914,20 @@ def test_byoc_monitor_suggest_baseline_and_create_monitoring_schedule_without_cu
1850
1914
is None
1851
1915
)
1852
1916
1917
+ _wait_for_schedule_changes_to_apply (monitor = my_byoc_monitor )
1918
+
1919
+ my_byoc_monitor .stop_monitoring_schedule ()
1920
+
1921
+ _wait_for_schedule_changes_to_apply (monitor = my_byoc_monitor )
1922
+
1853
1923
summary = sagemaker_session .list_monitoring_schedules ()
1854
1924
assert len (summary ["MonitoringScheduleSummaries" ]) > 0
1855
1925
1856
1926
1927
+ @pytest .mark .skipif (
1928
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
1929
+ reason = "ModelMonitoring is not yet supported in this region." ,
1930
+ )
1857
1931
def test_byoc_monitor_create_and_update_schedule_config_with_customizations (
1858
1932
sagemaker_session ,
1859
1933
predictor ,
@@ -2123,9 +2197,20 @@ def test_byoc_monitor_create_and_update_schedule_config_with_customizations(
2123
2197
]["EnableNetworkIsolation" ]
2124
2198
== UPDATED_NETWORK_CONFIG .enable_network_isolation
2125
2199
)
2200
+
2201
+ _wait_for_schedule_changes_to_apply (monitor = my_byoc_monitor )
2202
+
2203
+ my_byoc_monitor .stop_monitoring_schedule ()
2204
+
2205
+ _wait_for_schedule_changes_to_apply (monitor = my_byoc_monitor )
2206
+
2126
2207
assert len (predictor .list_monitors ()) > 0
2127
2208
2128
2209
2210
+ @pytest .mark .skipif (
2211
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
2212
+ reason = "ModelMonitoring is not yet supported in this region." ,
2213
+ )
2129
2214
def test_byoc_monitor_attach_followed_by_baseline_and_update_monitoring_schedule (
2130
2215
sagemaker_session ,
2131
2216
predictor ,
@@ -2337,7 +2422,17 @@ def test_byoc_monitor_attach_followed_by_baseline_and_update_monitoring_schedule
2337
2422
== UPDATED_NETWORK_CONFIG .enable_network_isolation
2338
2423
)
2339
2424
2425
+ _wait_for_schedule_changes_to_apply (monitor = my_attached_monitor )
2426
+
2427
+ my_attached_monitor .stop_monitoring_schedule ()
2428
+
2429
+ _wait_for_schedule_changes_to_apply (monitor = my_attached_monitor )
2430
+
2340
2431
2432
+ @pytest .mark .skipif (
2433
+ tests .integ .test_region () in tests .integ .NO_MODEL_MONITORING_REGIONS ,
2434
+ reason = "ModelMonitoring is not yet supported in this region." ,
2435
+ )
2341
2436
def test_byoc_monitor_monitoring_execution_interactions (
2342
2437
sagemaker_session , byoc_monitoring_schedule_name
2343
2438
):
0 commit comments