forked from aymara/lima
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-ubuntu16.04
95 lines (77 loc) · 6.29 KB
/
Dockerfile-ubuntu16.04
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
FROM ubuntu:16.04
RUN apt-get clean && apt-get update && apt-get install -y locales
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN locale
ARG BINTRAYKEY
ARG SEMAPHORE_BUILD_NUMBER
ARG LIMA_DISABLE_FSW_TESTING
ARG LIMA_DISABLE_CPACK_DEBIAN_PACKAGE_SHLIBDEPS
ARG NLTK_PTB_DP_FILE
# Setup
RUN rm -rf /var/lib/apt/lists/*
RUN apt-get update -y -qq
RUN apt-get install -y apt-utils software-properties-common python-software-properties python3-software-properties -qq
#RUN add-apt-repository ppa:kubuntu-ppa/backports
#RUN apt-get update -y -qq
#RUN apt-get dist-upgrade -y -qq
RUN apt-get install -y git gcc g++ autotools-dev dh-autoreconf cmake cmake-data curl python-nltk gawk wget python3 -qq
RUN apt-get update -y -qq
RUN apt-get install -y qt5-default qtbase5-dev-tools libqt5xmlpatterns5-dev libqt5qml5 qtdeclarative5-dev libenchant-dev -qq
RUN apt-get update -y -qq
RUN apt-get install -y libboost-all-dev -qq
#RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get install -y nodejs npm
RUN npm install -g json
RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN sed -ie "s|DEFAULT_URL = 'http://nltk.googlecode.com/svn/trunk/nltk_data/index.xml'|DEFAULT_URL = 'http://nltk.github.com/nltk_data/'|" /usr/lib/python2.7/*/nltk/downloader.py
RUN python -m nltk.downloader -d nltk_data dependency_treebank
RUN cat nltk_data/corpora/dependency_treebank/wsj_*.dp | grep -v "^$" > nltk_data/corpora/dependency_treebank/nltk-ptb.dp
RUN wget http://osmot.cs.cornell.edu/svm_light/current/svm_light.tar.gz
WORKDIR /svm_light
RUN tar xzf ../svm_light.tar.gz
RUN make
RUN cp svm_classify svm_learn /usr/bin
WORKDIR /
RUN wget https://dl.bintray.com/kleag/SVMTool-1.3.1/SVMTool-1.3.1.tgz
RUN tar xzf SVMTool-1.3.1.tgz
WORKDIR /SVMTool-1.3.1
RUN perl Makefile.PL && make && make install
WORKDIR /
RUN wget https://bintray.com/artifact/download/kleag/ubuntu-16.04/$(curl https://api.bintray.com/packages/kleag/ubuntu-16.04/qhttpserver/versions/$(curl https://api.bintray.com/packages/kleag/ubuntu-16.04/qhttpserver | json -a latest_version)/files | json 0.path)
RUN dpkg -i $(curl https://api.bintray.com/packages/kleag/ubuntu-16.04/qhttpserver/versions/$(curl https://api.bintray.com/packages/kleag/ubuntu-16.04/qhttpserver | json -a latest_version)/files | json 0.name)
RUN wget https://bintray.com/artifact/download/kleag/ubuntu-16.04/$(echo $(curl https://api.bintray.com/packages/kleag/ubuntu-16.04/svmtool-cpp/versions/$(curl https://api.bintray.com/packages/kleag/ubuntu-16.04/svmtool-cpp | json -a latest_version)/files | json 0.path) | sed -e 's/\+/%2B/g')
RUN dpkg -i $(curl https://api.bintray.com/packages/kleag/ubuntu-16.04/svmtool-cpp/versions/$(curl https://api.bintray.com/packages/kleag/ubuntu-16.04/svmtool-cpp | json -a latest_version)/files | json 0.name)
RUN mkdir -p /src/
RUN git clone https://github.com/aymara/lima /src/lima
WORKDIR /src/lima
ARG CACHEBUST=1
RUN git pull
RUN echo "$(git show -s --format=%ct HEAD)-$(git rev-parse --short HEAD)" > release
RUN mkdir -p /src/lima/build
WORKDIR /src/lima/build
ENV PERL5LIB /SVMTool-1.3.1/lib:$PERL5LIB
ENV PATH /SVMTool-1.3.1/bin:/usr/share/apps/lima/scripts:/usr/bin:$PATH
ENV NLTK_PTB_DP_FILE /nltk_data/corpora/dependency_treebank/nltk-ptb.dp
ENV LIMA_DISABLE_FSW_TESTING true
ENV LIMA_DISABLE_CPACK_DEBIAN_PACKAGE_SHLIBDEPS true
ENV LIMA_DIST /usr
ENV LIMA_CONF /usr/share/config/lima
ENV LIMA_RESOURCES /usr/share/apps/lima/resources
# Build
RUN cmake -DLIMA_RESOURCES:STRING=build -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:STRING=Release -DLIMA_VERSION_RELEASE:STRING="$(cat /src/lima/release)" -DSHORTEN_POR_CORPUS_FOR_SVMLEARN:BOOL=ON ..
RUN make -j2
WORKDIR /usr/share/apps/lima/tests
RUN tva --language=eng test-eng.*.xml 2>&1 | tee tva-eng.log
RUN tva --language=fre test-fre.default.xml test-fre.disambiguated.xml test-fre.hyphen.xml test-fre.idiom.xml test-fre.sa.xml test-fre.se.xml test-fre.simpleword.xml test-fre.tokenizer.xml 2>&1 | tee tva-fre.log
RUN curl -ukleag:$BINTRAYKEY -T /src/lima/build/lima_common/src/lima_common-build/limacommon-2.1.$(cat /src/lima/release)-runtime.deb https://api.bintray.com/content/kleag/ubuntu-16.04/lima/$SEMAPHORE_BUILD_NUMBER/$SEMAPHORE_BUILD_NUMBER/limacommon-2.1.$(cat /src/lima/release)-runtime.deb
RUN curl -ukleag:$BINTRAYKEY -T /src/lima/build/lima_common/src/lima_common-build/limacommon-2.1.$(cat /src/lima/release)-devel.deb https://api.bintray.com/content/kleag/ubuntu-16.04/lima/$SEMAPHORE_BUILD_NUMBER/$SEMAPHORE_BUILD_NUMBER/limacommon-2.1.$(cat /src/lima/release)-devel.deb
RUN curl -ukleag:$BINTRAYKEY -T /src/lima/build/lima_linguisticprocessing/src/lima_linguisticprocessing-build/limalinguisticprocessing-2.1.$(cat /src/lima/release)-runtime.deb https://api.bintray.com/content/kleag/ubuntu-16.04/lima/$SEMAPHORE_BUILD_NUMBER/$SEMAPHORE_BUILD_NUMBER/limalinguisticprocessing-2.1.$(cat /src/lima/release)-runtime.deb
RUN curl -ukleag:$BINTRAYKEY -T /src/lima/build/lima_linguisticprocessing/src/lima_linguisticprocessing-build/limalinguisticprocessing-2.1.$(cat /src/lima/release)-devel.deb https://api.bintray.com/content/kleag/ubuntu-16.04/lima/$SEMAPHORE_BUILD_NUMBER/$SEMAPHORE_BUILD_NUMBER/limalinguisticprocessing-2.1.$(cat /src/lima/release)-devel.deb
RUN curl -ukleag:$BINTRAYKEY -T/src/lima/build/lima_linguisticdata/src/lima_linguisticdata-build/limalinguisticdata-2.1.$(cat /src/lima/release)-common.deb https://api.bintray.com/content/kleag/ubuntu-16.04/lima/$SEMAPHORE_BUILD_NUMBER/$SEMAPHORE_BUILD_NUMBER/limalinguisticdata-2.1.$(cat /src/lima/release)-common.deb
RUN curl -ukleag:$BINTRAYKEY -T/src/lima/build/lima_linguisticdata/src/lima_linguisticdata-build/limalinguisticdata-2.1.$(cat /src/lima/release)-eng.deb https://api.bintray.com/content/kleag/ubuntu-16.04/lima/$SEMAPHORE_BUILD_NUMBER/$SEMAPHORE_BUILD_NUMBER/limalinguisticdata-2.1.$(cat /src/lima/release)-eng.deb
RUN curl -ukleag:$BINTRAYKEY -T/src/lima/build/lima_linguisticdata/src/lima_linguisticdata-build/limalinguisticdata-2.1.$(cat /src/lima/release)-fre.deb https://api.bintray.com/content/kleag/ubuntu-16.04/lima/$SEMAPHORE_BUILD_NUMBER/$SEMAPHORE_BUILD_NUMBER/limalinguisticdata-2.1.$(cat /src/lima/release)-fre.deb
RUN curl -XPOST -ukleag:$BINTRAYKEY https://api.bintray.com/content/kleag/ubuntu-16.04/lima/$SEMAPHORE_BUILD_NUMBER/publish
RUN curl -XGET https://bintray.com/kleag/ubuntu-16.04/lima/$SEMAPHORE_BUILD_NUMBER