Commit eaa2f698 authored by priit's avatar priit

Lausestaja Dockeri alge

parent 83bbe4a5
......@@ -30,6 +30,6 @@ var config = require('./wrapper_configs/global');
}
});*/
config.serverUrl = 'http://dev.bitweb.ee';
config.wrapper = config.availableWrappers.CONCAT;
config.serverUrl = process.env.SERVER_URL || 'http://dev.bitweb.ee';
config.wrapper = process.env.WRAPPER ? config.availableWrappers + process.env.WRAPPER : config.availableWrappers.CONCAT;
module.exports = config;
\ No newline at end of file
#!/bin/bash
if [ ! -f /config/config.js ]; then
cp -R -u -p /src/config_dist.js /config/config.js
fi
if [ ! -f /src/config.js ]; then
ln -s /config/config.js /src/config.js
fi
forever /src/app.js
\ No newline at end of file
#!/bin/bash
cd /src
git pull
npm install
forever stopall
forever /src/app.js
forever list
\ No newline at end of file
......@@ -19,8 +19,8 @@ config.integration = [
];
config.fs = {
storagePath: "/wrapper/files",
tmpPath: "/wrapper/tmp"
storagePath: "/files",
tmpPath: "/tmp"
};
config.paramUsageTypes = {
......@@ -53,7 +53,7 @@ config.log4js = {
"level": "ERROR",
"appender": {
type: 'file',
filename: __dirname + '/../wrapper.log',
filename: '/logs/wrapper.log',
layout: {
type: 'pattern',
pattern: "[%d] %[[%x{port}-%x{pid}][%5.5p]%] %c - %m",
......@@ -81,31 +81,31 @@ config.wrapper = {
config.availableCommands = {
TOKENIZER: {
commandTemplate: 'python /var/www/bitweb.ee/keeleliin.bitweb.ee/wrapper/utils/picoutils/tokenizer.py -i [data] -o [output]'
commandTemplate: 'python /wrapper/utils/picoutils/tokenizer.py -i [data] -o [output]'
},
MORFANALYSAATOR: {
commandTemplate: '/var/www/bitweb.ee/keeleliin.bitweb.ee/wrapper/utils/./morfanalyzer.sh [data]'
commandTemplate: '/wrapper/utils/./morfanalyzer.sh [data]'
},
LAUSESTAJA: {
commandTemplate: '/var/www/bitweb.ee/keeleliin.bitweb.ee/wrapper/utils/./lausestaja.sh [data]'
commandTemplate: '/wrapper/utils/./lausestaja.sh [data]'
},
OSALAUSESTAJA: {
commandTemplate: '/var/www/bitweb.ee/keeleliin.bitweb.ee/wrapper/utils/./osalausestaja.sh [data]'
commandTemplate: '/wrapper/utils/./osalausestaja.sh [data]'
},
MORFYHESTAJA: {
commandTemplate: '/var/www/bitweb.ee/keeleliin.bitweb.ee/wrapper/utils/./morfyhestaja.sh [data]'
commandTemplate: '/wrapper/utils/./morfyhestaja.sh [data]'
},
PIND_SYN: {
commandTemplate: '/var/www/bitweb.ee/keeleliin.bitweb.ee/wrapper/utils/./pindsyn.sh [data]'
commandTemplate: '/wrapper/utils/./pindsyn.sh [data]'
},
S6LT_SYN: {
commandTemplate: '/var/www/bitweb.ee/keeleliin.bitweb.ee/wrapper/utils/./s6ltsyn.sh [data]'
commandTemplate: '/wrapper/utils/./s6ltsyn.sh [data]'
},
CONCAT: {
commandTemplate: 'cat [data]'
},
MORPH_TAGGER: {
commandTemplate: 'python /var/www/bitweb.ee/keeleliin.bitweb.ee/wrapper/utils/picoutils/morph_tagger.py -i [data] -o [output]'
commandTemplate: 'python /wrapper/utils/picoutils/morph_tagger.py -i [data] -o [output]'
}
};
......@@ -154,7 +154,7 @@ config.availableWrappers = {
title: 'Lausestaja',
description: '',
id: 'lau',
port: 3001,
port: process.env.SERVER_PORT || 3001,
class: 'simpleLocalCommand',
command: config.availableCommands.LAUSESTAJA,
requestConf: {
......@@ -182,7 +182,7 @@ config.availableWrappers = {
title: 'Morfoloogiline analüüs',
description: '',
id: 'moa',
port: 3002,
port: process.env.SERVER_PORT || 3002,
class: 'simpleLocalCommand',
command: config.availableCommands.MORFANALYSAATOR,
requestConf: {
......@@ -210,7 +210,7 @@ config.availableWrappers = {
title: 'Osalausestaja',
description: '',
id: 'osl',
port: 3003,
port: process.env.SERVER_PORT || 3003,
class: 'simpleLocalCommand',
command: config.availableCommands.OSALAUSESTAJA,
requestConf: {
......@@ -238,7 +238,7 @@ config.availableWrappers = {
title: 'Morfoloogiline ühestamine (kitsenduste grammatika)',
description: '',
id: 'moy',
port: 3004,
port: process.env.SERVER_PORT || 3004,
class: 'simpleLocalCommand',
command: config.availableCommands.MORFYHESTAJA,
requestConf: {
......@@ -266,7 +266,7 @@ config.availableWrappers = {
title: 'Pindsüntaktiline analüüs',
description: '',
id: 'pia',
port: 3005,
port: process.env.SERVER_PORT || 3005,
class: 'simpleLocalCommand',
command: config.availableCommands.PIND_SYN,
requestConf: {
......@@ -294,7 +294,7 @@ config.availableWrappers = {
title: 'Sõltuvussüntaktiline analüüs (ja järeltöötlus)',
description: '',
id: 's6a',
port: 3006,
port: process.env.SERVER_PORT || 3006,
class: 'simpleLocalCommand',
command: config.availableCommands.S6LT_SYN,
requestConf: {
......@@ -323,7 +323,7 @@ config.availableWrappers = {
title: 'Arhiivi lahtipakkija',
description: '',
id: 'uzip',
port: 3007,
port: process.env.SERVER_PORT || 3007,
class: 'archiveExtractor',
requestConf: {
requestBodyParamsMappings: {
......@@ -350,7 +350,7 @@ config.availableWrappers = {
title: 'Sõnestaja pipe',
description: '',
id: 'tok',
port: 3008,
port: process.env.SERVER_PORT || 3008,
class: 'inputOutputLocalCommand',
command: config.availableCommands.TOKENIZER,
requestConf: {
......@@ -377,7 +377,7 @@ config.availableWrappers = {
CONCAT: {
title: 'Lihtne konkateneerija',
id: 'concat',
port: 3009,
port: process.env.SERVER_PORT || 3009,
class: 'simpleLocalCommand',
command: config.availableCommands.CONCAT,
requestConf: {
......@@ -404,7 +404,7 @@ config.availableWrappers = {
MORPH_TAGGER: {
title: 'Morfoloogiline ühestaja pipe',
id: 'tag',
port: 3010,
port: process.env.SERVER_PORT || 3010,
class: 'inputOutputLocalCommand',
command: config.availableCommands.MORPH_TAGGER,
requestConf: {
......
FROM ubuntu:14.04
MAINTAINER priit@bitweb.ee
ENV TERM xterm
ENV WRAPPER=LAUSESTAJA
ENV SERVER_URL="http://dev.bitweb.ee"
ENV SERVER_PORT=3001
RUN apt-get update && \
apt-get -y install curl && \
curl -sL https://deb.nodesource.com/setup | sudo bash - && \
apt-get -y install python build-essential nodejs && \
apt-get -y install git
RUN apt-get install unzip
RUN npm install -g forever
RUN mkdir -p /tmp && mkdir -p /files && mkdir -p /logs && mkdir -p /config
RUN mkdir -p /src
RUN cd /src && git clone 'https://github.com/BitWeb/keeleliin-server.git' . && npm install && echo "Run is Done 2.2"
RUN mkdir /utils
COPY ./utils /utils
RUN unzip /utils/CGParser.zip -d /utils/
RUN unzip /utils/morfyhestaja.zip -d /utils/
RUN chmod 777 -Rf /utils/*
#Expose port
EXPOSE 3000
VOLUME ["/tmp","/keeleliin_files","/keeleliin_logs", "/config"]
CMD /./src/docker_start.sh
\ No newline at end of file
#!/bin/sh
BASEDIR=$(dirname $0)
RADA=$BASEDIR/morfyhestaja/konverter
RADAMRF=$BASEDIR/morfyhestaja/vabamorf/apps/cmdline/project/unix
RADADCT=$BASEDIR/morfyhestaja/vabamorf/dct
cat $1 | $RADA/rlausestaja.pl
FROM ubuntu:14.04
MAINTAINER priit@bitweb.ee
RUN apt-get update && \
apt-get -y install curl && \
curl -sL https://deb.nodesource.com/setup | sudo bash - && \
apt-get -y install python build-essential nodejs && \
apt-get -y install git
RUN npm install -g forever
RUN mkdir -p /src && mkdir -p /tmp && mkdir -p /files && mkdir -p /logs && mkdir -p /config
RUN cd /src && git clone 'https://github.com/BitWeb/keeleliin-wrapper-service.git' . && npm install && echo "RunisDon"
// CGParser
// vabamorf
#Expose port
EXPOSE 3000
VOLUME ["/tmp","/files","/logs", "/config"]
CMD /./src/docker_start.sh
\ No newline at end of file
#!/bin/sh
BASEDIR=$(dirname $0)
RADA=$BASEDIR/konverter
RADAMRF=$BASEDIR/vabamorf/apps/cmdline/project/unix
RADADCT=$BASEDIR/vabamorf/dct
cat $1 | $RADA/wr2json.pl | $RADAMRF/etana analyze -lex $RADADCT/et.dct -guess | $RADA/json2mrf.pl
#!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR
cd CGParser
RADA=./
RADAMRF=../vabamorf/apps/cmdline/project/unix
RADADCT=../vabamorf/dct
#Lausestaja
#cat $1 | $RADA/rlausestaja.pl > TMPFILE1
#Morfoloogiline analüüs
#cat TMPFILE1 | $RADA/wr2json.pl | $RADAMRF/etana analyze -lex $RADADCT/et.dct -guess | $RADA/json2mrf.pl > TMPFILE2
#Osalausestamine
#cat TMPFILE2 | $RADA/rtolkija.pl | $RADA/tpron.pl | $RADA/tcopyremover.pl |awk -f $RADA/TTRELLID.AWK | $RADA/tagger09 $RADA/abileksikon06utf.lx stdin stdout | $RADA/tcopyremover.pl | $RADA/tkms2cg3.pl | vislcg3 -o -g $RADA/clo.rul > TMPFILE3
# Morfoloogiline ühestamine (kitsenduste grammatika)
cat $1 | vislcg3 -o -g $RADA/morfyhe.rul
# Pindsüntaktiline analüüs
#cat $1 | vislcg3 -o -g $RADA/PhVerbs.rul | vislcg3 -o -g $RADA/pindsyn.rul
# Sõltuvussüntaktiline analüüs (ja järeltöötlus)
#cat $1 |vislcg3 -o -g $RADA/strukt.rul | $RADA/1reaks.pl | $RADA/inforemover.pl
#!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR
cd CGParser
RADA=./
cat $1 | $RADA/rtolkija.pl | $RADA/tpron.pl | $RADA/tcopyremover.pl |awk -f $RADA/TTRELLID.AWK | $RADA/tagger09 $RADA/abileksikon06utf.lx stdin stdout | $RADA/tcopyremover.pl | $RADA/tkms2cg3.pl | vislcg3 -o -g $RADA/clo.rul
#!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR
cd CGParser
RADA=./
RADAMRF=../vabamorf/apps/cmdline/project/unix
RADADCT=../vabamorf/dct
#Lausestaja
#cat $1 | $RADA/rlausestaja.pl > TMPFILE1
#Morfoloogiline analüüs
#cat TMPFILE1 | $RADA/wr2json.pl | $RADAMRF/etana analyze -lex $RADADCT/et.dct -guess | $RADA/json2mrf.pl > TMPFILE2
#Osalausestamine
#cat TMPFILE2 | $RADA/rtolkija.pl | $RADA/tpron.pl | $RADA/tcopyremover.pl |awk -f $RADA/TTRELLID.AWK | $RADA/tagger09 $RADA/abileksikon06utf.lx stdin stdout | $RADA/tcopyremover.pl | $RADA/tkms2cg3.pl | vislcg3 -o -g $RADA/clo.rul > TMPFILE3
# Morfoloogiline ühestamine (kitsenduste grammatika)
#cat $1 | vislcg3 -o -g $RADA/morfyhe.rul
# Pindsüntaktiline analüüs
cat $1 | vislcg3 -o -g $RADA/PhVerbs.rul | vislcg3 -o -g $RADA/pindsyn.rul
# Sõltuvussüntaktiline analüüs (ja järeltöötlus)
#cat $1 |vislcg3 -o -g $RADA/strukt.rul | $RADA/1reaks.pl | $RADA/inforemover.pl
#!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR
cd CGParser
RADA=./
RADAMRF=../vabamorf/apps/cmdline/project/unix
RADADCT=../vabamorf/dct
#Lausestaja
#cat $1 | $RADA/rlausestaja.pl > TMPFILE1
#Morfoloogiline analüüs
#cat TMPFILE1 | $RADA/wr2json.pl | $RADAMRF/etana analyze -lex $RADADCT/et.dct -guess | $RADA/json2mrf.pl > TMPFILE2
#Osalausestamine
#cat TMPFILE2 | $RADA/rtolkija.pl | $RADA/tpron.pl | $RADA/tcopyremover.pl |awk -f $RADA/TTRELLID.AWK | $RADA/tagger09 $RADA/abileksikon06utf.lx stdin stdout | $RADA/tcopyremover.pl | $RADA/tkms2cg3.pl | vislcg3 -o -g $RADA/clo.rul > TMPFILE3
# Morfoloogiline ühestamine (kitsenduste grammatika)
#cat $1 | vislcg3 -o -g $RADA/morfyhe.rul
# Pindsüntaktiline analüüs
#cat $1 | vislcg3 -o -g $RADA/PhVerbs.rul | vislcg3 -o -g $RADA/pindsyn.rul
# Sõltuvussüntaktiline analüüs (ja järeltöötlus)
cat $1 |vislcg3 -o -g $RADA/strukt.rul | $RADA/1reaks.pl | $RADA/inforemover.pl
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment