A Flask Web application running on Linode's Shared CPU where a binary classifier machine learning model file is placed in Linode's Object Storage, which is consumed by a Flask web application written in Python to do prediction, log the prediction status in Linode's MySQL server, and return results.
A complete and successful migration done from Azure Functions with Blob Storage to Linode's Shared CPU with Object Storage.
log_source, model_version, average response time (in seconds)
azure, v1, 0.030180000141263007
linode, v1, 0.021626923161630448
Flask served ML model in Linode Shared Instance with files from Lindos Object Storage
Linode + DEV Hackathon 2023 - ML Model Consume - Sandy Inspires
This repo contains code that runs on Linode's Shared CPU where a binary classifier machine learning model file is placed in Linode Object Storage, which is consumed by a Flask web application written in Python to do prediction, log the prediction status in Linode's MySQL server, and return results.
Download the Postman collection which has sample API endpoints and JSON request body
I wanted to explore more on multi-cloud and how to integrate it with existing services or make services from different cloud providers to make things work seamlessly. This Linode hackathon give me the exact experience I was looking for, to integrate or migrate existing services in Azure to Linode to check compatibility between various services.
To be honest, I learnt a ton of information about hosting a server and how to get apps running, yay, I did spend a lot of time in debugging stuff to see where things fail, Python version difference, OS dependencies, Python Package dependencies, setting up the virtual environment in the right place.
Learnings from this Project 👨🎓
Deploying an actual server and getting it up and running was so cool. You don't get to do that with Azure, you just push the code and it just runs. Everything is under the hood. You miss out on all the interesting parts of deployment. Great knowledge on how a server works and how we can deploy services inside a server with supervisor and use Nginx to as both HTTP/HTTPS server. Without Linode I don't believe I would've known how a server works and how the request is getting routed to a web application and to our Python code.
Networking part is another interesting area that I explored, I didn't notice much when it was in Azure, as you get a HTTPS endpoint to hit and that all you know. Now you've an IP and you need domain name to be mapped to that IP to hit the endpoint with the domain name instead of IP address.
I'll definitely explore more on firewall rules and load balancer
to see how these are configured and used in an actual server.
Conclusion ✨
It was a super fun hackathon, enjoyed using Linode, super simple and clean UI. Love the shared instance starts with just $5 a month.
Would be deploying more applications in Linode for my future hackathons.
One hell of a hackathon it was!
Special thanks to Linode and Dev team for hosting this hackathon.
Happy Learning! 📑
PRs are welcomed and drop your suggestions in the comments.