forked from libAtoms/abcd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
733d99a
commit 9fa4bef
Showing
1 changed file
with
25 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <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 | ||
|
@@ -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 | ||
``` | ||
|
||
|
@@ -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 | ||
|
@@ -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 | ||
``` |