How to deploy a flask app integrated with a ML algorithm on GCP App Engine (GAE)
Greetings everyone! Another work after gaining inspiration from Machine learning India's post "Stop training and start deploying".
TRAINING AND COMBINATION WITH FLASK
I have used pycaret to make training and deploying easier. The dataset is used to predict net hourly electrical energy output of a combined cycle power plant taken from UCI ML Repository. After training, the model has been saved in a .pkl file.
DEPLOYMENT
Google App Engine(GAE) is a Platform as a Service and cloud computing platform for developing and hosting web applications in Google-managed data centers. It is analogous to AWS Elastic Beanstalk.
PROCEDURE
- Make sure you have the Cloud SDK Installer ready
- Create a new project from IAM & Admin > Manage resources
- Navigate to your local project folder and open terminal/command prompt and type in the following command
gcloud init
- Pick a configuration and choose the account you would like to use to perform operations for this configuration
- Pick a cloud project to use or create a new project if you haven't before
- Type the below command
gcloud app deploy app.yaml --project <your-project-name>
- Choose a region for your app engine application to be located
- Wait for a while and you will probably encounter a error with a link provided to enable Cloud Build API
- Access the link and enable it
- Now retry the same command and wait until the process is finished
- Use the link to access your web application or use the command as specified by them
I am publishing two articles today. Please check out the other one if you haven't at : https://www.garudax.id/pulse/how-deploy-nodejs-app-integrated-ml-algorithm-aws-ebs-ambati/?published=t
GitHub Link : https://github.com/shiv2110/flask-ml-gcp