Skip to content

Commit f70655a

Browse files
authored
Support APIs from sagemaker-featurestore-runtime and sagemaker-metrics (#181)
* Support APIs from sagemaker-metrics and sagemaker-featurestore-runtime * Move invoke methods to addtional_methods.json * Update client * Update example notebook
1 parent 168af19 commit f70655a

15 files changed

+1255
-710
lines changed

example_notebooks/track_local_pytorch_experiment.ipynb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,7 @@
415415
" record_performance(model, train_loader, device, epoch, metrics, \"Train\")\n",
416416
" record_performance(model, test_loader, device, epoch, metrics, \"Test\")\n",
417417
" \n",
418-
" # upload metrics\n",
419-
" metrics_client = session.sagemaker_metrics_client\n",
420-
" metrics_client.batch_put_metrics(\n",
421-
" TrialComponentName=trial_component.trial_component_name,\n",
422-
" MetricData=metrics,\n",
423-
" )"
418+
" trial_component.batch_put_metrics(MetricData=metrics)"
424419
]
425420
},
426421
{

resource_plan.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DeviceFleet,resource,"['create', 'get', 'get_all']","['delete', 'refresh', 'upda
1717
Domain,resource,"['create', 'get', 'get_all']","['delete', 'refresh', 'update', 'wait_for_delete', 'wait_for_status']",[],[],"['CreateDomain', 'DeleteDomain', 'DescribeDomain', 'ListDomains', 'UpdateDomain']","[{'name': 'Status', 'shape_name': 'DomainStatus'}]","['Deleting', 'Failed', 'InService', 'Pending', 'Updating', 'Update_Failed', 'Delete_Failed']"
1818
EdgeDeploymentPlan,resource,"['create', 'get', 'get_all']","['delete', 'refresh']",['DeviceFleet'],[],"['CreateEdgeDeploymentPlan', 'DeleteEdgeDeploymentPlan', 'DescribeEdgeDeploymentPlan', 'ListEdgeDeploymentPlans']",[],[]
1919
EdgePackagingJob,resource,"['create', 'get', 'get_all']","['refresh', 'stop', 'wait']","['CompilationJob', 'Model']",[],"['CreateEdgePackagingJob', 'DescribeEdgePackagingJob', 'ListEdgePackagingJobs', 'StopEdgePackagingJob']","[{'name': 'EdgePackagingJobStatus', 'shape_name': 'EdgePackagingJobStatus'}]","['STARTING', 'INPROGRESS', 'COMPLETED', 'FAILED', 'STOPPING', 'STOPPED']"
20-
Endpoint,resource,"['create', 'get', 'get_all']","['delete', 'invoke', 'invoke_async', 'invoke_with_response_stream', 'refresh', 'update', 'wait_for_delete', 'wait_for_status']",['EndpointConfig'],[],"['CreateEndpoint', 'DeleteEndpoint', 'DescribeEndpoint', 'InvokeEndpoint', 'InvokeEndpointAsync', 'InvokeEndpointWithResponseStream', 'ListEndpoints', 'UpdateEndpoint']","[{'name': 'EndpointStatus', 'shape_name': 'EndpointStatus'}]","['OutOfService', 'Creating', 'Updating', 'SystemUpdating', 'RollingBack', 'InService', 'Deleting', 'Failed', 'UpdateRollbackFailed']"
20+
Endpoint,resource,"['create', 'get', 'get_all']","['delete', 'refresh', 'update', 'wait_for_delete', 'wait_for_status']",['EndpointConfig'],[],"['CreateEndpoint', 'DeleteEndpoint', 'DescribeEndpoint', 'ListEndpoints', 'UpdateEndpoint']","[{'name': 'EndpointStatus', 'shape_name': 'EndpointStatus'}]","['OutOfService', 'Creating', 'Updating', 'SystemUpdating', 'RollingBack', 'InService', 'Deleting', 'Failed', 'UpdateRollbackFailed']"
2121
EndpointConfig,resource,"['create', 'get', 'get_all']","['delete', 'refresh']",[],[],"['CreateEndpointConfig', 'DeleteEndpointConfig', 'DescribeEndpointConfig', 'ListEndpointConfigs']",[],[]
2222
Experiment,resource,"['create', 'get', 'get_all']","['delete', 'refresh', 'update']",[],[],"['CreateExperiment', 'DeleteExperiment', 'DescribeExperiment', 'ListExperiments', 'UpdateExperiment']",[],[]
2323
FeatureGroup,resource,"['create', 'get', 'get_all']","['delete', 'refresh', 'update', 'wait_for_delete', 'wait_for_status']",[],[],"['CreateFeatureGroup', 'DeleteFeatureGroup', 'DescribeFeatureGroup', 'ListFeatureGroups', 'UpdateFeatureGroup']","[{'name': 'FeatureGroupStatus', 'shape_name': 'FeatureGroupStatus'}]","['Creating', 'Created', 'CreateFailed', 'Deleting', 'DeleteFailed']"

src/sagemaker_core/main/code_injection/shape_dag.py

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
SHAPE_DAG = {
2+
"AccessForbidden": {
3+
"members": [{"name": "Message", "shape": "Message", "type": "string"}],
4+
"type": "structure",
5+
},
26
"ActionSource": {
37
"members": [
48
{"name": "SourceUri", "shape": "SourceUri", "type": "string"},
@@ -793,6 +797,89 @@
793797
],
794798
"type": "structure",
795799
},
800+
"BatchGetRecordError": {
801+
"members": [
802+
{"name": "FeatureGroupName", "shape": "ValueAsString", "type": "string"},
803+
{"name": "RecordIdentifierValueAsString", "shape": "ValueAsString", "type": "string"},
804+
{"name": "ErrorCode", "shape": "ValueAsString", "type": "string"},
805+
{"name": "ErrorMessage", "shape": "Message", "type": "string"},
806+
],
807+
"type": "structure",
808+
},
809+
"BatchGetRecordErrors": {
810+
"member_shape": "BatchGetRecordError",
811+
"member_type": "structure",
812+
"type": "list",
813+
},
814+
"BatchGetRecordIdentifier": {
815+
"members": [
816+
{"name": "FeatureGroupName", "shape": "FeatureGroupNameOrArn", "type": "string"},
817+
{
818+
"name": "RecordIdentifiersValueAsString",
819+
"shape": "RecordIdentifiers",
820+
"type": "list",
821+
},
822+
{"name": "FeatureNames", "shape": "FeatureNames", "type": "list"},
823+
],
824+
"type": "structure",
825+
},
826+
"BatchGetRecordIdentifiers": {
827+
"member_shape": "BatchGetRecordIdentifier",
828+
"member_type": "structure",
829+
"type": "list",
830+
},
831+
"BatchGetRecordRequest": {
832+
"members": [
833+
{"name": "Identifiers", "shape": "BatchGetRecordIdentifiers", "type": "list"},
834+
{"name": "ExpirationTimeResponse", "shape": "ExpirationTimeResponse", "type": "string"},
835+
],
836+
"type": "structure",
837+
},
838+
"BatchGetRecordResponse": {
839+
"members": [
840+
{"name": "Records", "shape": "BatchGetRecordResultDetails", "type": "list"},
841+
{"name": "Errors", "shape": "BatchGetRecordErrors", "type": "list"},
842+
{"name": "UnprocessedIdentifiers", "shape": "UnprocessedIdentifiers", "type": "list"},
843+
],
844+
"type": "structure",
845+
},
846+
"BatchGetRecordResultDetail": {
847+
"members": [
848+
{"name": "FeatureGroupName", "shape": "ValueAsString", "type": "string"},
849+
{"name": "RecordIdentifierValueAsString", "shape": "ValueAsString", "type": "string"},
850+
{"name": "Record", "shape": "Record", "type": "list"},
851+
{"name": "ExpiresAt", "shape": "ExpiresAt", "type": "string"},
852+
],
853+
"type": "structure",
854+
},
855+
"BatchGetRecordResultDetails": {
856+
"member_shape": "BatchGetRecordResultDetail",
857+
"member_type": "structure",
858+
"type": "list",
859+
},
860+
"BatchPutMetricsError": {
861+
"members": [
862+
{"name": "Code", "shape": "PutMetricsErrorCode", "type": "string"},
863+
{"name": "MetricIndex", "shape": "Integer", "type": "integer"},
864+
],
865+
"type": "structure",
866+
},
867+
"BatchPutMetricsErrorList": {
868+
"member_shape": "BatchPutMetricsError",
869+
"member_type": "structure",
870+
"type": "list",
871+
},
872+
"BatchPutMetricsRequest": {
873+
"members": [
874+
{"name": "TrialComponentName", "shape": "ExperimentEntityName", "type": "string"},
875+
{"name": "MetricData", "shape": "RawMetricDataList", "type": "list"},
876+
],
877+
"type": "structure",
878+
},
879+
"BatchPutMetricsResponse": {
880+
"members": [{"name": "Errors", "shape": "BatchPutMetricsErrorList", "type": "list"}],
881+
"type": "structure",
882+
},
796883
"BatchTransformInput": {
797884
"members": [
798885
{"name": "DataCapturedDestinationS3Uri", "shape": "DestinationS3Uri", "type": "string"},
@@ -3426,6 +3513,16 @@
34263513
"members": [{"name": "ProjectName", "shape": "ProjectEntityName", "type": "string"}],
34273514
"type": "structure",
34283515
},
3516+
"DeleteRecordRequest": {
3517+
"members": [
3518+
{"name": "FeatureGroupName", "shape": "FeatureGroupNameOrArn", "type": "string"},
3519+
{"name": "RecordIdentifierValueAsString", "shape": "ValueAsString", "type": "string"},
3520+
{"name": "EventTime", "shape": "ValueAsString", "type": "string"},
3521+
{"name": "TargetStores", "shape": "TargetStores", "type": "list"},
3522+
{"name": "DeletionMode", "shape": "DeletionMode", "type": "string"},
3523+
],
3524+
"type": "structure",
3525+
},
34293526
"DeleteSpaceRequest": {
34303527
"members": [
34313528
{"name": "DomainId", "shape": "DomainId", "type": "string"},
@@ -6184,6 +6281,7 @@
61846281
],
61856282
"type": "structure",
61866283
},
6284+
"FeatureNames": {"member_shape": "FeatureName", "member_type": "string", "type": "list"},
61876285
"FeatureParameter": {
61886286
"members": [
61896287
{"name": "Key", "shape": "FeatureParameterKey", "type": "string"},
@@ -6206,6 +6304,14 @@
62066304
"member_type": "structure",
62076305
"type": "list",
62086306
},
6307+
"FeatureValue": {
6308+
"members": [
6309+
{"name": "FeatureName", "shape": "FeatureName", "type": "string"},
6310+
{"name": "ValueAsString", "shape": "ValueAsString", "type": "string"},
6311+
{"name": "ValueAsStringList", "shape": "ValueAsStringList", "type": "list"},
6312+
],
6313+
"type": "structure",
6314+
},
62096315
"FileSource": {
62106316
"members": [
62116317
{"name": "ContentType", "shape": "ContentType", "type": "string"},
@@ -6350,6 +6456,22 @@
63506456
"members": [{"name": "ResourcePolicy", "shape": "PolicyString", "type": "string"}],
63516457
"type": "structure",
63526458
},
6459+
"GetRecordRequest": {
6460+
"members": [
6461+
{"name": "FeatureGroupName", "shape": "FeatureGroupNameOrArn", "type": "string"},
6462+
{"name": "RecordIdentifierValueAsString", "shape": "ValueAsString", "type": "string"},
6463+
{"name": "FeatureNames", "shape": "FeatureNames", "type": "list"},
6464+
{"name": "ExpirationTimeResponse", "shape": "ExpirationTimeResponse", "type": "string"},
6465+
],
6466+
"type": "structure",
6467+
},
6468+
"GetRecordResponse": {
6469+
"members": [
6470+
{"name": "Record", "shape": "Record", "type": "list"},
6471+
{"name": "ExpiresAt", "shape": "ExpiresAt", "type": "string"},
6472+
],
6473+
"type": "structure",
6474+
},
63536475
"GetSagemakerServicecatalogPortfolioStatusInput": {"members": [], "type": "structure"},
63546476
"GetSagemakerServicecatalogPortfolioStatusOutput": {
63556477
"members": [{"name": "Status", "shape": "SagemakerServicecatalogStatus", "type": "string"}],
@@ -11756,6 +11878,15 @@
1175611878
],
1175711879
"type": "structure",
1175811880
},
11881+
"PutRecordRequest": {
11882+
"members": [
11883+
{"name": "FeatureGroupName", "shape": "FeatureGroupNameOrArn", "type": "string"},
11884+
{"name": "Record", "shape": "Record", "type": "list"},
11885+
{"name": "TargetStores", "shape": "TargetStores", "type": "list"},
11886+
{"name": "TtlDuration", "shape": "TtlDuration", "type": "structure"},
11887+
],
11888+
"type": "structure",
11889+
},
1175911890
"QualityCheckStepMetadata": {
1176011891
"members": [
1176111892
{"name": "CheckType", "shape": "String256", "type": "string"},
@@ -11857,6 +11988,20 @@
1185711988
],
1185811989
"type": "structure",
1185911990
},
11991+
"RawMetricData": {
11992+
"members": [
11993+
{"name": "MetricName", "shape": "MetricName", "type": "string"},
11994+
{"name": "Timestamp", "shape": "Timestamp", "type": "timestamp"},
11995+
{"name": "Step", "shape": "Step", "type": "integer"},
11996+
{"name": "Value", "shape": "Double", "type": "double"},
11997+
],
11998+
"type": "structure",
11999+
},
12000+
"RawMetricDataList": {
12001+
"member_shape": "RawMetricData",
12002+
"member_type": "structure",
12003+
"type": "list",
12004+
},
1186012005
"RealTimeInferenceConfig": {
1186112006
"members": [
1186212007
{"name": "InstanceType", "shape": "InstanceType", "type": "string"},
@@ -12053,6 +12198,8 @@
1205312198
],
1205412199
"type": "structure",
1205512200
},
12201+
"Record": {"member_shape": "FeatureValue", "member_type": "structure", "type": "list"},
12202+
"RecordIdentifiers": {"member_shape": "ValueAsString", "member_type": "string", "type": "list"},
1205612203
"RedshiftDatasetDefinition": {
1205712204
"members": [
1205812205
{"name": "ClusterId", "shape": "RedshiftClusterId", "type": "string"},
@@ -13020,6 +13167,7 @@
1302013167
],
1302113168
"type": "structure",
1302213169
},
13170+
"TargetStores": {"member_shape": "TargetStore", "member_type": "string", "type": "list"},
1302313171
"TargetTrackingScalingPolicyConfiguration": {
1302413172
"members": [
1302513173
{"name": "MetricSpecification", "shape": "MetricSpecification", "type": "structure"},
@@ -13717,6 +13865,11 @@
1371713865
],
1371813866
"type": "structure",
1371913867
},
13868+
"UnprocessedIdentifiers": {
13869+
"member_shape": "BatchGetRecordIdentifier",
13870+
"member_type": "structure",
13871+
"type": "list",
13872+
},
1372013873
"UpdateActionRequest": {
1372113874
"members": [
1372213875
{"name": "ActionName", "shape": "ExperimentEntityName", "type": "string"},
@@ -14489,6 +14642,7 @@
1448914642
"members": [{"name": "Message", "shape": "Message", "type": "string"}],
1449014643
"type": "structure",
1449114644
},
14645+
"ValueAsStringList": {"member_shape": "ValueAsString", "member_type": "string", "type": "list"},
1449214646
"VariantProperty": {
1449314647
"members": [
1449414648
{"name": "VariantPropertyType", "shape": "VariantPropertyType", "type": "string"}

0 commit comments

Comments
 (0)