AcousticBrainz Server consists of two parts: web server that powers acousticbrainz.org website and high-level data extractor that processes incoming low-level information about recordings.
- Python 2.7.x
- PostgreSQL >=9.2 (needs the JSON data type)
- Node.js
- memcached
- pxz for exporting and importing the data
For example in the latest Ubuntu, this command will install pre-requisites:
$ sudo apt-get install python-dev python-virtualenv memcached pxz \
postgresql-9.3 postgresql-client-9.3 postgresql-server-dev-9.3
It is recommended, although optional, to first set up a virtual environment and activate it:
$ virtualenv venv
$ . ./venv/bin/activate
Then use pip
to install the required Python dependencies:
$ pip install -r requirements.txt
Copy over config.py.sample
to config.py
and edit its content to fit your
environment.
You need to create a new application
and set two variables: MUSICBRAINZ_CLIENT_ID
and MUSICBRAINZ_CLIENT_SECRET
.
On MusicBrainz set Callback URL to http://<host>/login/musicbrainz/post
.
After you tweak configuration file, database needs to be created:
$ python manage.py init_db
Optional: You might want to create a database that will be used by tests:
$ python manage.py init_test_db
Node.js dependencies are managed using npm
. To install these dependencies run
the following command:
$ npm install
We use Gulp as our JavaScript/CSS build system. It should be installed with
node.js dependencies. Calling gulp
on its own will build everything necessary
to access the server in a web browser:
./node_modules/.bin/gulp
Keep in mind that you'll need to rebuild static files after you modify JavaScript or CSS.
After all this, you can run the site/server using ./server.py
.
Use ./server.py -h
to get a list of command-line switches
to further suit your local environment (e.g., port, listening address, ...).
To run high-level data extractor you'll need two things:
streaming_extractor_music_svm
which is a part of the Essentia library- svm_models which are available at http://essentia.upf.edu/documentation/svm_models/
To build the extractor binary you'll need to get Gaia and Essentia libraries. Generally, you should use installation instructions provided with them, but to save you some time here's a set of steps that you can follow:
-
git clone
Gaia and install it without using additional options during the configuration step -
git clone
Essentia and configure it like this:$ ./waf configure --mode=release --with-gaia --with-example=streaming_extractor_music_svm
-
Build Essentia and copy
streaming_extractor_music_svm
binary from build/src/examples/ directory into ./hl_extractor/ in the project root.
Download archive from http://essentia.upf.edu/documentation/svm_models/, extract it, and move contents of svm_models directory into /hl_extractor/svm_models in the project root.
$ cd high-level
$ python hl_calc.py