[Docker] Hosting your A.I. on docker
The A.I. you spent countless hours building it, regardless of whether it is as powerful as JARVIS, or a simple cat/dog classifier; they deserved to be seen. There are many options to host your model, now let’s take a look at some different camps you can jump into. (1) Host AI models on your local host (you need a static Public IP for this). (2) Host your models on cloud services like AWS cloudfront. (3) Add them as skills to Alexa or Google Assistant or just publish them as an app with some cute animal avatar. (4) Push your codes/Jupyter notebook/models to GitHub for others to compile and run. OK, choices are good; and here’s some tips for those who have selection dilemma: (a) If you want people to make inferences from your model directly, hosting them on cloud is probably the most convenient (and less technical) ways to do it; but it might cost you a fortune if your model is popular like Dua Lipa’s is trending now. If you want people to retrain your model (for transfer learning); then it is recommended that you push your work to git (in .pynb) and anyone can run them in Google Colab (free GPUs!).
In this post, we will show you how to turn your local model into ‘production’ using docker and start contributing to the society. Now, why docker? There’s already a ton of love stories out there on why DevOps like docker so much. You can read more here: <add links>. In one sentence, docker is… (ok i tried but i cant). In general, docker is the anti-thesis of monolithic services where we break a large program with many functions or modules down to their atomic level; which is service itself; then we containerize them, put them up to docker hub as image so anyone can access while it also simplifies code management. Think of upgrading a graphic card for a ready built, one piece, tightly sealed iMac 27' (a monolithic program) compare to a customisable modular gaming PC where you add in/swap out components easily (micro-services) as you see fit. Pick your camp :)
Note that this post is written for beginners with no experience in docker. You will find other stories out there which are related to this topic that are geared towards purists and experts. The goal in this post is to guide newbies from the start until they have a model that is accessible through the Internet in layman language; so feel free to skip any parts that you think should be kept to your grandma :). Ok, now LET’s GET PHYSICAL.
Part I: Setting up your docker environment
Part II: Running a basic container (hosting web server using nginx)
Freebies Section:
Get your docker basics cheatsheet here