-
Notifications
You must be signed in to change notification settings - Fork 4
Dev Setup
Axis is a Ruby on Rails app. Setting it up locally is like many other Rails apps.
To get started:
git clone https://github.com/unhcr/axis.git
cd axis
bundle install
There are a few things missing in the open source repo for security sake. That is the application.yml
file and the database.yml
file. You can find those here: https://github.com/unhcr/axis.secrets
If you do not have access to that repository, you will need to get it in order to get access to the proper databases.
Axis has a few dependencies, some more critical than others. Here's a list of software you will need to install in order to have Axis run without error:
- Elasticsearch - Axis uses elasticsearch for all of its searching. Importance: Critical
- Postgresql - Axis uses Postgresql as its database. It uses a few specific Postgresql features for optimizations. Importance: Critical
- Ant - Axis uses this to build its database from CSVs. Importance: Critical
- Redis - Axis uses Redis to handle background jobs. Importance: Medium
- Phantomjs - Axis uses Phantomjs to generate PDF reports. Importance: Medium
- NLTK - Axis uses NLTK to generate summaries for the narratives. Importance: Low
Ensure that each of these are properly installed and they are running in order for Axis to work properly. Axis uses elasticsearch and Redis on the default ports.
Once you have the gems installed, you will need to load the data from UNHCR's databases. Firstly, you'll need to make sure you have postgres9.3 or greater setup (http://www.postgresql.org/download/).
Note you do need Postgres 9.3 as Axis depends on its JSON functionality
Run the migrations to ensure you have the proper schema:
rake db:migrate
Now to load the data you'll need to run the rake task build
.
rake build
This can take a couple of hours to do completely. You can run any individual build process by typing rake build:ppgs
, etc.
In order for Axis to execute background jobs it utilizes the Resque gem. Make sure Redis is running: redis-cli ping
.
Then let the workers work!
COUNT=5 QUEUE=* be rake resque:work &
rails s
The summarizer, as the name suggests, summarizes narrative text into digestible chunks. It's built in python to take advantage of python's NLTK. The script can be found here:
script/python/summarizer/summarize_test.py
You can check to make sure it's working by running the tests:
py.test -v script/python/summarizer/summarize_test.py
Note: make sure you have pytest installed