Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Python C Other

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
acoustid
admin
doc
pages
postgresql Replace int4 with int32, fixes #12
scripts
sql
static
templates
tests
.gitignore
LICENSE
README
acoustid.conf.dist
requirements.txt
run_psql.sh

README

AcoustID Server
===============

Installation
------------

On Ubuntu you can install all dependencies using the following command:

 $ sudo apt-get install postgresql postgresql-contrib postgresql-server-dev python python-dev python-virtualenv redis

Compile and install the included PostgreSQL extension:

 $ cd postgresql
 $ make
 $ sudo make install
 $ make clean
 $ cd ..

Setup Python virtual environment:

 $ virtualenv e
 $ source e/bin/activate
 $ pip install -r requirements.txt

Prepare the configuration file:

 $ cp acoustid.conf.dist acoustid.conf
 $ vim acoustid.conf

Create the PostgreSQL database:

 $ sudo -u postgres createuser acoustid
 $ sudo -u postgres createdb -O acoustid acoustid

Install extensions into the newly created database:

 $ psql -U postgres acoustid <`pg_config --sharedir`/contrib/_int.sql
 $ psql -U postgres acoustid <`pg_config --sharedir`/contrib/pgcrypto.sql
 $ psql -U postgres acoustid <`pg_config --sharedir`/contrib/acoustid.sql

Create the database structure:

 $ ./run_psql.sh <sql/CreateTables.sql
 $ ./run_psql.sh <sql/CreateFunctions.sql
 $ ./run_psql.sh <sql/CreatePrimaryKeys.sql
 $ ./run_psql.sh <sql/CreateFKConstraints.sql
 $ ./run_psql.sh <sql/CreateIndexes.sql

Setup a MusicBrainz slave database (without custom extensions):

 $ cd /path/to/mbslave
 $ cp mbslave.conf.default mbslave.conf
 $ vim mbslave.conf
 $ echo 'CREATE SCHEMA musicbrainz;' | ./mbslave-psql.py
 $ sed 's/cube/text/i' sql/CreateTables.sql | ./mbslave-psql.py
 $ ./mbslave-import.py mbdump.tar.bz2 mbdump-derived.tar.bz2
 $ ./mbslave-psql.py <sql/CreatePrimaryKeys.sql
 $ vim sql/CreateFunctions.sql # remove functions that mention "cube"
 $ ./mbslave-psql.py <sql/CreateFunctions.sql
 $ grep -vE '(collate|page_index|gist)' sql/CreateIndexes.sql | ./mbslave-psql.py
 $ ./mbslave-psql.py <sql/CreateViews.sql
 $ ./mbslave-psql.py <sql/CreateSimpleViews.sql
 $ ./mbslave-sync.py

TODO

Unit Tests
----------

Before you can run the test suite, you need to create a configuration file
called acoustid-test.conf. This should use a separate database from the
one you use for development, but it should have the same structure. The
simplest way to create it is to copy your development database.

You can then run the test suite like this:

 $ nosetests -v

The first thing it does is setting up the database. Normally you shouldn't
need to do this more than once, so the next time you can run the test suite
without the database setup code:

 $ SKIP_DB_SETUP=1 nosetests -v

Something went wrong with that request. Please try again.