Run Rasa X using public Docker image?

In short: is it possible to run Rasa X from a pre-built Docker image?

Context: I’m on Win10 with Python 3.7 installed. Can’t change that for other reasons. I can’t, therefore, install Rasa x natively (Tensorflow incompatible with Py 3.7).

I can successfully run core rasa CLI using Docker, as described in the docs; e.g.

docker run -it -v $(pwd):/app rasa/rasa shell

However I haven’t found a way to run Rasa X using Docker in this way:

C:\Users\sfinnie\projects\rasa\rasax-spike> docker run -it -v /c/users/sfinnie/projects/rasa/rasax-spike:/app rasa/rasa x
Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/rasa/__main__.py", line 70, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/usr/local/lib/python3.6/site-packages/rasa/cli/x.py", line 287, in rasa_x
    run_locally(args)
  File "/usr/local/lib/python3.6/site-packages/rasa/cli/x.py", line 304, in run_locally
    from rasax.community import local
ModuleNotFoundError: No module named 'rasax' 

The Rasa X docs do explain how to build a Docker container - is that necessary, or is there a way to use a pre-built image?

Thanks.

Hi @sfinnie, can you give more information about this:

I can’t, therefore, install Rasa x natively (Tensorflow incompatible with Py 3.7).

We’re looking into windows compatibility with 3.7 and your error could be helpful.

As for your error, the issue lies in that you’re trying to run the rasa x command without having rasa x installed (rasa is a requirement for rasa x, but not the other way around)

Have you looked into the quick installation? This should pull the latest stable and serve rasa X.

Hi @erohmensing, thanks for your response. The TensorFlow/Py3.7 incompatibility dates back to Oct 18 (see related Q here). Looking again now at the TensorFlow installation instructions, it doesn’t explicitly mention 3.7 incompatibility. So it may have been resolved - my problem above might not be that.

As for your error, the issue lies in that you’re trying to run the rasa x command without having rasa x installed ( rasa is a requirement for rasa x , but not the other way around)

Yes, I assumed that was the case - i.e. the pre-built docker image doesn’t include Rasa X. I was asking if there was an image that included both.

Have you looked into the quick installation ? This should pull the latest stable and serve rasa X.

Hadn’t spotted that, will take a look- thanks.

@sfinnie Please run docker run -it -v /c/users/sfinnie/projects/rasa/rasax-spike:/app rasa/rasa-x (you were using the rasa image which does not contain `rasa x)

@Tobias_Wochinger so simple… of course.

Thanks very much.

Hi @Tobias_Wochinger , I am getting the same error upon trying docker-compose up

this is my compose file :

version: '3.0'
services:
  rasa:
    image: rasa/rasa:latest-full
    ports:
      - 5005:5005
    volumes:
      - ./:/app
    command:
      -  x
  action_server:
    image: rasa/rasa-sdk:latest
    volumes:
      - ./actions:/app/actions

The error :

Starting wlbot_action_server_1 ... done
Starting wlbot_rasa_1          ... done
Attaching to wlbot_action_server_1, wlbot_rasa_1
action_server_1  | 2019-08-23 17:28:52 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
action_server_1  | 2019-08-23 17:28:52 ERROR    rasa_sdk.executor  - Failed to register package 'actions.actions'.
action_server_1  | Traceback (most recent call last):
action_server_1  |   File "/app/rasa_sdk/executor.py", line 184, in register_package
action_server_1  |     self._import_submodules(package)
action_server_1  |   File "/app/rasa_sdk/executor.py", line 171, in _import_submodules
action_server_1  |     package = importlib.import_module(package)
action_server_1  |   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
action_server_1  |     return _bootstrap._gcd_import(name[level:], package, level)
action_server_1  |   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
action_server_1  |   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
action_server_1  |   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
action_server_1  |   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
action_server_1  |   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
action_server_1  |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
action_server_1  |   File "/app/actions/actions.py", line 25, in <module>
action_server_1  |     from bot.services.api import API
action_server_1  | ModuleNotFoundError: No module named 'bot'
action_server_1  | 2019-08-23 17:28:52 INFO     rasa_sdk.endpoint  - Action endpoint is up and running. on ('0.0.0.0', 5055)
rasa_1           | Traceback (most recent call last):
rasa_1           |   File "/usr/local/bin/rasa", line 10, in <module>
rasa_1           |     sys.exit(main())
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/rasa/__main__.py", line 76, in main
rasa_1           |     cmdline_arguments.func(cmdline_arguments)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/rasa/cli/x.py", line 291, in rasa_x
rasa_1           |     run_locally(args)
rasa_1           |   File "/usr/local/lib/python3.6/site-packages/rasa/cli/x.py", line 308, in run_locally
rasa_1           |     from rasax.community import local  # pytype: disable=import-error
rasa_1           | ModuleNotFoundError: No module named 'rasax'

Could you suggest whats wrong here ? Many thanks!

Sorry, for my late answer, but I was on vacation.

The error is caused my a missing dependency bot in the action container. You have to install this dependency before running the action container. This page in the docs should hopefully help you there Running Rasa with Docker . Please let me know how it went.

Have you looked into the quick installation ? This should pull the latest stable and serve rasa X.

I have tried this but I couldn’t find a way to connect the Rasa X after the deployment. Could you help with this matter?

Mhm, so is the issue that when you go to the server IP, you get a connection refused?

First of all, did you make sure that your server is open on ports 80 (HTTP) and 443 (HTTPS)? Otherwise, I would check the service logs and make sure that all of the services running as expected with no internal connection errors or anything like that.