DEV Community

Discussion on: Machine Learning Model Deployment with FastAPI and Docker

Collapse
 
msopacua profile image
msopacua

This isn't what we call deployment in the industry, but installation or setup: You've containerized several services and made it runnable on your local machine.

Deployment (so it's accessible by the internet) involves quite a few more steps. For example, setting up and pushing to ECS on AWS or kubernetes on Digital Ocean. It involves writing scripts that interact with your repository and pushes to your hosting environment.

You're using scikit-learn, which doesn't have GPU support, so you're good on that with the single container. But with Tensorflow/Keras/pyTorch and similar stacks this has a few more caveats as they will benefit from GPUs for complex math, so running your deep learning models in the same container as your Rest API is generally not done, given the extra cost for GPU enabled containers (serving an API has very little math and when done right is not a CPU bound process).

Collapse
 
jserenge profile image
jserenge

so how would you summarize the deployment process and what are the most important steps to consider

Collapse
 
msopacua profile image
msopacua
  1. Provider selection (AWS / Azure / GCP / Digital Ocean / ...)
  2. Provisioner selection (terraform / opentofu / ansible / ...)
  3. Container configuration if wanted (some cloud providers offer complete stacks for deep learning as a product)
  4. CI/CD integration