stanford-corenlp: Add a playbook that installs the startup script. Add that role to the core-nlp playbook.

This commit is contained in:
Andrea Dell'Amico 2018-02-13 20:14:03 +01:00
parent 2f2a58dcce
commit b8cfeef09a
4 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,23 @@
---
# https://stanfordnlp.github.io/CoreNLP/
stanford_corenlp_version: latest
stanford_corenlp_name: stanford-corenlp
stanford_corenlp_extension: war
stanford_corenlp_file: '{{ stanford_corenlp_name }}-{{ stanford_corenlp_version }}.{{ stanford_corenlp_extension }}'
stanford_corenlp_group_id: edu.stanford.nlp
stanford_corenlp_languages:
- arabic
- chinese
- english
- english_kbp
- french
- german
- spanish
stanford_corenlp_user: corenlp
stanford_corenlp_base_dir: /opt/corenlp
stanford_corenlp_dist_dir: '{{ stanford_corenlp_base_dir }}/stanford-corenlp'
stanford_corenlp_log_dir: '{{ stanford_corenlp_base_dir }}/logs'
stanford_corenlp_cmd: 'java -cp "*" -mx4g edu.stanford.nlp.pipeline.StanfordCoreNLPServer -props StanfordCoreNLP-english.properties -port 9000 -timeout 60000'
tint_service_cmd: './tint-server.sh -p 9001'

View File

@ -0,0 +1,18 @@
---
- block:
- name: Create the CoreNLP logs directory
file: dest={{ stanford_corenlp_log_dir }} state=directory owner={{ stanford_corenlp_user }}
- name: Install the CoreNLP startup script
template: src=stanford-corenlp.upstart.j2 dest=/etc/init/stanford-corenlp.conf owner=root group=root mode=0644
- name: Ensure that CoreNLP is enabled and running
service: name=stanford-corenlp state=started enabled=yes
- name: Install the tint service startup script
template: src=tint.upstart.j2 dest=/etc/init/tint.conf owner=root group=root mode=0644
- name: Ensure that the tint service is enabled and running
service: name=tint state=started enabled=yes
tags: [ 'corenlp', 'stanford_corenlp' ]

View File

@ -0,0 +1,12 @@
description "Stanford CoreNLP"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [016]
respawn
respawn limit 10 5
setuid {{ stanford_corenlp_user }}
setgid {{ stanford_corenlp_user }}
script
exec cd {{ stanford_corenlp_dist_dir }} {{ stanford_corenlp_cmd }} > {{ stanford_corenlp_log_dir }}/corenlp.log 2>&1
end script

View File

@ -0,0 +1,12 @@
description "TINT service"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [016]
respawn
respawn limit 10 5
setuid {{ stanford_corenlp_user }}
setgid {{ stanford_corenlp_user }}
script
exec cd {{ stanford_corenlp_dist_dir }}/tint {{ tint_service_cmd }} > {{ stanford_corenlp_log_dir }}/tint.log 2>&1
end script