Search code examples
amazon-web-servicesamazon-sagemakeramazon-ecramazon-sagemaker-studio

Error when using createmodel function for Sagemaker


Recently encountered this weird error with a custom image that I build. There is no issue for training and processing job. Just on when I wanted to createmodel.

ClientError: An error occurred (ValidationException) when calling the CreateModel operation: Unsupported manifest media type application/vnd.oci.image.manifest.v1+json for image {image link}. Ensure that valid manifest media type is used for specified image.

Hope that somebody can provide some insight to this problem.


Solution

  • SageMaker's CreateModel operation predominantly supports Docker V2 manifest media type, specifically “application/vnd.docker.distribution.manifest.v2+json”. Although ECR does support other manifest types, such as the Open Container Initiative (OCI) Specifications (v1.0 and up), SageMaker currently does not for the CreateModel operation.

    While ECR does support a wide range of manifest formats, including the OCI, it maintains the integrity of the original image format to cater to the varied needs of different AWS services and general container workloads. Automatically translating between formats might lead to compatibility issues or unintended behaviors in some contexts. SageMaker's specific requirements stem from its internal architecture and integration points, which currently lean towards Docker V2 manifest format for the CreateModel operation.

    Next Steps:

    To address the error you've faced, I recommend specifying the --format option to docker when building your image, as described in this. This ensures the image is in a format that SageMaker's CreateModel operation supports.

    podman --format docker build.