diff --git a/sample/sagemaker-metrics/2022-09-30/service-2.json b/sample/sagemaker-metrics/2022-09-30/service-2.json index fb2d62b2..74c09d9e 100644 --- a/sample/sagemaker-metrics/2022-09-30/service-2.json +++ b/sample/sagemaker-metrics/2022-09-30/service-2.json @@ -4,14 +4,26 @@ "apiVersion":"2022-09-30", "endpointPrefix":"metrics.sagemaker", "protocol":"rest-json", + "protocols":["rest-json"], "serviceAbbreviation":"SageMaker Metrics", "serviceFullName":"Amazon SageMaker Metrics Service", "serviceId":"SageMaker Metrics", "signatureVersion":"v4", "signingName":"sagemaker", - "uid":"sagemaker-metrics-2022-09-30" + "uid":"sagemaker-metrics-2022-09-30", + "auth":["aws.auth#sigv4"] }, "operations":{ + "BatchGetMetrics":{ + "name":"BatchGetMetrics", + "http":{ + "method":"POST", + "requestUri":"/BatchGetMetrics" + }, + "input":{"shape":"BatchGetMetricsRequest"}, + "output":{"shape":"BatchGetMetricsResponse"}, + "documentation":"
Used to retrieve training metrics from SageMaker.
" + }, "BatchPutMetrics":{ "name":"BatchPutMetrics", "http":{ @@ -20,10 +32,29 @@ }, "input":{"shape":"BatchPutMetricsRequest"}, "output":{"shape":"BatchPutMetricsResponse"}, - "documentation":"Used to ingest training metrics into SageMaker. These metrics can be visualized in SageMaker Studio and retrieved with the GetMetrics API.
Used to ingest training metrics into SageMaker. These metrics can be visualized in SageMaker Studio.
" } }, "shapes":{ + "BatchGetMetricsRequest":{ + "type":"structure", + "required":["MetricQueries"], + "members":{ + "MetricQueries":{ + "shape":"MetricQueryList", + "documentation":"Queries made to retrieve training metrics from SageMaker.
" + } + } + }, + "BatchGetMetricsResponse":{ + "type":"structure", + "members":{ + "MetricQueryResults":{ + "shape":"MetricQueryResultList", + "documentation":"The results of a query to retrieve training metrics from SageMaker.
" + } + } + }, "BatchPutMetricsError":{ "type":"structure", "members":{ @@ -53,7 +84,7 @@ "members":{ "TrialComponentName":{ "shape":"ExperimentEntityName", - "documentation":"The name of the Trial Component to associate with the metrics.
" + "documentation":"The name of the Trial Component to associate with the metrics. The Trial Component name must be entirely lowercase.
" }, "MetricData":{ "shape":"RawMetricDataList", @@ -75,15 +106,136 @@ "type":"string", "max":120, "min":1, - "pattern":"^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,119}" + "pattern":"^[a-z0-9](-*[a-z0-9]){0,119}" }, "Integer":{"type":"integer"}, + "Long":{"type":"long"}, + "Message":{ + "type":"string", + "max":2048, + "pattern":".*" + }, "MetricName":{ "type":"string", "max":255, "min":1, "pattern":".+" }, + "MetricQuery":{ + "type":"structure", + "required":[ + "MetricName", + "ResourceArn", + "MetricStat", + "Period", + "XAxisType" + ], + "members":{ + "MetricName":{ + "shape":"MetricName", + "documentation":"The name of the metric to retrieve.
" + }, + "ResourceArn":{ + "shape":"SageMakerResourceArn", + "documentation":"The ARN of the SageMaker resource to retrieve metrics for.
" + }, + "MetricStat":{ + "shape":"MetricStatistic", + "documentation":"The metrics stat type of metrics to retrieve.
" + }, + "Period":{ + "shape":"Period", + "documentation":"The time period of metrics to retrieve.
" + }, + "XAxisType":{ + "shape":"XAxisType", + "documentation":"The x-axis type of metrics to retrieve.
" + }, + "Start":{ + "shape":"Long", + "documentation":"The start time of metrics to retrieve.
", + "box":true + }, + "End":{ + "shape":"Long", + "documentation":"The end time of metrics to retrieve.
", + "box":true + } + }, + "documentation":"Specifies a query to retrieve training metrics from SageMaker.
" + }, + "MetricQueryList":{ + "type":"list", + "member":{"shape":"MetricQuery"}, + "max":100, + "min":1 + }, + "MetricQueryResult":{ + "type":"structure", + "required":[ + "Status", + "XAxisValues", + "MetricValues" + ], + "members":{ + "Status":{ + "shape":"MetricQueryResultStatus", + "documentation":"The status of the metric query.
" + }, + "Message":{ + "shape":"Message", + "documentation":"A message describing the status of the metric query.
" + }, + "XAxisValues":{ + "shape":"XAxisValues", + "documentation":"The values for the x-axis of the metrics.
" + }, + "MetricValues":{ + "shape":"MetricValues", + "documentation":"The metric values retrieved by the query.
" + } + }, + "documentation":"The result of a query to retrieve training metrics from SageMaker.
" + }, + "MetricQueryResultList":{ + "type":"list", + "member":{"shape":"MetricQueryResult"}, + "max":100, + "min":1 + }, + "MetricQueryResultStatus":{ + "type":"string", + "enum":[ + "Complete", + "Truncated", + "InternalError", + "ValidationError" + ] + }, + "MetricStatistic":{ + "type":"string", + "enum":[ + "Min", + "Max", + "Avg", + "Count", + "StdDev", + "Last" + ] + }, + "MetricValues":{ + "type":"list", + "member":{"shape":"Double"} + }, + "Period":{ + "type":"string", + "enum":[ + "OneMinute", + "FiveMinute", + "OneHour", + "IterationNumber" + ] + }, "PutMetricsErrorCode":{ "type":"string", "enum":[ @@ -126,11 +278,27 @@ "max":10, "min":1 }, + "SageMakerResourceArn":{ + "type":"string", + "max":2048, + "pattern":"arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:[a-z\\-].*/.*" + }, "Step":{ "type":"integer", "min":0 }, - "Timestamp":{"type":"timestamp"} + "Timestamp":{"type":"timestamp"}, + "XAxisType":{ + "type":"string", + "enum":[ + "IterationNumber", + "Timestamp" + ] + }, + "XAxisValues":{ + "type":"list", + "member":{"shape":"Long"} + } }, "documentation":"Contains all data plane API operations and data types for Amazon SageMaker Metrics. Use these APIs to put and retrieve (get) features related to your training run.
" } diff --git a/sample/sagemaker/2017-07-24/service-2.json b/sample/sagemaker/2017-07-24/service-2.json index 4e3da8b6..f9d86b0e 100644 --- a/sample/sagemaker/2017-07-24/service-2.json +++ b/sample/sagemaker/2017-07-24/service-2.json @@ -33952,6 +33952,10 @@ "HubAccessConfig":{ "shape":"InferenceHubAccessConfig", "documentation":"Configuration information for hub access.
" + }, + "ManifestS3Uri":{ + "shape":"S3ModelUri", + "documentation":"The Amazon S3 URI of the manifest file. The manifest file is a CSV file that stores the artifact locations.
" } }, "documentation":"Specifies the S3 location of ML model data to deploy.
" diff --git a/src/sagemaker_core/main/code_injection/shape_dag.py b/src/sagemaker_core/main/code_injection/shape_dag.py index 171fa04c..12d6a2d5 100644 --- a/src/sagemaker_core/main/code_injection/shape_dag.py +++ b/src/sagemaker_core/main/code_injection/shape_dag.py @@ -797,6 +797,16 @@ ], "type": "structure", }, + "BatchGetMetricsRequest": { + "members": [{"name": "MetricQueries", "shape": "MetricQueryList", "type": "list"}], + "type": "structure", + }, + "BatchGetMetricsResponse": { + "members": [ + {"name": "MetricQueryResults", "shape": "MetricQueryResultList", "type": "list"} + ], + "type": "structure", + }, "BatchGetRecordError": { "members": [ {"name": "FeatureGroupName", "shape": "ValueAsString", "type": "string"}, @@ -9659,6 +9669,33 @@ "member_type": "structure", "type": "list", }, + "MetricQuery": { + "members": [ + {"name": "MetricName", "shape": "MetricName", "type": "string"}, + {"name": "ResourceArn", "shape": "SageMakerResourceArn", "type": "string"}, + {"name": "MetricStat", "shape": "MetricStatistic", "type": "string"}, + {"name": "Period", "shape": "Period", "type": "string"}, + {"name": "XAxisType", "shape": "XAxisType", "type": "string"}, + {"name": "Start", "shape": "Long", "type": "long"}, + {"name": "End", "shape": "Long", "type": "long"}, + ], + "type": "structure", + }, + "MetricQueryList": {"member_shape": "MetricQuery", "member_type": "structure", "type": "list"}, + "MetricQueryResult": { + "members": [ + {"name": "Status", "shape": "MetricQueryResultStatus", "type": "string"}, + {"name": "Message", "shape": "Message", "type": "string"}, + {"name": "XAxisValues", "shape": "XAxisValues", "type": "list"}, + {"name": "MetricValues", "shape": "MetricValues", "type": "list"}, + ], + "type": "structure", + }, + "MetricQueryResultList": { + "member_shape": "MetricQueryResult", + "member_type": "structure", + "type": "list", + }, "MetricSpecification": { "members": [ {"name": "Predefined", "shape": "PredefinedMetricSpecification", "type": "structure"}, @@ -9666,6 +9703,7 @@ ], "type": "structure", }, + "MetricValues": {"member_shape": "Double", "member_type": "double", "type": "list"}, "MetricsSource": { "members": [ {"name": "ContentType", "shape": "ContentType", "type": "string"}, @@ -12459,6 +12497,7 @@ {"name": "CompressionType", "shape": "ModelCompressionType", "type": "string"}, {"name": "ModelAccessConfig", "shape": "ModelAccessConfig", "type": "structure"}, {"name": "HubAccessConfig", "shape": "InferenceHubAccessConfig", "type": "structure"}, + {"name": "ManifestS3Uri", "shape": "S3ModelUri", "type": "string"}, ], "type": "structure", }, @@ -14796,4 +14835,5 @@ "type": "structure", }, "Workteams": {"member_shape": "Workteam", "member_type": "structure", "type": "list"}, + "XAxisValues": {"member_shape": "Long", "member_type": "long", "type": "list"}, } diff --git a/src/sagemaker_core/main/config_schema.py b/src/sagemaker_core/main/config_schema.py index 88e8e69d..ae410807 100644 --- a/src/sagemaker_core/main/config_schema.py +++ b/src/sagemaker_core/main/config_schema.py @@ -469,6 +469,7 @@ "s3_data_source": { "s3_uri": {"type": "string"}, "s3_data_type": {"type": "string"}, + "manifest_s3_uri": {"type": "string"}, } } }, diff --git a/src/sagemaker_core/main/shapes.py b/src/sagemaker_core/main/shapes.py index 2c7d11eb..7c8a5ed1 100644 --- a/src/sagemaker_core/main/shapes.py +++ b/src/sagemaker_core/main/shapes.py @@ -362,6 +362,50 @@ class ResourceNotFound(Base): message: Optional[str] = Unassigned() +class MetricQuery(Base): + """ + MetricQuery + Specifies a query to retrieve training metrics from SageMaker. + + Attributes + ---------------------- + metric_name: The name of the metric to retrieve. + resource_arn: The ARN of the SageMaker resource to retrieve metrics for. + metric_stat: The metrics stat type of metrics to retrieve. + period: The time period of metrics to retrieve. + x_axis_type: The x-axis type of metrics to retrieve. + start: The start time of metrics to retrieve. + end: The end time of metrics to retrieve. + """ + + metric_name: str + resource_arn: str + metric_stat: str + period: str + x_axis_type: str + start: Optional[int] = Unassigned() + end: Optional[int] = Unassigned() + + +class MetricQueryResult(Base): + """ + MetricQueryResult + The result of a query to retrieve training metrics from SageMaker. + + Attributes + ---------------------- + status: The status of the metric query. + message: A message describing the status of the metric query. + x_axis_values: The values for the x-axis of the metrics. + metric_values: The metric values retrieved by the query. + """ + + status: str + x_axis_values: List[int] + metric_values: List[float] + message: Optional[str] = Unassigned() + + class BatchPutMetricsError(Base): """ BatchPutMetricsError @@ -491,6 +535,7 @@ class S3ModelDataSource(Base): compression_type: Specifies how the ML model data is prepared. If you choose Gzip and choose S3Object as the value of S3DataType, S3Uri identifies an object that is a gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the object during model deployment. If you choose None and chooose S3Object as the value of S3DataType, S3Uri identifies an object that represents an uncompressed ML model to deploy. If you choose None and choose S3Prefix as the value of S3DataType, S3Uri identifies a key name prefix, under which all objects represents the uncompressed ML model to deploy. If you choose None, then SageMaker will follow rules below when creating model data files under /opt/ml/model directory for use by your inference code: If you choose S3Object as the value of S3DataType, then SageMaker will split the key of the S3 object referenced by S3Uri by slash (/), and use the last part as the filename of the file holding the content of the S3 object. If you choose S3Prefix as the value of S3DataType, then for each S3 object under the key name pefix referenced by S3Uri, SageMaker will trim its key by the prefix, and use the remainder as the path (relative to /opt/ml/model) of the file holding the content of the S3 object. SageMaker will split the remainder by slash (/), using intermediate parts as directory names and the last part as filename of the file holding the content of the S3 object. Do not use any of the following as file names or directory names: An empty or blank string A string which contains null bytes A string longer than 255 bytes A single dot (.) A double dot (..) Ambiguous file names will result in model deployment failure. For example, if your uncompressed ML model consists of two S3 objects s3://mybucket/model/weights and s3://mybucket/model/weights/part1 and you specify s3://mybucket/model/ as the value of S3Uri and S3Prefix as the value of S3DataType, then it will result in name clash between /opt/ml/model/weights (a regular file) and /opt/ml/model/weights/ (a directory). Do not organize the model artifacts in S3 console using folders. When you create a folder in S3 console, S3 creates a 0-byte object with a key set to the folder name you provide. They key of the 0-byte object ends with a slash (/) which violates SageMaker restrictions on model artifact file names, leading to model deployment failure. model_access_config: Specifies the access configuration file for the ML model. You can explicitly accept the model end-user license agreement (EULA) within the ModelAccessConfig. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model. hub_access_config: Configuration information for hub access. + manifest_s3_uri: The Amazon S3 URI of the manifest file. The manifest file is a CSV file that stores the artifact locations. """ s3_uri: str @@ -498,6 +543,7 @@ class S3ModelDataSource(Base): compression_type: str model_access_config: Optional[ModelAccessConfig] = Unassigned() hub_access_config: Optional[InferenceHubAccessConfig] = Unassigned() + manifest_s3_uri: Optional[str] = Unassigned() class ModelDataSource(Base): diff --git a/src/sagemaker_core/tools/api_coverage.json b/src/sagemaker_core/tools/api_coverage.json index 206aaefe..b1924b4a 100644 --- a/src/sagemaker_core/tools/api_coverage.json +++ b/src/sagemaker_core/tools/api_coverage.json @@ -1 +1 @@ -{"SupportedAPIs": 338, "UnsupportedAPIs": 5} \ No newline at end of file +{"SupportedAPIs": 338, "UnsupportedAPIs": 6} \ No newline at end of file