forked from ufal/treex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
128 lines (116 loc) · 3.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
FROM perl:5.20
# graphviz ... AI::DecisionTree dependency
# default-jre ... MSTperl parser is in Java
RUN apt-get update && apt-get install -y \
graphviz \
default-jre \
libboost-all-dev \
cmake
# Modules, that are needed to run treex -h (and the Hello world
RUN cpanm \
YAML/Tiny.pm \
XML::LibXML \
Moose \
MooseX \
MooseX::NonMoose \
MooseX::Getopt \
MooseX::Role::Parameterized \
MooseX::Role::AttributeOverride \
MooseX::SemiAffordanceAccessor \
Readonly \
File::HomeDir \
File::ShareDir \
File::Slurp \
File::chdir \
YAML \
LWP::Simple \
String::Util \
PerlIO::gzip \
Class::Std
# The PerlIO:Util has bug in its tests
RUN cpanm -n PerlIO::Util
RUN cpanm PerlIO::via::gzip
# Other, "optional" Treex dependencies
RUN cpanm \
autodie \
threads \
threads::shared \
forks \
namespace::autoclean \
Module::Reload \
IO::Interactive \
App::whichpm \
Treex::PML \
Cache::Memcached \
List::Pairwise \
Algorithm::NaiveBayes \
AI::DecisionTree \
Algorithm \
Algorithm::DecisionTree \
AnyEvent \
AnyEvent::Fork \
Bash::Completion::Utils \
Carp \
Carp::Always \
Carp::Assert \
Clone \
Compress::Zlib \
DBI \
DateTime \
EV \
Email::Find \
Encode::Arabic \
Frontier::Client \
Graph \
Graph::ChuLiuEdmonds \
Graph::MaxFlow \
HTML::FormatText \
JSON \
Lingua::EN::Tagger \
Modern::Perl \
MooseX::ClassAttribute \
MooseX::FollowPBP \
MooseX::Types::Moose \
PML \
POE \
String::Diff \
Test::Files \
Test::Output \
Text::Brew \
Text::JaroWinkler \
Text::Table \
Text::Unidecode \
Tk \
Tree::Trie \
URL::Encode \
XML::Simple
# One of the subtests failed during image build
RUN cpanm -n AI::MaxEntropy
# Create root dir for treex checkout, share and tmp
RUN mkdir ~/tectomt && cd ~/tectomt && git clone https://github.com/ufal/treex.git
ENV TMT_ROOT=/root/tectomt
ENV TREEX_ROOT="${TMT_ROOT}/treex"
ENV PATH="${TREEX_ROOT}/bin:$PATH"
ENV PERL5LIB="${TREEX_ROOT}/lib:$PERL5LIB"
ENV PERLLIB=$PERL5LIB
RUN mkdir -p /root/.treex/share/installed_tools
RUN ln -s /root/.treex/share $TMT_ROOT/share
RUN ln -s /tmp $TMT_ROOT/tmp
# Some UFAL modules used by treex
RUN cpanm Text::Iconv
RUN cpanm Ufal::NameTag
RUN cpanm Ufal::MorphoDiTa
RUN cpanm Lingua::Interset
RUN cpanm URI::Find
RUN cpanm Cache::LRU
# install Morce tagger
RUN svn --username public --password public export https://svn.ms.mff.cuni.cz/svn/tectomt_devel/trunk/libs/packaged /tmp/packaged
RUN cd /tmp/packaged/Morce-English && perl Build.PL && ./Build && ./Build install --prefix /usr/local/
# download models
RUN mkdir -p /root/.treex/share/data/models/morce/en
RUN cd tectomt/share/data/models/morce/en && wget http://ufallab.ms.mff.cuni.cz/tectomt/share/data/models/morce/en/morce.alph http://ufallab.ms.mff.cuni.cz/tectomt/share/data/models/morce/en/morce.dct http://ufallab.ms.mff.cuni.cz/tectomt/share/data/models/morce/en/morce.ft http://ufallab.ms.mff.cuni.cz/tectomt/share/data/models/morce/en/morce.ftrs http://ufallab.ms.mff.cuni.cz/tectomt/share/data/models/morce/en/tags_for_form-from_wsj.dat
# install NADA
RUN svn --username public --password public export https://svn.ms.mff.cuni.cz/svn/tectomt_devel/trunk/install/tool_installation /tmp/tool_installation
RUN cd /tmp/tool_installation/NADA && perl Makefile.PL && make && make install
# simple Hello world test
RUN bash -c "echo 'Hello world' | treex -Len Read::Sentences Write::Sentences"