Google Cloud Compute Engine
Flask==1.1.2, python==3.7
Other libraries version informations are in requirement.txt
(Hint) Cuz the Word2Vec files is larger than the limit of Github file size. Word2Vec2.trainables.syn1neg.npy and Word2Vec2.wv.vectors.npy are stored by using GIT LFS. And in deployment, these two files must upload by youtself under "static/".
Files of model and Word2Vec language model:
https://drive.google.com/drive/folders/158yUqcVOj35HQXOnF-zE9IrE971Pcv2I?usp=sharing
Registered a Google Cloud Account and apply for a VM Instance under Compute Engine. Name it with your project name. Remember the external IP address so that you can connect your VM by uaing SSH client.
Use SSH client to connect instance and use Git clone commend in VM terminal to clone this repository into your VM.
git clone https://github.com/hensby/ReviewRating.git
Upload the model and Word2Vec by using gcloud commend or using ssh brower window. Upload the files under "static/" direction. The command is shown below:
gcloud compute scp local-file-path instance-name:~
Install the Project Dependencies in requirements.txt by using the commend below.
pip3 install -r requirements.txt --user
Deploy the flask APP by using command below: I set the host as 0.0.0.0. It's easy to set the firewall rules.
export FLASK_APP=review_rating.py
flask run --host=0.0.0.0
Expose the Flask HTTP port (5000) from the VM’s firewall. This is done via gcloud tools in your local development environment.
gcloud compute firewall-rules create open-flask-rule --allow tcp:5000 --source-tags=flask-demo --source-ranges=0.0.0.0/0
Or you can set the firewall in yout Google Instance in the browser.