Requirements

Support multiple domains. (NORDUnet and SUNET to start with)

Continuous and on request updates instead of once a day.

Solutions

Multiple domains could be solved with Labels. Neo4j version >=2.0 is required.

Continuous updates of the database requires multiple database connections. We will use neo4jdb-python drivers.

Work in progress

Updated graph model, http://gist.neo4j.org/?fe682b1dc394dd8e4421

Branch created in repo: neo4jdb-python

Setting up a new instance

git clone https://git.nordu.net/norduni.git
git checkout neo4jdb-python
# Download neo4j docker image and start it
docker pull tpires/neo4j
docker run -d -v /path_to_repo/norduni/docker/neo4j.properties:/var/lib/neo4j/conf/neo4j.properties -v /opt/docker/neo4jdata:/var/lib/neo4j/data -p 7474:7474 tpires/neo4j
# Create the indexes with curl
curl -D - -H "Content-Type: application/json" --data '{"name" : "node_auto_index","config" : {"type" : "fulltext","provider" : "lucene"}}' -X POST http://localhost:7474/db/data/index/node/
curl -D - -H "Content-Type: application/json" --data '{"name" : "relationship_auto_index","config" : {"type" : "fulltext","provider" : "lucene"}}' -X POST http://localhost:7474/db/data/index/relationship/
# Create a virtualenv and activate it
virtualenv env
. env/bin/activate
# Install the python packages
pip install paver
pip install -r /path_to_repo/requirements.txt
# Create a settings.py from the template /path_to/repo/src/niweb/niweb
cp /path_to_repo/src/niweb/niweb/generic_settings.py /path_to/repo/src/niweb/niweb/settings.py
# Sync the db
python /path_to_repo/src/niweb/manage.py syncdb
python /path_to_repo/src/niweb/manage.py migrate apps.noclook
python /path_to_repo/src/niweb/manage.py migrate actstream
python /path_to_repo/src/niweb/manage.py migrate tastypie
# Run the app
python /path_to_repo/src/niweb/manage.py runserver

# Optional postgres instead of sqlite3, don't forget to change database settings in settings.py.
# Download postgres docker image and start it
docker pull orchardup/postgresql
docker run -d -p 5432:5432 -e POSTGRESQL_USER=norduni -e POSTGRESQL_PASS=docker -e POSTGRESQL_DB=norduni -v /opt/docker/postgresql_data/:/var/lib/postgresql/ orchardup/postgresql
  • No labels