Does SageMaker's CreateModel API support model data from versioned S3 objects?

0

In the following AWS CLI invocation, I'm attempting to specify a ModelDataUrl which contains an embedded versionId to reference an object whose bucket has versioning enabled. Does SageMaker's CreateModel API support model data originating from a specific object version? If so, how does one specify the object version?

AWS CLI Invocation:

aws sagemaker create-model --model-name VersionedArtifacts \
  --execution-role-arn arn:aws:iam::<account-id>:role/service-role/<role-name> \
  --primary-container "Image=<account-id>.dkr.ecr.us-east-1.amazonaws.com/<repository>:<tag>,ModelDataUrl=https://s3.us-east-1.amazonaws.com/<versioned-bucket>/versioned-artifacts.tar.gz?versionId=<version-id>

Resulting AWS CLI Error:

An error occurred (ValidationException) when calling the CreateModel operation: Could not find model data at https://s3.us-east-1.amazonaws.com/<versioned-bucket>/versioned-artifacts.tar.gz?versionId=<version-id>.
profile picture
已提问 2 年前227 查看次数
1 回答
0

I can't rule it out completely as haven't been able to find a source in the docs, but am ~90% sure S3 object versioning is not supported here: Your code makes sense as the only way to try and send through the version parameter, and the missing model data error would make sense if the service is simply trying to read ?versionId=... as part of the key.

I requested further clarification on the ContainerDefinition doc page, but believe you'll need to architect for separate object keys rather than object versions. You'll see that by default the training job API already adds a job-name-specific suffix to your provided output data location, so usually this is only a challenge if you're planning to set up a centralised repository of model.tar.gz in S3 and explicitly copy models into it.

AWS
专家
Alex_T
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则