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
asked 2 years ago223 views
1 Answer
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
EXPERT
Alex_T
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions