DeepQA
DeepQA copied to clipboard
Can't deploy using docker compose
I've been following the instructions here (https://github.com/Conchylicultor/DeepQA/blob/master/docker/README.md), but when I run DEEPQA_WORKDIR=<base_dir> docker-compose -f deploy.yml up
with my base_dir, it gives me this error although the path is valid.
web_1 | Training samples not found. Creating dataset...
web_1 | Constructing full dataset...
web_1 | Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f74d2a1c0d0>
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.5/site-packages/django/utils/autoreload.py", line 227, in wrapper
web_1 | fn(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
web_1 | autoreload.raise_last_exception()
web_1 | File "/usr/local/lib/python3.5/site-packages/django/utils/autoreload.py", line 250, in raise_last_exception
web_1 | six.reraise(*_exception)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
web_1 | raise value.with_traceback(tb)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/utils/autoreload.py", line 227, in wrapper
web_1 | fn(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
web_1 | apps.populate(settings.INSTALLED_APPS)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/apps/registry.py", line 116, in populate
web_1 | app_config.ready()
web_1 | File "/home/ibrahimsharaf/workspace/DeepQA/chatbot_website/chatbot_interface/chatbotmanager.py", line 31, in ready
web_1 | ChatbotManager.initBot()
web_1 | File "/home/ibrahimsharaf/workspace/DeepQA/chatbot_website/chatbot_interface/chatbotmanager.py", line 41, in initBot
web_1 | ChatbotManager.bot.main(['--modelTag', 'server', '--test', 'daemon', '--rootDir', chatbotPath])
web_1 | File "/home/ibrahimsharaf/workspace/DeepQA/chatbot/chatbot.py", line 158, in main
web_1 | self.textData = TextData(self.args)
web_1 | File "/home/ibrahimsharaf/workspace/DeepQA/chatbot/textdata.py", line 97, in __init__
web_1 | self.loadCorpus()
web_1 | File "/home/ibrahimsharaf/workspace/DeepQA/chatbot/textdata.py", line 260, in loadCorpus
web_1 | corpusData = TextData.availableCorpus[self.args.corpus](self.corpusDir + optional)
web_1 | File "/home/ibrahimsharaf/workspace/DeepQA/chatbot/corpus/cornelldata.py", line 43, in __init__
web_1 | self.lines = self.loadLines(os.path.join(dirName, "movie_lines.txt"), MOVIE_LINES_FIELDS)
web_1 | File "/home/ibrahimsharaf/workspace/DeepQA/chatbot/corpus/cornelldata.py", line 58, in loadLines
web_1 | with open(fileName, 'r', encoding='iso-8859-1') as f: # TODO: Solve Iso encoding pb !
web_1 | FileNotFoundError: [Errno 2] No such file or directory: '/home/ibrahimsharaf/workspace/DeepQA/data/cornell/movie_lines.txt'
Dockerfile
## Dockerfile to build DeepQ&A container image
FROM python:3.5.2
## Dependencies
RUN \
apt-get -qq -y update && apt-get -y install unzip
RUN \
pip3 install -U nltk \
tqdm \
django \
asgi_redis \
channels && \
python3 -m nltk.downloader punkt
## Tensorflow
ARG TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp35-cp35m-linux_x86_64.whl
RUN \
pip3 install -U $TF_BINARY_URL
COPY ./ /home/ibrahimsharaf/workspace/DeepQA
## Run Config
# You should generate your own key if you want deploy it on a server
ENV CHATBOT_SECRET_KEY="e#0y6^6mg37y9^+t^p_$xwnogcdh=27)f6_=v^$bh9p0ihd-%v"
ENV CHATBOT_REDIS_URL="redis"
EXPOSE 8000
WORKDIR /home/ibrahimsharaf/workspace/DeepQA/chatbot_website
RUN python3 manage.py makemigrations
RUN python3 manage.py migrate
# Launch the server
CMD python3 manage.py runserver 0.0.0.0:8000
deploy.yml
version: '2'
services:
web:
image: deepqa:latest
ports:
- "8000:8000"
environment:
- PYTHONUNBUFFERED=0
volumes:
- ${DEEPQA_WORKDIR}/logs:/home/ibrahimsharaf/workspace/DeepQA/chatbot_website/logs
- ${DEEPQA_WORKDIR}/save:/home/ibrahimsharaf/workspace/DeepQA/save
- ${DEEPQA_WORKDIR}/data:/home/ibrahimsharaf/workspace/DeepQA/data
depends_on:
- redis
redis:
image: redis
I've run docker build -t deepqa:latest .
at this directory /home/ibrahimsharaf/workspace/DeepQA/
You have to replace <base_dir>
by the real path in the command DEEPQA_WORKDIR=<base_dir> docker-compose -f
I did, using the folder path I created with ./data_dirs.sh
You should not modify the deploy.yml file
It returns this error when I use deploy.yml as is
web_1 | Training samples not found. Creating dataset...
web_1 | Constructing full dataset...
web_1 | Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7febe714df28>
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.5/site-packages/django/utils/autoreload.py", line 227, in wrapper
web_1 | fn(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
web_1 | autoreload.raise_last_exception()
web_1 | File "/usr/local/lib/python3.5/site-packages/django/utils/autoreload.py", line 250, in raise_last_exception
web_1 | six.reraise(*_exception)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
web_1 | raise value.with_traceback(tb)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/utils/autoreload.py", line 227, in wrapper
web_1 | fn(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
web_1 | apps.populate(settings.INSTALLED_APPS)
web_1 | File "/usr/local/lib/python3.5/site-packages/django/apps/registry.py", line 116, in populate
web_1 | app_config.ready()
web_1 | File "/root/DeepQA/chatbot_website/chatbot_interface/chatbotmanager.py", line 31, in ready
web_1 | ChatbotManager.initBot()
web_1 | File "/root/DeepQA/chatbot_website/chatbot_interface/chatbotmanager.py", line 41, in initBot
web_1 | ChatbotManager.bot.main(['--modelTag', 'server', '--test', 'daemon', '--rootDir', chatbotPath])
web_1 | File "/root/DeepQA/chatbot/chatbot.py", line 158, in main
web_1 | self.textData = TextData(self.args)
web_1 | File "/root/DeepQA/chatbot/textdata.py", line 97, in __init__
web_1 | self.loadCorpus()
web_1 | File "/root/DeepQA/chatbot/textdata.py", line 260, in loadCorpus
web_1 | corpusData = TextData.availableCorpus[self.args.corpus](self.corpusDir + optional)
web_1 | File "/root/DeepQA/chatbot/corpus/cornelldata.py", line 43, in __init__
web_1 | self.lines = self.loadLines(os.path.join(dirName, "movie_lines.txt"), MOVIE_LINES_FIELDS)
web_1 | File "/root/DeepQA/chatbot/corpus/cornelldata.py", line 58, in loadLines
web_1 | with open(fileName, 'r', encoding='iso-8859-1') as f: # TODO: Solve Iso encoding pb !
web_1 | FileNotFoundError: [Errno 2] No such file or directory: '/root/DeepQA/data/cornell/movie_lines.txt'
@jopasserat can you help?