1- # Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+ # Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22#
33# Licensed under the Apache License, Version 2.0 (the "License"). You
44# may not use this file except in compliance with the License. A copy of
5656VALID_PY_VERSIONS = ["py2" , "py3" ]
5757VALID_EIA_FRAMEWORKS = ["tensorflow" , "tensorflow-serving" , "mxnet" , "mxnet-serving" ]
5858VALID_ACCOUNTS_BY_REGION = {"us-gov-west-1" : "246785580436" , "us-iso-east-1" : "744548109606" }
59+ ASIMOV_VALID_ACCOUNTS_BY_REGION = {"us-iso-east-1" : "886529160074" }
5960OPT_IN_ACCOUNTS_BY_REGION = {"ap-east-1" : "057415533634" }
6061ASIMOV_OPT_IN_ACCOUNTS_BY_REGION = {"ap-east-1" : "871362719292" }
6162
6263MERGED_FRAMEWORKS_REPO_MAP = {
6364 "tensorflow-scriptmode" : "tensorflow-training" ,
64- "mxnet" : "mxnet-training" ,
6565 "tensorflow-serving" : "tensorflow-inference" ,
6666 "tensorflow-serving-eia" : "tensorflow-inference-eia" ,
67+ "mxnet" : "mxnet-training" ,
68+ "mxnet-serving" : "mxnet-inference" ,
6769 "mxnet-serving-eia" : "mxnet-inference-eia" ,
6870}
6971
7072MERGED_FRAMEWORKS_LOWEST_VERSIONS = {
7173 "tensorflow-scriptmode" : [1 , 13 , 1 ],
72- "mxnet" : [1 , 4 , 1 ],
7374 "tensorflow-serving" : [1 , 13 , 0 ],
7475 "tensorflow-serving-eia" : [1 , 14 , 0 ],
76+ "mxnet" : [1 , 4 , 1 ],
77+ "mxnet-serving" : [1 , 4 , 1 ],
7578 "mxnet-serving-eia" : [1 , 4 , 1 ],
7679}
7780
@@ -116,13 +119,9 @@ def _using_merged_images(region, framework, py_version, framework_version):
116119 is_py3 = py_version == "py3" or py_version is None
117120 is_merged_versions = _is_merged_versions (framework , framework_version )
118121 return (
119- (not is_gov_region )
122+ (( not is_gov_region ) or region in ASIMOV_VALID_ACCOUNTS_BY_REGION )
120123 and is_merged_versions
121- and (
122- is_py3
123- or _is_tf_14_or_later (framework , framework_version )
124- or _is_mxnet_serving_141_or_later (framework , framework_version )
125- )
124+ and (is_py3 or _is_tf_14_or_later (framework , framework_version ))
126125 )
127126
128127
@@ -140,24 +139,6 @@ def _is_tf_14_or_later(framework, framework_version):
140139 )
141140
142141
143- def _is_mxnet_serving_141_or_later (framework , framework_version ):
144- """
145- Args:
146- framework:
147- framework_version:
148- """
149- asimov_lowest_mxnet = [1 , 4 , 1 ]
150-
151- version = [int (s ) for s in framework_version .split ("." )]
152-
153- if len (version ) == 2 :
154- version .append (0 )
155-
156- return (
157- framework .startswith ("mxnet-serving" ) and version >= asimov_lowest_mxnet [0 : len (version )]
158- )
159-
160-
161142def _registry_id (region , framework , py_version , account , framework_version ):
162143 """
163144 Args:
@@ -171,6 +152,8 @@ def _registry_id(region, framework, py_version, account, framework_version):
171152 if _using_merged_images (region , framework , py_version , framework_version ):
172153 if region in ASIMOV_OPT_IN_ACCOUNTS_BY_REGION :
173154 return ASIMOV_OPT_IN_ACCOUNTS_BY_REGION .get (region )
155+ if region in ASIMOV_VALID_ACCOUNTS_BY_REGION :
156+ return ASIMOV_VALID_ACCOUNTS_BY_REGION .get (region )
174157 return "763104351884"
175158 if region in OPT_IN_ACCOUNTS_BY_REGION :
176159 return OPT_IN_ACCOUNTS_BY_REGION .get (region )
0 commit comments