nopaque/README.md

87 lines
4.4 KiB
Markdown
Raw Normal View History

2020-06-05 12:42:04 +00:00
# nopaque
2019-07-17 11:49:16 +00:00
2020-06-05 12:42:04 +00:00
_nopaque_ bundles various tools and services that provide humanities scholars with DH methods and thus can support their various individual research processes. Using _nopaque_, researchers can subject digitized sources to Optical Character Recognition (OCR). The resulting text files can then be used as a data basis for Natural Language Processing (NLP). The texts are automatically subjected to various linguistic annotations. The data processed via NLP can then be summarized in the web application as corpora and analyzed by means of an information retrieval system through complex search queries. The range of functions of the web application will be successively extended according to the needs of the researchers.
2019-08-26 12:09:43 +00:00
2020-06-05 12:42:04 +00:00
## Prerequisites and requirements
2019-08-26 12:09:43 +00:00
2020-06-05 12:42:04 +00:00
1. Install docker for your system. Following the official instructions. (LINK)
2. Install docker-compose. Following the official instructions. (LINK)
2019-08-26 12:09:43 +00:00
2020-01-07 14:03:21 +00:00
2020-06-05 12:42:04 +00:00
## Configuration and startup: Run a docker swarm and setup a Samba share
2019-08-15 10:03:16 +00:00
2019-08-26 12:09:43 +00:00
1. **Create Docker swarm:**
2020-02-13 13:35:55 +00:00
2020-06-05 12:42:04 +00:00
The generated computational workload is handled by a [Docker](https://docs.docker.com/) swarm. A swarm is a group of machines that are running Docker and joined into a cluster. It consists out of two different kinds of members, manager and worker nodes. The swarm setup process is described best in the [Docker documentation](https://docs.docker.com/engine/swarm/swarm-tutorial/).
2020-02-13 13:35:55 +00:00
2. **Create a network storage:**
2020-02-13 13:35:55 +00:00
2020-06-05 12:42:04 +00:00
A shared network space is necessary so that all swarm members have access to all the data. To achieve this a [samba](https://www.samba.org/) share is used.
2019-08-26 12:09:43 +00:00
``` bash
2020-01-07 14:03:21 +00:00
# Example: Create a Samba share via Docker
# More details can be found under https://hub.docker.com/r/dperson/samba/
2020-03-16 09:49:45 +00:00
sudo mkdir -p /srv/nopaque/storage
docker run \
2020-01-07 14:03:21 +00:00
--name opaque_storage \
-v /srv/nopaque/storage:/srv/nopaque/storage \
-p 445:445 \
dperson/samba \
-p \
-s storage.nopaque;/srv/nopaque/storage;no;no;no;nopaque \
-u nopaque;nopaque
2020-06-05 12:42:04 +00:00
# Mount the Samba share on all swarm nodes (managers and workers)
2020-03-16 09:49:45 +00:00
sudo mkdir /mnt/nopaque
2020-06-05 12:42:04 +00:00
sudo mount --types cifs --options gid=${USER},password=nopaque,uid=${USER},user=nopaque,vers=3.0 //<SAMBA-SERVER-IP>/storage.nopaque /mnt/nopaque
2019-08-15 10:03:16 +00:00
```
2020-06-05 12:42:04 +00:00
## Download, configure and build _nopaque_**
3. **Download, configure and build _nopaque_**
2019-08-26 12:09:43 +00:00
``` bash
2020-06-05 12:42:04 +00:00
git clone https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
2020-03-16 09:49:45 +00:00
mkdir logs
cp nopaque.env.tpl nopaque.env
2020-06-05 12:42:04 +00:00
<YOUR EDITOR> nopaque.env # Fill out the variables within this file. For the GitLab variables either use your credentials (not recommended) or create an access token with the read_registry scope. If this repository is public no credentials are needed.
2019-08-15 10:03:16 +00:00
```
2020-06-05 12:42:04 +00:00
### Variables and their values are explained here:
The first three DOCKER variables should only be used if you want to use the Docker HTTP API. Check the daemon readme to see how to create certificates and activate the API.
FLASK_CONFIG=development|testing|production \
SECRET_KEY=92b461ba136e4ca48e430003acd56977 \
Uses this for example to create a secret key: `python -c "import uuid; print(uuid.uuid4().hex)"`
The **GitLab Registry** Variables are not needed if this repository is public. If needed use your GitLab username and a token as a password
**Flask Mail** variables are needed for sending password reset mails etc. Use your own mail server configs here.\
MAIL_SERVER=smtp.example.com \
MAIL_PORT=587 \
MAIL_USE_TLS=true \
MAIL_USERNAME=user@example.com \
MAIL_PASSWORD=password \
NOPAQUE_MAIL_SENDER=Nopaque Admin <user@example.com> _Name shown as sender._
**Nopaque** variables are needed for the web app.\
NOPAQUE_ADMIN=yourmail@example.com _If a user is registered using this mail the user will automatically be granted admin rights._ \
NOPAQUE_CONTACT=contactmailadress@example.com _Contact mail address shown in the footer of the web application._\
NOPAQUE_DOMAIN=yourdomain.com _The domain your nopaque installation is hosted on. use https://nopaque.localhost for a local running instance._ \
NOPAQUE_LOG_LEVEL=WARNING|INFO|ERROR|DEBUG \
NOPAQUE_STORAGE=path/to/your/samba/share
**PostgreSQL Database** credentials: \
POSTGRES_DB_NAME=dbanme \
POSTGRES_USER=username \
POSTGRES_PASSWORD=password
2020-03-16 09:49:45 +00:00
```bash
2020-06-05 12:42:04 +00:00
cp .env.tpl .env
<YOUR EDITOR> .env # Fill out the variables within this file.
docker-compose build
2020-03-16 09:49:45 +00:00
```
2020-06-05 12:42:04 +00:00
**Start your instance**
```bash
# for background execution add the -d flag and to scale the app, add --scale web=<NUM-INSTANCES>
2020-03-16 09:49:45 +00:00
docker-compose up
2020-01-07 14:03:21 +00:00
```