-
Notifications
You must be signed in to change notification settings - Fork 7
Dev Installation Ubuntu 20.04
Starting from a virgin install of Ubuntu 20.04 Minimal
sudo apt install curl git nodejs npm python-is-python3 python3-distutils python3-venv
git clone git@github.com:suttacentral/bilara.git
Note: Setting up your SSH key with github is outside the scope of these instructions.
cd bilara
git clone git@github.com:suttacentral/bilara-data.git repo
Bilara uses python 3.8.x or higher. Modern versions of Ubuntu have at least this version of python installed by default.
Poetry is a dependency manager for Python. Install it using the following script:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
source $HOME/.poetry/env
Make sure it is installed correctly by running:
poetry -V
cd ~/bilara
poetry install
Note: When using poetry for python environment management, you use poetry run xyz to run a command in the virtual environment, or you can use poetry shell to activate the virtual environment.
If the installed python version is incorrect, open a new terminal and check the python version on you machine:
python -V
cd ~/bilara/client
npm install
You can simply use the docker ArangoDB installed for it.
You can create a file local.sh which will run local commands before running the bilara server. Run the following to create a local.sh which will make sure the ArangoDB container is running.
cd ~/bilara
echo '#/bin/bash
docker start sc-arangodb
sleep 2' > local.sh
chmod +x local.sh
Then you need to create a bilara user, run the following:
docker exec -it sc-arangodb arangosh
It will ask for a password, which is test by default.
In the ArangoSH shell enter the following:
db._createDatabase("bilara", {}, [ {username: 'bilara', passwd: 'bilara', active: true}]);
That will create the required database and user. Hit ctrl-d to exit the shell.
You should install ArangoDB 3.8.x in some manner, perhaps using the docker image, then create the database and user in some manner.
You can configure the local development setup to do things such as masquerading as a user. Create a file named server/local_config.py with contents such as:
config = {
'LOCAL_USERNAME': 'sujato',
'LOCAL_LOGIN': 'sujato',
'LOCAL_EMAIL': 'bob@example.com',
'GIT_SYNC_ENABLED': False,
}
cd ~/bilara
./run-dev
And navigate to http://localhost:3003/
You should not need to do this manually, but the TM can be forcefully (re)indexed with this command:
./index-tm