Commit 04779dbb authored by Tom Jorquera's avatar Tom Jorquera

Auto run the start script + allow several workers

The Dockerfile now automatically run the `start.sh` script on startup by
default.

The `$NB_WORKERS` env variable now allows to customize the number of workers
created.

`start.sh` now sleeps infinitely at the end of its execution (to avoid stopping
the container at the end of its execution).
parent bc46c88c
......@@ -68,4 +68,6 @@ RUN git clone https://github.com/kaldi-asr/kaldi && \
COPY start.sh stop.sh /opt/
RUN chmod +x /opt/start.sh && \
chmod +x /opt/stop.sh
chmod +x /opt/stop.sh
CMD /opt/start.sh
......@@ -36,7 +36,13 @@ if [ "$MASTER" == "localhost" ] ; then
python /opt/kaldi-gstreamer-server/kaldigstserver/master_server.py --port=$PORT 2>> /opt/master.log &
fi
#start worker and connect it to the master
export GST_PLUGIN_PATH=/opt/gst-kaldi-nnet2-online/src/:/opt/kaldi/src/gst-plugin/
python /opt/kaldi-gstreamer-server/kaldigstserver/worker.py -c $YAML -u ws://$MASTER:$PORT/worker/ws/speech 2>> /opt/worker.log &
NB_WORKERS=${NB_WORKERS:-1}
for i in $(seq 1 $NB_WORKERS)
do
#start worker and connect it to the master
python /opt/kaldi-gstreamer-server/kaldigstserver/worker.py -c $YAML -u ws://$MASTER:$PORT/worker/ws/speech 2>> /opt/worker-$i.log &
done
sleep infinity
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