Skip to content

Commit

Permalink
Rewrite README
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed May 7, 2023
1 parent 88a6461 commit 304106a
Showing 1 changed file with 23 additions and 48 deletions.
71 changes: 23 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,47 @@ AcoustID Server
This software is only meant to run on [acoustid.org](https://acoustid.org). Running it on your own server is not supported.
It's possible, but you need to understand the system well enough and even then it's probably not going to be useful to you.

Installation
------------
Local Development
-----------------

On Ubuntu you can install all dependencies using the following commands (as root):
You need Python 3.8 or newer to run the code. On Ubuntu, you can install the required
packages using the following command:

sudo apt-get install python python-dev python-virtualenv
sudo apt-get install python3 python3-dev python3-venv

Start the required services using Docker:
Setup Python virtual environment:

docker-compose up -d
python3 -m venv venv
source venv/bin/activate

If you can't use Docker, you will need to install PostgreSQL and Redis from packages:
export PYTHONPATH=`pwd`

sudo apt-get install postgresql postgresql-contrib
sudo apt-get install redis-server
pip install -r requirements.txt
pip install -r requirements_dev.txt

And you will also neeed to compile the [pg\_acoustid](https://bitbucket.org/acoustid/pg_acoustid) extension yourself. It's easier to use the ready-made Docker images.
Start the required services using Docker:

Setup Python virtual environment:
export COMPOSE_DOCKER_CLI_BUILD=1
export DOCKER_BUILDKIT=1
export COMPOSE_FILE=docker-compose.yml:docker-compose.localhost.yml

virtualenv e
source e/bin/activate
pip install -r requirements.txt
pip install -r requirements_dev.txt
docker-compose up -d redis postgres index

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:

sudo -u postgres psql acoustid -c 'CREATE EXTENSION intarray;'
sudo -u postgres psql acoustid -c 'CREATE EXTENSION pgcrypto;'
sudo -u postgres psql acoustid -c 'CREATE EXTENSION acoustid;'
Initialize the local database:

Create the database structure:

./run_psql.sh <sql/CreateTables.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
alembic upgrade head

TODO
Run the applications:

python manage.py run web
python manage.py run api
python manage.py run cron
python manage.py run worker

Local Testing
-------------
Expand Down

0 comments on commit 304106a

Please sign in to comment.