Purpose: To practice some of the skills I’ve learned, try out new technologies I haven’t, and see what it takes to deploy a micro-scale “production” ML service. Bare-bones, and may choose to expand on in the future. Not focusing on the modeling / data science workflow as much as the infrastructure and software components.
- Idea: Create and deploy an endpoint which receives a picture of a handwritten number (i.e. MNIST dataset) and simply returns the prediction.
- Preliminary design:
- General Thoughts:
- This is just a simple endpoint, but using some relevant technologies including containerized deployment with Docker, and FastAPI as a performant API framework
- Just using Postman as stand in for web client for now
- May change to using AWS SQS for distributed version of service, and use FastAPI for a separate the web server
- Potential Future Version:
- Use jupyter notebook to train/test/save basic NN on MNIST from TensorFlow tutorial (https://www.tensorflow.org/datasets/keras_example)
- Research FastAPI and scaffold out a simple API
- Test service locally with Postman
- Create DockerFile, build Docker image
- Test containerized service locally with Postman
- Research unfamiliar AWS resources: VPC, CloudFormation, ECR/ECS, Fargate
- Configure and deploy to AWS ECS using CloudFormation on default account VPC
- Referenced guide at https://milapneupane.com.np/2019/07/28/how-to-deploy-a-docker-container-with-aws-ecs-using-cloudformation/
- Steps include:
- Use CloudFormation template to set up ECR stack
- Tag and push updated Docker image to ECR
- Use CloudFormation template to set up ELB stack (as well as security groups, load balancer listener, etc.)
- Use CloudFormation template to set up ECS stack (Use Fargate to manage containers)
- Test deployed version with Postman: http://mnist-aws-lb-656408764.us-east-1.elb.amazonaws.com/
- A Better/Updated Diagram of My Current Deployment:


