Skip to content

Commit

Permalink
Tidy README formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Jun 11, 2024
1 parent 733d99a commit 9fa4bef
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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 <path-on-your-machine-to-store-database>:/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
Expand All @@ -105,24 +107,27 @@ docker run -d --rm --name abcd-opensearch -v <path-on-your-machine-to-store-data

will download and install an OpenSearch image and run it. The connection can be tested with:

```
```sh
curl -vvv -s --insecure -u admin:admin --fail https://localhost:9200
```

To connect to an OpenSearch database that is already running, use
```

```sh
abcd login opensearch://username:password@localhost
```

## Remote access

You can set up an `abcd` user on your machine where the database is running, and then access it remotely for discovering data. Make sure you have the `~/.abcd` file created for this user, then put this in the `.ssh/authorized_keys` file (substituting your public key for the last part):
```

```sh
command="/path/to/abcd --remote ${SSH_ORIGINAL_COMMAND}",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa <public-key> your@email
```

Then you'll be able to access the database remotely using, e.g.
```

```sh
ssh [email protected] summary
```

Expand All @@ -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 <path-on-your-machine-to-store-database>:/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
Expand All @@ -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
Expand All @@ -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
```

0 comments on commit 9fa4bef

Please sign in to comment.