Rasa Action Server

I am trying to deploy a Rasa server and RASA action server and it fails with the error

2023-08-21 13:38:47 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
2023-08-21 13:38:47 ERROR    rasa_sdk.executor  - Failed to register package 'actions'.
.
.
.
  File "/app/actions/botdb.py", line 4, in <module>
    from rasa.core.tracker_store import TrackerStore
ModuleNotFoundError: No module named 'rasa'

Content of my Docker Compose file

version: '3.0'
services:
  rasa:
    container_name: "rasa_server"
    user: root
    build:
      context: .
    volumes:
      - "./:/app"
    ports:
      - "5005:5005"

  action_server:
    image: rasa/rasa-sdk:latest
    restart: always
    volumes:
      - ./actions:/app/actions
    ports:
      - 5055

Also the rasa server is up and I can confirm through postman

Kindly confirm what I might be doing wrong. Also, there’s no DockerFile in the actions folder and this is directory structure of my project.

.
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ README.md
β”œβ”€β”€ actions
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ __pycache__
β”‚   β”œβ”€β”€ actions.py
β”‚   └── botdb.py
β”œβ”€β”€ config.yml
β”œβ”€β”€ credentials.yml
β”œβ”€β”€ data
β”‚   β”œβ”€β”€ nlu.yml
β”‚   β”œβ”€β”€ rules.yml
β”‚   └── stories.yml
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ domain.yml
β”œβ”€β”€ endpoints.yml
β”œβ”€β”€ frontends
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ index.html
β”‚   └── static
β”œβ”€β”€ graph.html
β”œβ”€β”€ models
β”œβ”€β”€ runrasa.sh
β”œβ”€β”€ tests
  └── test_stories.yml

Just to add further update. I stumbled on this article [Rasa Assistant Docker Compose] (GitHub - cskujawa/rasa-assistant) and modified my Docker Compose file and encountered the same error.

version: '3.7'
services:
  # app:
  #   build: 
  #     context: ./frontends
  #   networks:
  #     - admission-bot
  rasa:
    image: rasa/rasa:main-spacy-en
    container_name: rasa
    ports:
      - 5005:5005
    volumes:
      - .:/app
    command:
      - run
      - --debug
      - --enable-api
      - --cors
      - "*"
    networks:
      - admission-bot

  rasa-action_server:
    build:
      context: .
      dockerfile: ./actions/Dockerfile
    image: rasa-action_server
    container_name: rasa-action-server
    working_dir: /app
    command:
      - start
      - --debug
      - --actions
      - actions
      - --cors
      - "*"
    networks:
      - admission-bot
    ports:
      - 5055:5055
    volumes:
      - ./actions:/app/actions
    depends_on:
      - rasa

networks:
  admission-bot:
    name: admission-bot
    driver: bridge

RASA SERVER IS UP

image

RASA ACTION SERVER

image

Hello!

I’m not quite proficient in rasa but I’ll tell you what I think.

The error seems to be related to the missing package when you run container inside of docker. As far as I can see (I might be wrong) rasa.core is a part of rasa not rasa_sdk. I’m not sure how to resolve the issue though but maybe you need to install dependencies while building the containers.

In your original post you say that there’s no Dockerfile for actions, but in your modified docker-compose it looks like there’s a Dockerfile for action server.

Could you maybe share the contents of your Dockerfiles?

Thanks for the reply @xxxwarrior . This is the action-server dockerfile

# Extend the official Rasa SDK image
FROM rasa/rasa-sdk:3.3.0

# Change back to root user to install dependencies
USER root

# To install packages from PyPI
RUN pip install --no-cache-dir requests

# Switch back to non-root to run code
USER $user

I’m not sure how to resolve your issue, for the sake of testing I would maybe try to install rasa package like you install requests there and see if it changes anything.

Wow. That solved the issue.

Thank you. Its quite weird rasa is not installed in that sdk version

Glad that helped!

1 Like