model_packages
Creates, updates, deletes or gets a model_package
resource or lists model_packages
in a region
Overview
Name | model_packages |
Type | Resource |
Description | Resource Type definition for AWS::SageMaker::ModelPackage |
Id | aws.sagemaker.model_packages |
Fields
Name | Datatype | Description |
---|---|---|
tags | array | An array of key-value pairs to apply to this resource. |
additional_inference_specifications | array | An array of additional Inference Specification objects. |
certify_for_marketplace | boolean | Whether to certify the model package for listing on AWS Marketplace. |
client_token | string | A unique token that guarantees that the call to this API is idempotent. |
customer_metadata_properties | object | The metadata properties associated with the model package versions. |
domain | string | The machine learning domain of the model package you specified. |
drift_check_baselines | object | Represents the drift check baselines that can be used when the model monitor is set using the model package. |
inference_specification | object | Details about inference jobs that can be run with models based on this model package. |
metadata_properties | object | Metadata properties of the tracking entity, trial, or trial component. |
model_approval_status | string | The approval status of the model package. |
model_metrics | object | A structure that contains model metrics reports. |
model_package_description | string | The description of the model package. |
model_package_group_name | string | The name of the model package group. |
model_package_name | string | The name or arn of the model package. |
sample_payload_url | string | The Amazon Simple Storage Service (Amazon S3) path where the sample payload are stored pointing to single gzip compressed tar archive. |
skip_model_validation | string | Indicates if you want to skip model validation. |
source_algorithm_specification | object | Details about the algorithm that was used to create the model package. |
task | string | The machine learning task your model package accomplishes. |
validation_specification | object | Specifies configurations for one or more transform jobs that Amazon SageMaker runs to test the model package. |
model_package_arn | string | The Amazon Resource Name (ARN) of the model package group. |
approval_description | string | A description provided for the model approval. |
creation_time | string | The time at which the model package was created. |
last_modified_time | string | The time at which the model package was last modified. |
model_package_status | string | The current status of the model package. |
model_package_version | integer | The version of the model package. |
additional_inference_specifications_to_add | array | An array of additional Inference Specification objects. |
model_package_status_details | object | Details about the current status of the model package. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all model_packages
in a region.
SELECT
region,
tags,
additional_inference_specifications,
certify_for_marketplace,
client_token,
customer_metadata_properties,
domain,
drift_check_baselines,
inference_specification,
metadata_properties,
model_approval_status,
model_metrics,
model_package_description,
model_package_group_name,
model_package_name,
sample_payload_url,
skip_model_validation,
source_algorithm_specification,
task,
validation_specification,
model_package_arn,
approval_description,
creation_time,
last_modified_time,
model_package_status,
model_package_version,
additional_inference_specifications_to_add,
model_package_status_details
FROM aws.sagemaker.model_packages
WHERE region = 'us-east-1';
Gets all properties from an individual model_package
.
SELECT
region,
tags,
additional_inference_specifications,
certify_for_marketplace,
client_token,
customer_metadata_properties,
domain,
drift_check_baselines,
inference_specification,
metadata_properties,
model_approval_status,
model_metrics,
model_package_description,
model_package_group_name,
model_package_name,
sample_payload_url,
skip_model_validation,
source_algorithm_specification,
task,
validation_specification,
model_package_arn,
approval_description,
creation_time,
last_modified_time,
model_package_status,
model_package_version,
additional_inference_specifications_to_add,
model_package_status_details
FROM aws.sagemaker.model_packages
WHERE region = 'us-east-1' AND data__Identifier = '<ModelPackageArn>';
INSERT
example
Use the following StackQL query and manifest file to create a new model_package
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.sagemaker.model_packages (
Tags,
AdditionalInferenceSpecifications,
CertifyForMarketplace,
ClientToken,
CustomerMetadataProperties,
Domain,
DriftCheckBaselines,
InferenceSpecification,
MetadataProperties,
ModelApprovalStatus,
ModelMetrics,
ModelPackageDescription,
ModelPackageGroupName,
ModelPackageName,
SamplePayloadUrl,
SkipModelValidation,
SourceAlgorithmSpecification,
Task,
ValidationSpecification,
ApprovalDescription,
LastModifiedTime,
ModelPackageVersion,
AdditionalInferenceSpecificationsToAdd,
ModelPackageStatusDetails,
region
)
SELECT
'{{ Tags }}',
'{{ AdditionalInferenceSpecifications }}',
'{{ CertifyForMarketplace }}',
'{{ ClientToken }}',
'{{ CustomerMetadataProperties }}',
'{{ Domain }}',
'{{ DriftCheckBaselines }}',
'{{ InferenceSpecification }}',
'{{ MetadataProperties }}',
'{{ ModelApprovalStatus }}',
'{{ ModelMetrics }}',
'{{ ModelPackageDescription }}',
'{{ ModelPackageGroupName }}',
'{{ ModelPackageName }}',
'{{ SamplePayloadUrl }}',
'{{ SkipModelValidation }}',
'{{ SourceAlgorithmSpecification }}',
'{{ Task }}',
'{{ ValidationSpecification }}',
'{{ ApprovalDescription }}',
'{{ LastModifiedTime }}',
'{{ ModelPackageVersion }}',
'{{ AdditionalInferenceSpecificationsToAdd }}',
'{{ ModelPackageStatusDetails }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.sagemaker.model_packages (
Tags,
AdditionalInferenceSpecifications,
CertifyForMarketplace,
ClientToken,
CustomerMetadataProperties,
Domain,
DriftCheckBaselines,
InferenceSpecification,
MetadataProperties,
ModelApprovalStatus,
ModelMetrics,
ModelPackageDescription,
ModelPackageGroupName,
ModelPackageName,
SamplePayloadUrl,
SkipModelValidation,
SourceAlgorithmSpecification,
Task,
ValidationSpecification,
ApprovalDescription,
LastModifiedTime,
ModelPackageVersion,
AdditionalInferenceSpecificationsToAdd,
ModelPackageStatusDetails,
region
)
SELECT
'{{ Tags }}',
'{{ AdditionalInferenceSpecifications }}',
'{{ CertifyForMarketplace }}',
'{{ ClientToken }}',
'{{ CustomerMetadataProperties }}',
'{{ Domain }}',
'{{ DriftCheckBaselines }}',
'{{ InferenceSpecification }}',
'{{ MetadataProperties }}',
'{{ ModelApprovalStatus }}',
'{{ ModelMetrics }}',
'{{ ModelPackageDescription }}',
'{{ ModelPackageGroupName }}',
'{{ ModelPackageName }}',
'{{ SamplePayloadUrl }}',
'{{ SkipModelValidation }}',
'{{ SourceAlgorithmSpecification }}',
'{{ Task }}',
'{{ ValidationSpecification }}',
'{{ ApprovalDescription }}',
'{{ LastModifiedTime }}',
'{{ ModelPackageVersion }}',
'{{ AdditionalInferenceSpecificationsToAdd }}',
'{{ ModelPackageStatusDetails }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: model_package
props:
- name: Tags
value:
- Value: '{{ Value }}'
Key: '{{ Key }}'
- name: AdditionalInferenceSpecifications
value:
- Containers:
- ContainerHostname: '{{ ContainerHostname }}'
Environment: {}
ModelInput:
DataInputConfig: '{{ DataInputConfig }}'
Image: '{{ Image }}'
ImageDigest: '{{ ImageDigest }}'
ModelDataUrl: '{{ ModelDataUrl }}'
Framework: '{{ Framework }}'
FrameworkVersion: '{{ FrameworkVersion }}'
NearestModelName: '{{ NearestModelName }}'
Description: '{{ Description }}'
Name: '{{ Name }}'
SupportedContentTypes:
- '{{ SupportedContentTypes[0] }}'
SupportedRealtimeInferenceInstanceTypes:
- '{{ SupportedRealtimeInferenceInstanceTypes[0] }}'
SupportedResponseMIMETypes:
- '{{ SupportedResponseMIMETypes[0] }}'
SupportedTransformInstanceTypes:
- '{{ SupportedTransformInstanceTypes[0] }}'
- name: CertifyForMarketplace
value: '{{ CertifyForMarketplace }}'
- name: ClientToken
value: '{{ ClientToken }}'
- name: CustomerMetadataProperties
value: {}
- name: Domain
value: '{{ Domain }}'
- name: DriftCheckBaselines
value:
Bias:
PostTrainingConstraints:
ContentDigest: '{{ ContentDigest }}'
ContentType: '{{ ContentType }}'
S3Uri: '{{ S3Uri }}'
PreTrainingConstraints: null
ConfigFile:
ContentDigest: '{{ ContentDigest }}'
ContentType: '{{ ContentType }}'
S3Uri: '{{ S3Uri }}'
Explainability:
Constraints: null
ConfigFile: null
ModelDataQuality:
Constraints: null
Statistics: null
ModelQuality:
Constraints: null
Statistics: null
- name: InferenceSpecification
value:
Containers:
- null
SupportedContentTypes:
- null
SupportedRealtimeInferenceInstanceTypes:
- null
SupportedResponseMIMETypes:
- null
SupportedTransformInstanceTypes:
- null
- name: MetadataProperties
value:
CommitId: '{{ CommitId }}'
GeneratedBy: '{{ GeneratedBy }}'
ProjectId: '{{ ProjectId }}'
Repository: '{{ Repository }}'
- name: ModelApprovalStatus
value: '{{ ModelApprovalStatus }}'
- name: ModelMetrics
value:
Bias:
Report: null
PreTrainingReport: null
PostTrainingReport: null
Explainability:
Report: null
ModelDataQuality:
Constraints: null
Statistics: null
ModelQuality:
Constraints: null
Statistics: null
- name: ModelPackageDescription
value: '{{ ModelPackageDescription }}'
- name: ModelPackageGroupName
value: '{{ ModelPackageGroupName }}'
- name: ModelPackageName
value: '{{ ModelPackageName }}'
- name: SamplePayloadUrl
value: '{{ SamplePayloadUrl }}'
- name: SkipModelValidation
value: '{{ SkipModelValidation }}'
- name: SourceAlgorithmSpecification
value:
SourceAlgorithms:
- AlgorithmName: '{{ AlgorithmName }}'
ModelDataUrl: '{{ ModelDataUrl }}'
- name: Task
value: '{{ Task }}'
- name: ValidationSpecification
value:
ValidationProfiles:
- TransformJobDefinition:
Environment: null
BatchStrategy: '{{ BatchStrategy }}'
MaxConcurrentTransforms: '{{ MaxConcurrentTransforms }}'
MaxPayloadInMB: '{{ MaxPayloadInMB }}'
TransformInput:
CompressionType: '{{ CompressionType }}'
ContentType: '{{ ContentType }}'
DataSource:
S3DataSource:
S3DataType: '{{ S3DataType }}'
S3Uri: '{{ S3Uri }}'
SplitType: '{{ SplitType }}'
TransformOutput:
Accept: '{{ Accept }}'
KmsKeyId: '{{ KmsKeyId }}'
S3OutputPath: '{{ S3OutputPath }}'
AssembleWith: '{{ AssembleWith }}'
TransformResources:
InstanceCount: '{{ InstanceCount }}'
InstanceType: '{{ InstanceType }}'
VolumeKmsKeyId: '{{ VolumeKmsKeyId }}'
ProfileName: '{{ ProfileName }}'
ValidationRole: '{{ ValidationRole }}'
- name: ApprovalDescription
value: '{{ ApprovalDescription }}'
- name: LastModifiedTime
value: '{{ LastModifiedTime }}'
- name: ModelPackageVersion
value: '{{ ModelPackageVersion }}'
- name: AdditionalInferenceSpecificationsToAdd
value: null
- name: ModelPackageStatusDetails
value:
ValidationStatuses:
- FailureReason: '{{ FailureReason }}'
Name: '{{ Name }}'
Status: '{{ Status }}'
DELETE
example
/*+ delete */
DELETE FROM aws.sagemaker.model_packages
WHERE data__Identifier = '<ModelPackageArn>'
AND region = 'us-east-1';
Permissions
To operate on the model_packages
resource, the following permissions are required:
Create
ecr:BatchGetImage,
ecr:DescribeImages,
ecr:StartImageScan,
ecr:DescribeImageScanFindings,
sagemaker:AddTags,
sagemaker:CreateModel,
sagemaker:CreateModelPackage,
sagemaker:CreateTrainingJob,
sagemaker:CreateTransformJob,
sagemaker:DescribeTransformJob,
sagemaker:DescribeModelPackage,
sagemaker:ListTags,
iam:PassRole,
s3:GetObject
Read
sagemaker:DescribeModelPackage,
sagemaker:ListTags
Update
sagemaker:UpdateModelPackage,
sagemaker:DescribeModelPackage,
sagemaker:ListTags,
sagemaker:AddTags,
sagemaker:DeleteTags
Delete
sagemaker:DeleteModelPackage,
sagemaker:DescribeModelPackage
List
sagemaker:ListModelPackages