How to Automatically Containerize Your Model

How we make it easy to automatically create API endpoints an containerize your model.
You’ve completed a brand new model in python (probably) or R (less likely these days) or even Matlab (still a thing apparently!) —congratulations! Now you just need to update your repo, and send it over to your colleague and engineering team. Oh what's that they say? It doesn't work on their machine. Well did they install the right packages (they didn't)? Did they check their versions (maybe)? Sigh.
It reminds me of one of those insane 90's infomercials where things go comically wrong.
"If only there was a better way!"
In this blog, we will discuss what a container is, and how to utilize Gravity AI’s marketplace to upload your own model to containerize, build a simple UI layer, and easy to use API endpoints. What’s the big deal with containers?
Think of your code like Christmas lights. Beyond the fact that your code brings joy to millions (you look nice today, by the way) the wires can get tangled up easily, and if one of the lightbulbs in the middle of the strand goes out, you run the risk of damaging the rest of the lights and wiring by trying to repair the light that has gone out.
A container works to alleviate the mess. It takes large bits of your code and turns them into one microservice that runs every part of your code in a self-contained unit. That way, if one strand in a larger pipeline breaks, you don’t run the risk of the rest of your pipeline flickering out. You can easily detect and repair that microservice without having to wade through the tangle of a huge monolithic code base. Popular brands of containers, such as Docker, add a layer of abstraction, almost like a virtual machine, that allow it to just.....run. So you can stop spilling your soda all over your fellow data scientists.
Unifying your code in Docker—or “dockerizing” it—is becoming more popular within the data science community, but it still requires a degree of knowledge to do this manually, and build a "useful" container. Rather than continuing to keep this process gated to only those with deep containerization knowledge, gravityAI has developed a build process to automatically wrap nearly any model, with little effort, in a custom docker container, complete with API endpoints, auth capabilities and a simple UI.
We even built in some data transformation capabilities. Data not perfectly structured to match the fields as you go to upload? Don’t worry! We include an automatic mapping file that reestablishes the data into the correct input/output schema.
What are the benefits of automatically containerizing your model with our snazzy container?
Some of the benefits of automatically containerizing with the gravityAI container include:
- There is a clear visual user interface (UI) makes it easy to run a one-off file through the model for a citizen data scientist, or for testing purposes.
- The thing just works. No more battling packages, versions, "it doesn't run on my machine."
- Automatically create API endpoints that are easy for users to tap into, and also automatically documented in Swagger.
- It can take hours to build this all manually. Through our upload flow, you could get that thing in a container in minutes.
Give it a try! You know you want to.
Dig into our documentation here to get started. It will change your life, or your money back.