Download rating.csv
& movie.csv
files from kaggle link
Download also the trained model pickle files at this google drive link
Please unzip these files and put it under app/resources/
folder.
Environment variables to set
export ROOT_FOLDER=""
export PYTHONPATH="$PWD"
Install requirements
pip install -r requirements.txt
Setup Git hooks
pre-commit install #set up git hooks
Please make sure pip-tools is properly installed in your virtual environment with
pip install pip-tools
This should be done by adding the required package in the requirements.in file. Then using pip-tools the requirements.txt file can be reproduced.
pip-compile --output-file requirements.txt --quiet requirements.in
pip-sync requirements.txt
Or using the makefile
make requirements
docker build -t registry.heroku.com/pagerank-webapp/web .
docker run --rm --name pagerank.webapp.container -e PORT=8080 -p 8080:8080 registry.heroku.com/pagerank-webapp/web:latest
Or using makefile
make dockerbuild
make dockerrun
To mount the datafiles in local, cd
into project directory, uncomment the first 2 lines in .dockerignore
and run:
make dockerrun-local-mount
Install heroku
brew tap heroku/brew && brew install heroku
Login
heroku login #opens web browser
heroku container:login #to tell heroku we use container login for deployment
Choose a name for webapp on Heroku website after login:
pagerank-webapp
Push docker image & deploy
registry.heroku.com/pagerank-webapp/web
heroku container:release -a pagerank-webapp web
Remarks
The name of the docker image should be in this format:registry.heroku.com/<app-name>/web
Pagerank modeling
Deploy using Heroku