sagemaker-core 0.1.3__py3-none-any.whl → 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sagemaker-core might be problematic. Click here for more details.
- sagemaker_core/__init__.py +4 -0
- sagemaker_core/helper/session_helper.py +769 -0
- sagemaker_core/{code_injection → main/code_injection}/codec.py +2 -2
- sagemaker_core/{code_injection → main/code_injection}/constants.py +10 -0
- sagemaker_core/{code_injection → main/code_injection}/shape_dag.py +48 -0
- sagemaker_core/{generated → main}/config_schema.py +47 -0
- sagemaker_core/{generated → main}/intelligent_defaults_helper.py +8 -8
- sagemaker_core/{generated → main}/resources.py +2716 -1284
- sagemaker_core/main/shapes.py +11650 -0
- sagemaker_core/main/user_agent.py +77 -0
- sagemaker_core/{generated → main}/utils.py +246 -10
- sagemaker_core/resources/__init__.py +1 -0
- sagemaker_core/shapes/__init__.py +1 -0
- sagemaker_core/tools/__init__.py +1 -1
- sagemaker_core/tools/codegen.py +1 -2
- sagemaker_core/tools/constants.py +3 -8
- sagemaker_core/tools/method.py +1 -1
- sagemaker_core/tools/resources_codegen.py +30 -28
- sagemaker_core/tools/resources_extractor.py +4 -8
- sagemaker_core/tools/shapes_codegen.py +16 -10
- sagemaker_core/tools/shapes_extractor.py +1 -1
- sagemaker_core/tools/templates.py +109 -122
- sagemaker_core-1.0.1.dist-info/METADATA +81 -0
- sagemaker_core-1.0.1.dist-info/RECORD +34 -0
- {sagemaker_core-0.1.3.dist-info → sagemaker_core-1.0.1.dist-info}/WHEEL +1 -1
- sagemaker_core/generated/shapes.py +0 -11584
- sagemaker_core/util/util.py +0 -81
- sagemaker_core-0.1.3.dist-info/METADATA +0 -28
- sagemaker_core-0.1.3.dist-info/RECORD +0 -31
- /sagemaker_core/{code_injection → helper}/__init__.py +0 -0
- /sagemaker_core/{generated → main}/__init__.py +0 -0
- /sagemaker_core/{util → main/code_injection}/__init__.py +0 -0
- /sagemaker_core/{code_injection → main/code_injection}/base.py +0 -0
- /sagemaker_core/{generated → main}/exceptions.py +0 -0
- {sagemaker_core-0.1.3.dist-info → sagemaker_core-1.0.1.dist-info}/LICENSE +0 -0
- {sagemaker_core-0.1.3.dist-info → sagemaker_core-1.0.1.dist-info}/top_level.txt +0 -0
|
@@ -15,8 +15,8 @@ import logging
|
|
|
15
15
|
from dataclasses import asdict
|
|
16
16
|
import re
|
|
17
17
|
|
|
18
|
-
from sagemaker_core.code_injection.shape_dag import SHAPE_DAG
|
|
19
|
-
from sagemaker_core.code_injection.constants import (
|
|
18
|
+
from sagemaker_core.main.code_injection.shape_dag import SHAPE_DAG
|
|
19
|
+
from sagemaker_core.main.code_injection.constants import (
|
|
20
20
|
BASIC_TYPES,
|
|
21
21
|
STRUCTURE_TYPE,
|
|
22
22
|
LIST_TYPE,
|
|
@@ -11,8 +11,18 @@
|
|
|
11
11
|
# ANY KIND, either express or implied. See the License for the specific
|
|
12
12
|
# language governing permissions and limitations under the License.
|
|
13
13
|
"""Constants used in the code_injection modules."""
|
|
14
|
+
from enum import Enum
|
|
14
15
|
|
|
15
16
|
BASIC_TYPES = ["string", "boolean", "integer", "long", "double", "timestamp", "float"]
|
|
16
17
|
STRUCTURE_TYPE = "structure"
|
|
17
18
|
MAP_TYPE = "map"
|
|
18
19
|
LIST_TYPE = "list"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Color(Enum):
|
|
23
|
+
RED = "rgb(215,0,0)"
|
|
24
|
+
GREEN = "rgb(0,135,0)"
|
|
25
|
+
BLUE = "rgb(0,105,255)"
|
|
26
|
+
YELLOW = "rgb(215,175,0)"
|
|
27
|
+
PURPLE = "rgb(225,0,225)"
|
|
28
|
+
BRIGHT_RED = "rgb(255,0,0)"
|
|
@@ -339,6 +339,7 @@ SHAPE_DAG = {
|
|
|
339
339
|
],
|
|
340
340
|
"type": "structure",
|
|
341
341
|
},
|
|
342
|
+
"AssumableRoleArns": {"member_shape": "RoleArn", "member_type": "string", "type": "list"},
|
|
342
343
|
"AsyncInferenceClientConfig": {
|
|
343
344
|
"members": [
|
|
344
345
|
{
|
|
@@ -481,6 +482,16 @@ SHAPE_DAG = {
|
|
|
481
482
|
],
|
|
482
483
|
"type": "structure",
|
|
483
484
|
},
|
|
485
|
+
"AutoMLComputeConfig": {
|
|
486
|
+
"members": [
|
|
487
|
+
{
|
|
488
|
+
"name": "EmrServerlessComputeConfig",
|
|
489
|
+
"shape": "EmrServerlessComputeConfig",
|
|
490
|
+
"type": "structure",
|
|
491
|
+
}
|
|
492
|
+
],
|
|
493
|
+
"type": "structure",
|
|
494
|
+
},
|
|
484
495
|
"AutoMLContainerDefinition": {
|
|
485
496
|
"members": [
|
|
486
497
|
{"name": "Image", "shape": "ContainerImage", "type": "string"},
|
|
@@ -914,6 +925,11 @@ SHAPE_DAG = {
|
|
|
914
925
|
{"name": "DirectDeploySettings", "shape": "DirectDeploySettings", "type": "structure"},
|
|
915
926
|
{"name": "KendraSettings", "shape": "KendraSettings", "type": "structure"},
|
|
916
927
|
{"name": "GenerativeAiSettings", "shape": "GenerativeAiSettings", "type": "structure"},
|
|
928
|
+
{
|
|
929
|
+
"name": "EmrServerlessSettings",
|
|
930
|
+
"shape": "EmrServerlessSettings",
|
|
931
|
+
"type": "structure",
|
|
932
|
+
},
|
|
917
933
|
],
|
|
918
934
|
"type": "structure",
|
|
919
935
|
},
|
|
@@ -1616,6 +1632,7 @@ SHAPE_DAG = {
|
|
|
1616
1632
|
{"name": "AutoMLJobObjective", "shape": "AutoMLJobObjective", "type": "structure"},
|
|
1617
1633
|
{"name": "ModelDeployConfig", "shape": "ModelDeployConfig", "type": "structure"},
|
|
1618
1634
|
{"name": "DataSplitConfig", "shape": "AutoMLDataSplitConfig", "type": "structure"},
|
|
1635
|
+
{"name": "AutoMLComputeConfig", "shape": "AutoMLComputeConfig", "type": "structure"},
|
|
1619
1636
|
],
|
|
1620
1637
|
"type": "structure",
|
|
1621
1638
|
},
|
|
@@ -3764,6 +3781,7 @@ SHAPE_DAG = {
|
|
|
3764
3781
|
{"name": "ModelDeployResult", "shape": "ModelDeployResult", "type": "structure"},
|
|
3765
3782
|
{"name": "DataSplitConfig", "shape": "AutoMLDataSplitConfig", "type": "structure"},
|
|
3766
3783
|
{"name": "SecurityConfig", "shape": "AutoMLSecurityConfig", "type": "structure"},
|
|
3784
|
+
{"name": "AutoMLComputeConfig", "shape": "AutoMLComputeConfig", "type": "structure"},
|
|
3767
3785
|
],
|
|
3768
3786
|
"type": "structure",
|
|
3769
3787
|
},
|
|
@@ -5808,6 +5826,24 @@ SHAPE_DAG = {
|
|
|
5808
5826
|
"type": "structure",
|
|
5809
5827
|
},
|
|
5810
5828
|
"Edges": {"member_shape": "Edge", "member_type": "structure", "type": "list"},
|
|
5829
|
+
"EmrServerlessComputeConfig": {
|
|
5830
|
+
"members": [{"name": "ExecutionRoleARN", "shape": "RoleArn", "type": "string"}],
|
|
5831
|
+
"type": "structure",
|
|
5832
|
+
},
|
|
5833
|
+
"EmrServerlessSettings": {
|
|
5834
|
+
"members": [
|
|
5835
|
+
{"name": "ExecutionRoleArn", "shape": "RoleArn", "type": "string"},
|
|
5836
|
+
{"name": "Status", "shape": "FeatureStatus", "type": "string"},
|
|
5837
|
+
],
|
|
5838
|
+
"type": "structure",
|
|
5839
|
+
},
|
|
5840
|
+
"EmrSettings": {
|
|
5841
|
+
"members": [
|
|
5842
|
+
{"name": "AssumableRoleArns", "shape": "AssumableRoleArns", "type": "list"},
|
|
5843
|
+
{"name": "ExecutionRoleArns", "shape": "ExecutionRoleArns", "type": "list"},
|
|
5844
|
+
],
|
|
5845
|
+
"type": "structure",
|
|
5846
|
+
},
|
|
5811
5847
|
"EnableSagemakerServicecatalogPortfolioInput": {"members": [], "type": "structure"},
|
|
5812
5848
|
"EnableSagemakerServicecatalogPortfolioOutput": {"members": [], "type": "structure"},
|
|
5813
5849
|
"Endpoint": {
|
|
@@ -5831,6 +5867,10 @@ SHAPE_DAG = {
|
|
|
5831
5867
|
],
|
|
5832
5868
|
"type": "structure",
|
|
5833
5869
|
},
|
|
5870
|
+
"EndpointConfigStepMetadata": {
|
|
5871
|
+
"members": [{"name": "Arn", "shape": "EndpointConfigArn", "type": "string"}],
|
|
5872
|
+
"type": "structure",
|
|
5873
|
+
},
|
|
5834
5874
|
"EndpointConfigSummary": {
|
|
5835
5875
|
"members": [
|
|
5836
5876
|
{"name": "EndpointConfigName", "shape": "EndpointConfigName", "type": "string"},
|
|
@@ -5937,6 +5977,10 @@ SHAPE_DAG = {
|
|
|
5937
5977
|
"member_type": "structure",
|
|
5938
5978
|
"type": "list",
|
|
5939
5979
|
},
|
|
5980
|
+
"EndpointStepMetadata": {
|
|
5981
|
+
"members": [{"name": "Arn", "shape": "EndpointArn", "type": "string"}],
|
|
5982
|
+
"type": "structure",
|
|
5983
|
+
},
|
|
5940
5984
|
"EndpointSummary": {
|
|
5941
5985
|
"members": [
|
|
5942
5986
|
{"name": "EndpointName", "shape": "EndpointName", "type": "string"},
|
|
@@ -5979,6 +6023,7 @@ SHAPE_DAG = {
|
|
|
5979
6023
|
"member_type": "structure",
|
|
5980
6024
|
"type": "list",
|
|
5981
6025
|
},
|
|
6026
|
+
"ExecutionRoleArns": {"member_shape": "RoleArn", "member_type": "string", "type": "list"},
|
|
5982
6027
|
"Experiment": {
|
|
5983
6028
|
"members": [
|
|
5984
6029
|
{"name": "ExperimentName", "shape": "ExperimentEntityName", "type": "string"},
|
|
@@ -7461,6 +7506,7 @@ SHAPE_DAG = {
|
|
|
7461
7506
|
{"name": "CustomImages", "shape": "CustomImages", "type": "list"},
|
|
7462
7507
|
{"name": "LifecycleConfigArns", "shape": "LifecycleConfigArns", "type": "list"},
|
|
7463
7508
|
{"name": "CodeRepositories", "shape": "CodeRepositories", "type": "list"},
|
|
7509
|
+
{"name": "EmrSettings", "shape": "EmrSettings", "type": "structure"},
|
|
7464
7510
|
],
|
|
7465
7511
|
"type": "structure",
|
|
7466
7512
|
},
|
|
@@ -11141,6 +11187,8 @@ SHAPE_DAG = {
|
|
|
11141
11187
|
{"name": "ClarifyCheck", "shape": "ClarifyCheckStepMetadata", "type": "structure"},
|
|
11142
11188
|
{"name": "Fail", "shape": "FailStepMetadata", "type": "structure"},
|
|
11143
11189
|
{"name": "AutoMLJob", "shape": "AutoMLJobStepMetadata", "type": "structure"},
|
|
11190
|
+
{"name": "Endpoint", "shape": "EndpointStepMetadata", "type": "structure"},
|
|
11191
|
+
{"name": "EndpointConfig", "shape": "EndpointConfigStepMetadata", "type": "structure"},
|
|
11144
11192
|
],
|
|
11145
11193
|
"type": "structure",
|
|
11146
11194
|
},
|
|
@@ -87,6 +87,11 @@ SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA = {
|
|
|
87
87
|
},
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
|
+
"auto_ml_compute_config": {
|
|
91
|
+
"emr_serverless_compute_config": {
|
|
92
|
+
"execution_role_arn": {"type": "string"}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
90
95
|
},
|
|
91
96
|
},
|
|
92
97
|
"Cluster": {
|
|
@@ -212,6 +217,21 @@ SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA = {
|
|
|
212
217
|
"generative_ai_settings": {
|
|
213
218
|
"amazon_bedrock_role_arn": {"type": "string"}
|
|
214
219
|
},
|
|
220
|
+
"emr_serverless_settings": {
|
|
221
|
+
"execution_role_arn": {"type": "string"}
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
"jupyter_lab_app_settings": {
|
|
225
|
+
"emr_settings": {
|
|
226
|
+
"assumable_role_arns": {
|
|
227
|
+
"type": "array",
|
|
228
|
+
"items": {"type": "string"},
|
|
229
|
+
},
|
|
230
|
+
"execution_role_arns": {
|
|
231
|
+
"type": "array",
|
|
232
|
+
"items": {"type": "string"},
|
|
233
|
+
},
|
|
234
|
+
}
|
|
215
235
|
},
|
|
216
236
|
},
|
|
217
237
|
"domain_settings": {
|
|
@@ -237,6 +257,18 @@ SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA = {
|
|
|
237
257
|
"type": "array",
|
|
238
258
|
"items": {"type": "string"},
|
|
239
259
|
},
|
|
260
|
+
"jupyter_lab_app_settings": {
|
|
261
|
+
"emr_settings": {
|
|
262
|
+
"assumable_role_arns": {
|
|
263
|
+
"type": "array",
|
|
264
|
+
"items": {"type": "string"},
|
|
265
|
+
},
|
|
266
|
+
"execution_role_arns": {
|
|
267
|
+
"type": "array",
|
|
268
|
+
"items": {"type": "string"},
|
|
269
|
+
},
|
|
270
|
+
}
|
|
271
|
+
},
|
|
240
272
|
},
|
|
241
273
|
},
|
|
242
274
|
},
|
|
@@ -836,6 +868,21 @@ SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA = {
|
|
|
836
868
|
"generative_ai_settings": {
|
|
837
869
|
"amazon_bedrock_role_arn": {"type": "string"}
|
|
838
870
|
},
|
|
871
|
+
"emr_serverless_settings": {
|
|
872
|
+
"execution_role_arn": {"type": "string"}
|
|
873
|
+
},
|
|
874
|
+
},
|
|
875
|
+
"jupyter_lab_app_settings": {
|
|
876
|
+
"emr_settings": {
|
|
877
|
+
"assumable_role_arns": {
|
|
878
|
+
"type": "array",
|
|
879
|
+
"items": {"type": "string"},
|
|
880
|
+
},
|
|
881
|
+
"execution_role_arns": {
|
|
882
|
+
"type": "array",
|
|
883
|
+
"items": {"type": "string"},
|
|
884
|
+
},
|
|
885
|
+
}
|
|
839
886
|
},
|
|
840
887
|
}
|
|
841
888
|
},
|
|
@@ -25,23 +25,23 @@ from platformdirs import site_config_dir, user_config_dir
|
|
|
25
25
|
|
|
26
26
|
from botocore.utils import merge_dicts
|
|
27
27
|
from six.moves.urllib.parse import urlparse
|
|
28
|
-
from sagemaker_core.
|
|
29
|
-
from sagemaker_core.
|
|
28
|
+
from sagemaker_core.main.config_schema import SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA
|
|
29
|
+
from sagemaker_core.main.exceptions import (
|
|
30
30
|
LocalConfigNotFoundError,
|
|
31
31
|
S3ConfigNotFoundError,
|
|
32
32
|
IntelligentDefaultsError,
|
|
33
33
|
ConfigSchemaValidationError,
|
|
34
34
|
)
|
|
35
|
+
from sagemaker_core.main.utils import get_textual_rich_logger
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
logger = logging.getLogger(__name__)
|
|
37
|
+
logger = get_textual_rich_logger(__name__)
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
_APP_NAME = "sagemaker"
|
|
41
41
|
# The default name of the config file.
|
|
42
42
|
_CONFIG_FILE_NAME = "config.yaml"
|
|
43
43
|
# The default config file location of the Administrator provided config file. This path can be
|
|
44
|
-
# overridden with `
|
|
44
|
+
# overridden with `SAGEMAKER_CORE_ADMIN_CONFIG_OVERRIDE` environment variable.
|
|
45
45
|
_DEFAULT_ADMIN_CONFIG_FILE_PATH = os.path.join(site_config_dir(_APP_NAME), _CONFIG_FILE_NAME)
|
|
46
46
|
# The default config file location of the user provided config file. This path can be
|
|
47
47
|
# overridden with `SAGEMAKER_USER_CONFIG_OVERRIDE` environment variable.
|
|
@@ -50,8 +50,8 @@ _DEFAULT_USER_CONFIG_FILE_PATH = os.path.join(user_config_dir(_APP_NAME), _CONFI
|
|
|
50
50
|
_DEFAULT_LOCAL_MODE_CONFIG_FILE_PATH = os.path.join(
|
|
51
51
|
os.path.expanduser("~"), ".sagemaker", _CONFIG_FILE_NAME
|
|
52
52
|
)
|
|
53
|
-
ENV_VARIABLE_ADMIN_CONFIG_OVERRIDE = "
|
|
54
|
-
ENV_VARIABLE_USER_CONFIG_OVERRIDE = "
|
|
53
|
+
ENV_VARIABLE_ADMIN_CONFIG_OVERRIDE = "SAGEMAKER_CORE_ADMIN_CONFIG_OVERRIDE"
|
|
54
|
+
ENV_VARIABLE_USER_CONFIG_OVERRIDE = "SAGEMAKER_CORE_USER_CONFIG_OVERRIDE"
|
|
55
55
|
|
|
56
56
|
S3_PREFIX = "s3://"
|
|
57
57
|
|
|
@@ -192,7 +192,7 @@ def get_config_value(attribute, resource_defaults, global_defaults):
|
|
|
192
192
|
return resource_defaults[attribute]
|
|
193
193
|
if global_defaults and attribute in global_defaults:
|
|
194
194
|
return global_defaults[attribute]
|
|
195
|
-
logger.
|
|
195
|
+
logger.debug(
|
|
196
196
|
f"Configurable value {attribute} not entered in parameters or present in the Config"
|
|
197
197
|
)
|
|
198
198
|
return None
|