Skip to content
benrudolph edited this page Dec 5, 2014 · 10 revisions

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.

Dependencies

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
  • 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.

Loading the data

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.

Background Jobs

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 &

Clone this wiki locally