1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-12-22 04:58:12 +00:00

Improved docs, docker-compose and dockerfile

This commit is contained in:
J. Fernando Sánchez 2018-06-20 12:16:17 +02:00
parent bbe91e1924
commit 48ba936a7b
3 changed files with 74 additions and 25 deletions

View File

@ -1,10 +1 @@
from gsiupm/senpy:0.10.7-python2.7
RUN python -m nltk.downloader stopwords
RUN python -m nltk.downloader punkt
RUN python -m nltk.downloader maxent_treebank_pos_tagger
RUN python -m nltk.downloader wordnet
RUN python -m nltk.downloader omw
ADD . /senpy-plugins
from gsiupm/senpy:0.10.8-python2.7

View File

@ -1,29 +1,75 @@
# Senpy Plugins
# Installing
# Requirements
First, install senpy from source or through pip:
Some of these plugins require licensed files to run, such as lexicons or corpora.
You can **manually download these resources and add them to the `data` folder**.
pip install senpy
Each plugin has different requirements.
As of this writing, requirement installation is done manually for each plugin.
All requirements are specified in the .senpy file and, alternatively, in a requirements.txt file.
Most plugins will look for these resources on activation.
By default, we set the flag `--allow-fail` in senpy, so if a plugin fails to activate, the server will still run with the remaining plugins.
# Running
Run with:
## Using docker
git clone https://github.com/gsi-upm/senpy-plugins-community.git
git submodule update --init --remote --recursive
senpy -f senpy-plugins-community
# Loading new plugins to gitlab
To deploy all the plugins in this repository, run:
You should have two repos, one with data files and the main repo of the plugin.
First you have to push all the data files in the data repo and the code of the plugin in the main repo. Next, you have to "link" the two repos using submodule:
```
docker-compose up
```
A server should now be available at `http://localhost:5000`.
git submodule add ../data/<NAME OF YOUR PLUGIN> ./data
Alternatively, you can use docker manually with the version of senpy you wish:
```
docker run --rm -ti -p 5000:5000 -v $PWD:/senpy-plugins gsiupm/senpy:0.10.8-python2.7
```
Note that some versions are untested.
## Manually
First, install senpy from source or through pip:
```
pip install senpy
```
Now, you can try to run your plugins:
```
senpy -f .
```
Each plugin has different requirements.
Senpy will try its best to automatically install requirements (python libraries and NLTK resources) for each plugin.
Some cases may require manual installation of dependencies, or external packages.
# For developers / Contributors
## Licensed data
In our deployments, we keep all licensed data in a private submodule.
You will likely need to initialize this submodule if you're a contributor:
```
git submodule update --init --recursive
```
## Adding a plugin from a separate repository
To add a plugin that has been developed in its own repository, you can use git-subtree as so:
```
$mname=<your plugin name>
$murl=<URL to your repository>
git remote add $mname $murl
git subtree add --prefix=$mname $mname master
```
Make sure to also add
# LICENSE

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: '3'
services:
community:
build: .
image: "${IMAGEWTAG:-gsi-upm/senpy-community:dev}"
volumes:
- ".:/senpy-plugins/"
# - "./data:/data"
ports:
- '5000:5000'
command:
- "--allow-fail"