DeepQA icon indicating copy to clipboard operation
DeepQA copied to clipboard

Can't deploy using docker compose

Open ibrahimsharaf opened this issue 7 years ago • 8 comments

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'

ibrahimsharaf avatar May 05 '17 22:05 ibrahimsharaf

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

ibrahimsharaf avatar May 05 '17 22:05 ibrahimsharaf

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

ibrahimsharaf avatar May 05 '17 22:05 ibrahimsharaf

I've run docker build -t deepqa:latest . at this directory /home/ibrahimsharaf/workspace/DeepQA/

ibrahimsharaf avatar May 05 '17 22:05 ibrahimsharaf

You have to replace <base_dir> by the real path in the command DEEPQA_WORKDIR=<base_dir> docker-compose -f

Conchylicultor avatar May 05 '17 22:05 Conchylicultor

I did, using the folder path I created with ./data_dirs.sh

ibrahimsharaf avatar May 05 '17 22:05 ibrahimsharaf

You should not modify the deploy.yml file

Conchylicultor avatar May 06 '17 09:05 Conchylicultor

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'

ibrahimsharaf avatar May 06 '17 18:05 ibrahimsharaf

@jopasserat can you help?

ibrahimsharaf avatar May 09 '17 01:05 ibrahimsharaf