Rasa X provides a compelling bot platform based on the open source Rasa 1.0. There’s a great in-depth video by Justina Petraitytė.
The Rasa docs describe two approaches to running Rasa X. A simple setup described here and a “Server” setup described here. As of this writing, I find the server setup to be convoluted with many python related pitfalls. Hopefully, this will improve with a more straightforward Docker driven process.
I have some existing bots that I now want to use with Rasa X. But, let’s start with the install.
I’m going to use the server install because I want this setup to run under Docker. Follow the instructions described in the link. You will download and run an install.sh
script. The install script does the following:
It then runs an ansible playbook does a bunch of steps:
/etc/rasa
if not already set/etc/rasa
and subdirectories for log
, scripts
, etc.environments.yml
, credentials.yml
, endpoints.yml
rasa_x_commands.py
I want Rasa X to install in a specific directory, so I’m going to set RASA_HOME
before running install. Here are the steps in a nutshell.
export RASA_HOME=/home/greg/rasax
curl -sSL -o install.sh https://storage.googleapis.com/rasa-x-releases/stable/install.sh
sudo -E bash ./install.sh
After the script completes, you should find a directory structure like this in RASA_HOME
:
├── auth
├── certs
├── credentials
├── credentials.yml
├── db
├── docker-compose.yml
├── endpoints.yml
├── environments.yml
├── logs
├── models
├── rasa_x_commands.py
├── scripts
└── terms
With Rasa X installed in RASA_HOME
(/etc/rasa by default), use the following command to start it:
cd $RASA_HOME
sudo docker-compose up -d
On first time execution, set the admin user password:
sudo python rasa_x_commands.py create --update admin me PASSWORD
You should now be able to connect to http://localhost:80
I have had the following issue with the Rabbit MQ container failing on subsequent starts.
/librabbitmq.sh: line 181: /opt/bitnami/rabbitmq/.rabbitmq/.erlang.cookie: Permission denied
rasa_rabbit_1 exited with code 1
Removing the container has gotten around the issue
docker container rm rasa_rabbit_1
In a follow-up post I will describe the process to migrate an existing bot to Rasa X.
If you have a existing action script, here are the steps to configure it for Rasa X:
sudo mkidr $RASA_HOME/actions
sudo touch $RASA_HOME/actions/__init__.py
Copy your actions.py
to $RASA_HOME/src
Create the file $RASA_HOME/docker-compose.override.yml
with the following contents:
version: '3.4'
services:
app:
image: 'rasa/rasa-sdk:latest'
volumes:
- './actions:/app/actions'
expose:
- '5055'
depends_on:
- rasa-production