Deploying models to container services
Previously, we saw how to fetch a model artifact in S3 and how to extract the actual model from it. Knowing this, it's pretty easy to deploy it on a container service, such as Amazon ECS, Amazon EKS, or Amazon Fargate.
Maybe it's company policy to deploy everything in containers, maybe you just like them, or maybe both! Whatever the reason is, you can definitely do it. There's nothing specific to SageMaker here, and the AWS documentation for these services will tell you everything you need to know.
A sample high-level process could look like this:
- Train a model on SageMaker.
- When training is complete, grab the artifact and extract the model.
- Push the model to a Git repository.
- Write a task definition (for ECS and Fargate) or a pod definition (for EKS). It could use one of the built-in containers or your own. Then, it could run a model server or your own code to clone the model from your Git repository...