Skip to content Skip to sidebar Skip to footer

Google App Engine: Automatically Re-deploy Once A Day To Update Machine Learning Model?

I have the following situation: a Python Flask app running on Google App engine; this app serves predictions from a Spacy machine learning model. Throughout the day, there is a wor

Solution 1:

It sounds like you should be deploying a new version of your app daily, and then warming the new instance before migrating traffic to it. This is with the assumption that initial start up is slow for your app to load this new model so you can't interrupt the running version because it will disrupt your traffic at that time.

To deploy versions, follow the official guide here and then to warm up and migrate traffic use the guide here.

To automate this process you can use the Admin API -- the question will be how you get the model to a specific location for the new version. I would recommend using same file name for the model so that your actual code stays the same consistently per version. With that, you should be able to build that directory and deploy the app with the new version programmatically every day -- but it depends on the rest of your setup and how you are storing and automating any other part of the process.


Solution 2:

This sounds like a very complex process, but what I can told is that after you did all your previous settings for things to be right, you can also use Cloud Build in order to automate the deployments on App Engine. You can see in this quickstart how this process will work.

Basically, you store your application inside a repository, and with every new commit a trigger will make the deployment of your App Engine application version. You can also use git as a repository in order to achieve that, following the steps in this guide.

If you want the whole process to be fully automated you can think of a solution for some auto-commits, like using the Cloud Scheduler.


Post a Comment for "Google App Engine: Automatically Re-deploy Once A Day To Update Machine Learning Model?"