Caffe and KNN as a service
Cuppa is developed and tested on debian/jessie.
To get you started quickly, we will be working in a Vagrant environment.
If you don't already have Vagrant setup, follow these steps -
vagrant plugin install vagrant-vbguest
Once you've setup Vagrant, create a new directory and download this Vagrantfile and the vagrant_bootstrap.sh file that Vagrant will use to install required dependencies.
In the created directory, run
vagrant up
This will create the virtual machine. This will take some time as Vagrant downloads debian/jessie base image and installs dependencies.
Once the virtual machine is created, log in by running
vagrant ssh
Clone the Cuppa project here.
git clone https://github.com/flipkart-incubator/Cuppa.git
Now cd into the Cuppa directory, and run
fab setup
This will run the setup steps in fabfile.py
, which will download and make caffe, build the nearest neighbours code and finally download the models required to run the examples.
Now, that Cuppa is built, we can start the services required to start serving models.
First, bring up an instance of redis. This is required by the KNN service.
fab start_redis
Now start the router, caffe service and k-nearest neighbours service
fab start_router
fab start_caas
fab start_knnaas
Lets hit the router health check endpoint, so we know its working
curl localhost:8000/elb-healthcheckYou should see,
{
"title": "Internal Server Error",
"description": "Model To Workers Map is Empty! "
}
Don't worry! This means the router is up and running and that no backend engines are registered to it yet.
Thats it. Setup is complete.
Head over to the examples to run some predictions.