File size: 4,664 Bytes
476455e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from __future__ import absolute_import

import logging
import os

import boto3

DATA_DIR = os.path.join(os.path.dirname(__file__), "..", "data")
TRAINING_DEFAULT_TIMEOUT_MINUTES = 40
TUNING_DEFAULT_TIMEOUT_MINUTES = 40
TRANSFORM_DEFAULT_TIMEOUT_MINUTES = 40
AUTO_ML_DEFAULT_TIMEMOUT_MINUTES = 60

# these regions have some p2 and p3 instances, but not enough for continuous testing
HOSTING_NO_P2_REGIONS = [
    "af-south-1",
    "ap-east-1",
    "ca-central-1",
    "eu-central-1",
    "eu-north-1",
    "eu-west-2",
    "eu-west-3",
    "eu-south-1",
    "sa-east-1",
    "us-west-1",
]
HOSTING_NO_P3_REGIONS = [
    "af-south-1",
    "ap-east-1",
    "ap-south-1",
    "ap-southeast-1",
    "ap-southeast-2",
    "ca-central-1",
    "eu-central-1",
    "eu-north-1",
    "eu-west-2",
    "eu-west-3",
    "eu-south-1",
    "sa-east-1",
    "us-west-1",
]
TRAINING_NO_P2_REGIONS = [
    "af-south-1",
    "ap-east-1",
    "ap-southeast-1",
    "ap-southeast-2",
    "ca-central-1",
    "eu-central-1",
    "eu-north-1",
    "eu-west-2",
    "eu-west-3",
    "eu-south-1",
    "me-south-1",
    "sa-east-1",
    "us-west-1",
]
TRAINING_NO_P3_REGIONS = [
    "af-south-1",
    "ap-east-1",
    "ap-southeast-1",  # it has p3, but not enough
    "ap-southeast-2",  # it has p3, but not enough
    "ca-central-1",  # it has p3, but not enough
    "eu-central-1",  # it has p3, but not enough
    "eu-north-1",
    "eu-west-1",  # it has p3, but not enough
    "eu-west-2",  # it has p3, but not enough
    "eu-west-3",
    "eu-south-1",
    "me-south-1",
    "sa-east-1",
    "us-west-1",
    "ap-northeast-1",  # it has p3, but not enough
    "ap-south-1",
    "ap-northeast-2",  # it has p3, but not enough
    "us-east-2",  # it has p3, but not enough
]

# EI is currently only supported in the following regions
# regions were derived from https://aws.amazon.com/machine-learning/elastic-inference/pricing/
EI_SUPPORTED_REGIONS = [
    "ap-northeast-1",
    "ap-northeast-2",
    "eu-west-1",
    "us-east-1",
    "us-east-2",
    "us-west-2",
]

RL_SUPPORTED_REGIONS = (
    "ap-northeast-1",
    "ap-northeast-2",
    "ap-south-1",
    "ap-southeast-1",
    "ap-southeast-2",
    "ca-central-1",
    "eu-central-1",
    "eu-west-1",
    "eu-west-2",
    "us-east-1",
    "us-east-2",
    "us-west-1",
    "us-west-2",
)

NO_LDA_REGIONS = [
    "eu-west-3",
    "eu-north-1",
    "sa-east-1",
    "ap-east-1",
    "me-south-1",
    "af-south-1",
    "eu-south-1",
]
NO_MARKET_PLACE_REGIONS = [
    "eu-west-3",
    "eu-north-1",
    "sa-east-1",
    "ap-east-1",
    "me-south-1",
    "af-south-1",
    "eu-south-1",
]
NO_AUTO_ML_REGIONS = [
    "eu-west-3",
    "af-south-1",
    "eu-south-1",
]
NO_MODEL_MONITORING_REGIONS = ["me-south-1", "af-south-1", "eu-south-1"]
DRIFT_CHECK_BASELINES_SUPPORTED_REGIONS = [
    "us-east-2",
    "ca-central-1",
    "me-south-1",
    "us-west-2",
    "ap-east-1",
    "ap-northeast-2",
    "ap-southeast-2",
    "eu-west-2",
    "us-east-1",
]
EDGE_PACKAGING_SUPPORTED_REGIONS = [
    "us-east-2",
    "us-west-2",
    "us-east-1",
    "eu-west-1",
    "ap-northeast-1",
    "eu-central-1",
]
# TODO: SM Training Compiler team to add all supported regions.
TRAINING_COMPILER_SUPPORTED_REGIONS = [
    "af-south-1",
    "ap-east-1",
    "ap-northeast-1",
    "ap-northeast-2",
    "ap-northeast-3",
    "ap-south-1",
    "ap-southeast-1",
    "ap-southeast-2",
    "ca-central-1",
    "eu-central-1",
    "eu-north-1",
    "eu-south-1",
    "eu-west-1",
    "eu-west-2",
    "eu-west-3",
    "me-south-1",
    "sa-east-1",
    "us-east-1",
    "us-east-2",
    "us-west-1",
    "us-west-2",
]
# Data parallelism need to be tested with p3.16xlarge.
# The instance type is expensive and not supported in all the regions.
# Limiting the test to run in IAD and CMH
DATA_PARALLEL_TESTING_REGIONS = ["us-east-2", "us-east-1"]


EFS_TEST_ENABLED_REGION = []

logging.getLogger("boto3").setLevel(logging.INFO)
logging.getLogger("botocore").setLevel(logging.INFO)


def test_region():
    return os.environ.get("TEST_AWS_REGION_NAME", boto3.session.Session().region_name)