How to effectively deploy a model with AWS. Deploying a model with AWS SageMaker is a great way to allow users or customers to interact with it. While you can use the many algorithms and models that come with SageMaker’s Python SDK, there are also many cases where you might want to create your own algorithm. This requires the use of Docker.
The easiest way to let people interact with your model is by employing AWS Lambda and API Gateway to setup an API POST request to the model.
Finally, having an API for sending requests and receiving inference responses from the model is great, but a simple and nice looking web app for users to interact with the data is even better. This is where hosting a static website with S3 and accessing the endpoint with AJAX comes into play.
All of these components of AWS working in unison allows for a sleek development and inference serving framework. This tutorial also covers using AWS CloudWatch to understand ambiguous errors such as 500 Internal Server Errors from the custom model.
Check out the repo for the some of the code mentioned below, here.
To deploy a custom model with SageMaker it must be wrapped by SageMaker’s Estimator class. This can be done by creating a Docker image that interfaces with this class.
Also, check out this post, if you don’t know what Docker is and why it's so important nowadays.
Install Docker for your respective OS with these links: Mac, Ubuntu and Windows. Windows Home edition is a bit more difficult so I will cover some of the steps here, since Windows is the OS I use. Follow these steps first and see how far you get. Refer to the steps below if you get stuck.
WSL 2 is required in Windows Home edition to run Docker Desktop.
Following the second video about Docker basics, in this video, I explain Docker architecture and explain the different building blocks of the docker engine; docker client, API, Docker Daemon. I also explain what a docker registry is and I finish the video with a demo explaining and illustrating how to use Docker hub.
In AWS there are a few services which seem similar or related when it comes to containerisation. They do have their nuances so let’s begin with an introduction of what these are and their similarities and differences (according to the AWS documentation)
A quick & simple guide to using Customized Docker and train your model in AWS Sagemaker! ... post explores a way of bringing your own code and image and quickly set up training in AWS Sagemaker. It comes with an easy-to-follow-along code example ...
In this video, i will show you what is s3 in aws ,S3 is a simple stroage service with excellent reliability and cost structure. I show you some of the basic ...
Learn from Docker experts to simplify and advance your app development and management with Docker. Stay up to date on Docker events and new version announcements!