|
26 | 26 | from six.moves.urllib.parse import urlparse |
27 | 27 | from botocore.exceptions import ClientError |
28 | 28 |
|
| 29 | +from sagemaker import image_uris |
29 | 30 | from sagemaker.exceptions import UnexpectedStatusException |
30 | 31 | from sagemaker.model_monitor.monitoring_files import Constraints, ConstraintViolations, Statistics |
31 | 32 | from sagemaker.network import NetworkConfig |
32 | 33 | from sagemaker.processing import Processor, ProcessingInput, ProcessingJob, ProcessingOutput |
33 | 34 | from sagemaker.s3 import S3Uploader |
34 | 35 | from sagemaker.session import Session |
35 | | -from sagemaker.utils import name_from_base, retries, get_ecr_image_uri_prefix |
36 | | - |
37 | | -_DEFAULT_MONITOR_IMAGE_URI_WITH_PLACEHOLDERS = "{}/sagemaker-model-monitor-analyzer" |
38 | | - |
39 | | -_DEFAULT_MONITOR_IMAGE_REGION_ACCOUNT_MAPPING = { |
40 | | - "eu-north-1": "895015795356", |
41 | | - "me-south-1": "607024016150", |
42 | | - "ap-south-1": "126357580389", |
43 | | - "us-east-2": "777275614652", |
44 | | - "eu-west-1": "468650794304", |
45 | | - "eu-central-1": "048819808253", |
46 | | - "sa-east-1": "539772159869", |
47 | | - "ap-east-1": "001633400207", |
48 | | - "us-east-1": "156813124566", |
49 | | - "ap-northeast-2": "709848358524", |
50 | | - "eu-west-2": "749857270468", |
51 | | - "eu-west-3": "680080141114", |
52 | | - "ap-northeast-1": "574779866223", |
53 | | - "us-west-2": "159807026194", |
54 | | - "us-west-1": "890145073186", |
55 | | - "ap-southeast-1": "245545462676", |
56 | | - "ap-southeast-2": "563025443158", |
57 | | - "ca-central-1": "536280801234", |
58 | | - "cn-north-1": "453000072557", |
59 | | - "cn-northwest-1": "453252182341", |
60 | | -} |
| 36 | +from sagemaker.utils import name_from_base, retries |
| 37 | + |
| 38 | +DEFAULT_REPOSITORY_NAME = "sagemaker-model-monitor-analyzer" |
61 | 39 |
|
62 | 40 | STATISTICS_JSON_DEFAULT_FILE_NAME = "statistics.json" |
63 | 41 | CONSTRAINTS_JSON_DEFAULT_FILE_NAME = "constraints.json" |
|
89 | 67 |
|
90 | 68 | _LOGGER = logging.getLogger(__name__) |
91 | 69 |
|
| 70 | +framework_name = "model-monitor" |
| 71 | + |
92 | 72 |
|
93 | 73 | class ModelMonitor(object): |
94 | 74 | """Sets up Amazon SageMaker Monitoring Schedules and baseline suggestions. Use this class when |
@@ -1787,9 +1767,7 @@ def _get_default_image_uri(region): |
1787 | 1767 | Returns: |
1788 | 1768 | str: The Default Model Monitoring image uri based on the region. |
1789 | 1769 | """ |
1790 | | - return _DEFAULT_MONITOR_IMAGE_URI_WITH_PLACEHOLDERS.format( |
1791 | | - get_ecr_image_uri_prefix(_DEFAULT_MONITOR_IMAGE_REGION_ACCOUNT_MAPPING[region], region) |
1792 | | - ) |
| 1770 | + return image_uris.retrieve(framework=framework_name, region=region) |
1793 | 1771 |
|
1794 | 1772 |
|
1795 | 1773 | class BaseliningJob(ProcessingJob): |
|
0 commit comments