|
| 1 | +# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"). You |
| 4 | +# may not use this file except in compliance with the License. A copy of |
| 5 | +# the License is located at |
| 6 | +# |
| 7 | +# http://aws.amazon.com/apache2.0/ |
| 8 | +# |
| 9 | +# or in the "license" file accompanying this file. This file is |
| 10 | +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF |
| 11 | +# ANY KIND, either express or implied. See the License for the specific |
| 12 | +# language governing permissions and limitations under the License. |
| 13 | +from __future__ import absolute_import |
| 14 | + |
| 15 | +from sagemaker import image_uris |
| 16 | +from tests.unit.sagemaker.image_uris import expected_uris, regions |
| 17 | + |
| 18 | +DATA_WRANGLER_ACCOUNTS = { |
| 19 | + "af-south-1": "143210264188", |
| 20 | + "ap-east-1": "707077482487", |
| 21 | + "ap-northeast-1": "649008135260", |
| 22 | + "ap-northeast-2": "131546521161", |
| 23 | + "ap-south-1": "089933028263", |
| 24 | + "ap-southeast-1": "119527597002", |
| 25 | + "ap-southeast-2": "422173101802", |
| 26 | + "ca-central-1": "557239378090", |
| 27 | + "eu-central-1": "024640144536", |
| 28 | + "eu-north-1": "054986407534", |
| 29 | + "eu-south-1": "488287956546", |
| 30 | + "eu-west-1": "245179582081", |
| 31 | + "eu-west-2": "894491911112", |
| 32 | + "eu-west-3": "807237891255", |
| 33 | + "me-south-1": "376037874950", |
| 34 | + "sa-east-1": "424196993095", |
| 35 | + "us-east-1": "663277389841", |
| 36 | + "us-east-2": "415577184552", |
| 37 | + "us-west-1": "926135532090", |
| 38 | + "us-west-2": "174368400705", |
| 39 | + "cn-north-1": "245909111842", |
| 40 | + "cn-northwest-1": "249157047649", |
| 41 | +} |
| 42 | + |
| 43 | + |
| 44 | +def test_data_wrangler_ecr_uri(): |
| 45 | + for region in regions.regions(): |
| 46 | + if region in DATA_WRANGLER_ACCOUNTS.keys(): |
| 47 | + actual_uri = image_uris.retrieve("data-wrangler", region=region) |
| 48 | + |
| 49 | + expected_uri = expected_uris.algo_uri( |
| 50 | + "sagemaker-data-wrangler-container", |
| 51 | + DATA_WRANGLER_ACCOUNTS[region], |
| 52 | + region, |
| 53 | + version="1.x", |
| 54 | + ) |
| 55 | + assert expected_uri == actual_uri |
0 commit comments