diff --git a/README.md b/README.md index 02b0b5bf..9fe129c4 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,13 @@ Main features: creating tables and views -``` +```sh $ pip install git+https://github.com/libAtoms/abcd.git ``` Example Docker installation on Ubuntu: -``` + +```sh sudo apt-get update sudo apt upgrade sudo apt install docker.io @@ -37,13 +38,13 @@ newgrp docker # or exit and log in Docker can be tested by running: -``` +```sh docker run hello-world ``` Example Python setup on Ubuntu (pip must be updated for poetry to be used successfully): -``` +```sh sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt install python3.10 @@ -56,7 +57,7 @@ curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 Building and installing ABCD dependencies via poetry: -``` +```sh git clone https://github.com/libAtoms/abcd.git curl -sSL https://install.python-poetry.org | python3 - export PATH="/home/ubuntu/.local/bin:$PATH" @@ -69,33 +70,34 @@ poetry build If you have an already running MongoDB server, or install your own, then you are ready to go. Alternatively, -``` +```sh docker run -d --rm --name abcd-mongodb -v :/data/db -p 27017:27017 mongo ``` will download and install a docker and run a database in it. To connect to a mongodb that is already running, use -``` + +```sh abcd login mongodb://localhost ``` If you are running `abcd` inside a docker, and want to connect to a mongodb outside that docker use something like this (example is for Mac OS): -``` +```sh abcd login mongodb://docker.for.mac.localhost ``` The above login command will place create an `~/.abcd` file with the following contents: -``` +```sh {"url": "mongodb://localhost"} ``` ### OpenSearch If you have an already running OpenSearch server, or install your own, then you are ready to go. Alternatively, -``` +```sh sudo swapoff -a # optional sudo sysctl -w vm.swappiness=1 # optional sudo sysctl -w fs.file-max=262144 # optional @@ -105,24 +107,27 @@ docker run -d --rm --name abcd-opensearch -v your@email ``` Then you'll be able to access the database remotely using, e.g. -``` + +```sh ssh abcd@your.machine summary ``` @@ -135,17 +140,17 @@ The database has a simple GUI, coupled with a visualiser. Data for now needs to Currently a manual uploaded image is available, that was built on 7/2/2020 by Tamas K. Stenczel. To access it: 1. pull the image - ``` + ```sh docker pull stenczelt/projection-abcd:latest ``` 2. create a docker network, which enables the containers to communicate with each other and the outside world as well - ``` + ```sh docker network create --driver bridge abcd-network ``` 3. run the mongo (ABCD) and the visualiser as well - ``` + ```sh docker run -d --rm --name abcd-mongodb-net -v :/data/db -p 27017:27017 --network abcd-network mongo docker run -it --rm --name visualiser-dev -p 9999:9999 --network abcd-network stenczelt/projection-abcd @@ -156,7 +161,8 @@ To access it: This will start the visualiser with ABCD integration! Have fun! After usage, for cleanup: -``` + +```sh docker stop visualiser-dev abcd-mongodb-net # stop the containers docker rm visualiser-dev abcd-mongodb-net # remove them if --rm did not docker network rm abcd-network # remove the docker network @@ -166,6 +172,6 @@ docker network rm abcd-network # remove the docker network Unit tests are automatically run on push and creation of pull requests. Unit testing using mock databases can also be run in the command line using: -``` +```sh python -m unittest tests ```