Skip to content

Commit b3534ff

Browse files
committed
Fix Dockerfile of practical example
1 parent 5e63a33 commit b3534ff

File tree

4 files changed

+32
-126
lines changed

4 files changed

+32
-126
lines changed
Lines changed: 15 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,21 @@
1-
FROM debian:8
1+
FROM jcsilva/docker-kaldi-gstreamer-server
22
MAINTAINER Eduardo Silva <[email protected]>
33

4-
RUN apt-get update && apt-get install -y \
5-
autoconf \
6-
automake \
7-
bzip2 \
8-
g++ \
9-
git \
10-
gstreamer1.0-plugins-good \
11-
gstreamer1.0-tools \
12-
gstreamer1.0-pulseaudio \
13-
gstreamer1.0-plugins-bad \
14-
gstreamer1.0-plugins-base \
15-
gstreamer1.0-plugins-ugly \
16-
libatlas3-base \
17-
libgstreamer1.0-dev \
18-
libtool-bin \
19-
make \
20-
python2.7 \
21-
python-pip \
22-
python-yaml \
23-
python-simplejson \
24-
python-gi \
25-
subversion \
26-
wget \
27-
zlib1g-dev && \
28-
apt-get clean autoclean && \
29-
apt-get autoremove -y && \
30-
pip install ws4py==0.3.2 && \
31-
pip install tornado && \
32-
ln -s /usr/bin/python2.7 /usr/bin/python ; ln -s -f bash /bin/sh
33-
34-
RUN cd /opt && wget http://www.digip.org/jansson/releases/jansson-2.7.tar.bz2 && \
35-
bunzip2 -c jansson-2.7.tar.bz2 | tar xf - && \
36-
cd jansson-2.7 && \
37-
./configure && make && make check && make install && \
38-
echo "/usr/local/lib" >> /etc/ld.so.conf.d/jansson.conf && ldconfig && \
39-
rm /opt/jansson-2.7.tar.bz2 && rm -rf /opt/jansson-2.7
40-
41-
RUN cd /opt && \
42-
git clone https://github.com/kaldi-asr/kaldi && \
43-
cd /opt/kaldi/tools && \
44-
make && \
45-
./install_portaudio.sh && \
46-
cd /opt/kaldi/src && ./configure --shared && \
47-
sed -i '/-g # -O0 -DKALDI_PARANOID/c\-O3 -DNDEBUG' kaldi.mk && \
48-
make depend && make && \
49-
cd /opt/kaldi/src/online && make depend && make && \
50-
cd /opt/kaldi/src/gst-plugin && make depend && make && \
51-
cd /opt && \
52-
git clone https://github.com/alumae/gst-kaldi-nnet2-online.git && \
53-
cd /opt/gst-kaldi-nnet2-online/src && \
54-
sed -i '/KALDI_ROOT?=\/home\/tanel\/tools\/kaldi-trunk/c\KALDI_ROOT?=\/opt\/kaldi' Makefile && \
55-
make depend && make && \
56-
rm -rf /opt/gst-kaldi-nnet2-online/.git/ && \
57-
find /opt/gst-kaldi-nnet2-online/src/ -type f -not -name '*.so' -delete && \
58-
rm -rf /opt/kaldi/.git && \
59-
rm -rf /opt/kaldi/egs/ /opt/kaldi/windows/ /opt/kaldi/misc/ && \
60-
find /opt/kaldi/src/ -type f -not -name '*.so' -delete && \
61-
find /opt/kaldi/tools/ -type f \( -not -name '*.so' -and -not -name '*.so*' \) -delete && \
62-
cd /opt && git clone https://github.com/alumae/kaldi-gstreamer-server.git && \
63-
rm -rf /opt/kaldi-gstreamer-server/.git/ && \
64-
rm -rf /opt/kaldi-gstreamer-server/test/
65-
66-
COPY start.sh stop.sh /opt/
4+
# This is the practical example part
675

686
RUN mkdir -p /opt/models && cd /opt/models && \
69-
wget https://phon.ioc.ee/~tanela/tedlium_nnet_ms_sp_online.tgz && \
70-
tar -zxvf tedlium_nnet_ms_sp_online.tgz && \
71-
wget https://raw.githubusercontent.com/alumae/kaldi-gstreamer-server/master/sample_english_nnet2.yaml -P /opt/models && \
72-
find /opt/models/ -type f | xargs sed -i 's:test:/opt:g' && \
73-
sed -i 's:full-post-processor:#full-post-processor:g' /opt/models/sample_english_nnet2.yaml
74-
75-
76-
77-
RUN chmod +x /opt/start.sh && \
78-
chmod +x /opt/stop.sh
79-
80-
CMD /opt/start.sh -y /opt/models/sample_english_nnet2.yaml
7+
wget https://phon.ioc.ee/~tanela/tedlium_nnet_ms_sp_online.tgz && \
8+
tar -zxvf tedlium_nnet_ms_sp_online.tgz && \
9+
wget https://raw.githubusercontent.com/alumae/kaldi-gstreamer-server/master/sample_english_nnet2.yaml -P /opt/models && \
10+
find /opt/models/ -type f | xargs sed -i 's:test:/opt:g' && \
11+
sed -i 's:full-post-processor:#full-post-processor:g' /opt/models/sample_english_nnet2.yaml
12+
13+
RUN apt-get update && \
14+
apt-get install -y supervisor && \
15+
apt-get clean autoclean && \
16+
apt-get autoremove -y && \
17+
rm -rf /var/lib/apt/lists/*
8118

19+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
8220

21+
CMD ["/usr/bin/supervisord"]

examples/practical-example/start.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/practical-example/stop.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[supervisord]
2+
nodaemon=true
3+
4+
[program:master]
5+
command=python /opt/kaldi-gstreamer-server/kaldigstserver/master_server.py --port=80
6+
numprocs=1
7+
autostart=true
8+
autorestart=true
9+
stderr_logfile=/opt/master.log
10+
11+
12+
[program:worker]
13+
command=python /opt/kaldi-gstreamer-server/kaldigstserver/worker.py -c /opt/models/sample_english_nnet2.yaml -u ws://localhost:80/worker/ws/speech
14+
numprocs=1
15+
autostart=true
16+
autorestart=true
17+
stderr_logfile=/opt/worker.log

0 commit comments

Comments
 (0)