
Olamide OlanrewajuSo, this week on ML Zoomcamp, we're to learn how to deploy a machine learning Model. Previously in...
So, this week on ML Zoomcamp, we're to learn how to deploy a machine learning Model.
Previously in the Zoomcamp, I've had issues concentrating when watching the video lectures. I generally do not "enjoy" video tutorials that much. So this time, I decided to read the notes on the repository and it was a breeze.
A much better experience. Maybe I should have been doing this all this while. I guess this is why the idiom is "Read the Docs" as opposed to "Watch the tutorial".
Anyways, so back to deployment. Generally ML Models are usually built on Notebooks. Or at least, that's how they've been built so far in the course. But you can't deploy a notebook for other users to connect to, as far as I know. You have to create a public API and host it on a platform like AWS.
But first, we have to export the model from the Notebook. Which we used Pickle for, and it outputted a binary file.
After exporting the model with pickle, we created a fastAPI server that exposed an endpoint which uses the exported model to do its magic. Then we use docker to containerise everything, to avoid stories of "But it works on my system".
After containerising with docker, the next step is the deployment. For some reason, the course homework doesn't include a deployment step. Although the course instruction says we can deploy it to AWS Elastic Beanstalk.
But I've had a horror filled experience with Elastic Beanstalk and it's a no-no for me. Better to just use a good old server like an AWS Ec2 instance.
However, unless you're on the free trial, an AWS EC2 instance isn't the go-to for a learning project. Fortuitously, I recently discovered, by chance, that you can actually get a free server from Oracle!
Like, a full, actual, working server. No ifs, no buts. No expiry date. An actual free server that you can use for side projects, experiments, etc.
I had no idea this even existed. How I discovered it was that on a fortuitous Friday afternoon, AWS sent me an angry email complaining that my free trial was over and if I didn't renew, they were going to kick me out. They also told me that they didn't want to ever see my face again. Ever.
So, I screenshotted the angry email and sent it to a group chat asking people why AWS usually acts like an upset ex when you cancel with them. Of course, the usual tales of "that's just how it is" ensued. Then someone mentioned that I can actually get a free server from Oracle.
I disbelieved this at first. So I investigated. I asked Claude about this. Whether it was a new development, maybe a promo to ensnare people. But Claude told me that it was legit. That it's one of the best kept secrets in the development community.
So, I moved my property from AWS to Oracle and have been using this ever since.
Although... As at the time of writing, Oracle has been sending me emails that my free trial period is about to expire and that any services that aren't on their free plans would be discontinued. Well... The server I used is on their free plan, but who knows, maybe I'm in for a rude shock.
For this week, I didn't deploy the ML Model from the assignment to the cloud. It's a FastAPI server. I have deployed FastAPI servers countless of time. I'm sure if there's a need to deploy an ML Model to the cloud, I can handle that.
See you next week.