Deploying ML model in Heroku.

Deploying ML model in Heroku.

Deploying ML model in Heroku.

We had seen what is docker and the process of dockerization in our previous article. In this article let's see how to deploy our machine learning model in heroku cloud platform.

Prerequisites:
1.This post is written in the view that you have already created docker file,pickle file of machine learning model.
2.Create account in heroku.
3.Download and install heroku CLI.

Deployment:
At first you need to login into the Heroku CLI using 

$ heroku container:login

It would open the browser and prompt you to log in with your Heroku credentials if you are not logged in already or if you are already logged into your Heroku account in your browser, just click Login on the new browser tab.


If you succeed in logging, you will receive a message “Login Succeeded”.
Run the below command to create an app in Heroku, which prepares Heroku to receive your source code. Enter any name for your app. Heroku doesn’t allows to take names that’s already taken.

$ heroku create <name-for-your-app>

Now, you will receive a link like,

https://<name-for-your-app>.herokuapp.com/

Now, Run the below command to push the container into Heroku(the below command may take upto hours depending on your internet speed).

$ heroku container:push web --app <name-for-your-app>

At this point, the docker container is pushed to Heroku, but not deployed or released. The following command would deploy the container.

$ heroku container:release web --app <name-for-your-app>

Now, the app is released and is running on Heroku and you can view it in the below site

https://<name-for-your-app>.herokuapp.com/

Thus, we successfully dockerized and deployed our Python Flask app onto Heroku.


0 Response to "Deploying ML model in Heroku."

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel