[TOOL/GUIDE] Unofficial RasaX Quick Install script for a pure Windows machine

*************************************

Remember to check the bottom of the thread for the most up-to-date version of the script!

*************************************

Hi all.

Installing RasaX on Windows is a bit of a tedious task, because of all the containers that love to crash and fail all the time. As such, and with much credit to Arjaan Buijk from the Rasa team for the fixes and discussion, I’ve written a script in Python that will quickly get a test server up and running.

Prerequisites

One of the first things you need to note is that this script and the general setup is NOT PRODUCTION READY. This script will get a RasaX server up and running, but it is imperative that you deploy your RasaX server on a dedicated Linux machine when moving to production. This script will only be useful for you if you want to just quickly deploy a RasaX server and play around with it or see its features.

That being said, you need two things pre-installed on your Windows machine: Python 3.6+ and Docker for Windows. You can test if you have everything you need by running

python -V
docker -v
docker-compose -v

All of which should yield the corresponding version numbers of the respective tools. (Note the capital V in the Python line. Using a small v in Python will make it freak out, but I guess it’s just as good of a tell that you have it installed.)

Step 1

Download rasa_x_turbo.py and config.json. As of the time of writing this post, the latest versions of RasaX and Rasa are 0.26.0 and 1.8.0 respectively. If you’re from the future, make sure to update the version numbers in config.json.

Step 2

…run the Python script in your project folder. Pretty much all that there is to it, really. The script itself should take care of setting up your directory, downloading all the files needed, and writing and modifying the docker-compose. The setup process also happens to be quite straightforward, so don’t be alarmed if everything happens in an instant.

Step 3

Follow these instructions from Step 2 onwards. All steps are the same. Just remember that you don’t need to add sudo and you should be golden. (Except, of course, that you should be cd’ing to your project folder, not etc/rasa or RASA_HOME.)

I wrote this script in about half an hour while bored at work, so it may not be exactly stellar in terms of code quality. If you have any suggestions for changes, do let me know.

Cheers.

9 Likes

Thanks a lot for sharing this!

2 Likes

This looks great…but… After all the docker images downloaded I ended up with:

WARNING: The RASA_X_DEMO_VERSION variable is not set. Defaulting to a blank string.
ERROR: no such image: rasa/rasa-x-demo:: invalid reference format

:thinking:

@jonathanpwheat,

It’s a small bug in the script. A quick patch is to open the .env file after you run the script, and add this line:

RASA_X_DEMO_VERSION=0.26.0
3 Likes

Hi Jonathan,

As @Arjaan stated, its a small bug I overlooked because I used a modified Docker Compose file on my system.

Arjaan sent me an updated version of the script. You can find those below. Let me know if anything else weird happens.

config.json (91 Bytes) rasa_x_turbo.py (6.7 KB)

2 Likes

Hi.

A rather “major” update, the script no longer modifies the downloaded version of the Docker Compose to apply the Windows fix. It instead writes the fix to a Compose Override, making it MUCH more Docker-friendly and saves you the 12 seconds it would have taken you to make one for your action server anyways.

Also fixed a few places where the coloring for certain text was screwed up, as well as making sure that the script doesn’t close immediately if it encounters an error.

rasa_x_turbo.py (6.4 KB)
(No changes in the config.json, you can still use the previous one.)

Big thanks, again, to @Arjaan for the help.

1 Like

after running the python script when i try to start rasax by typing “rasa x” i get below error

ValueError: Error when trying to expand the environment variables in ‘${RASA_MODEL_SERVER}’. Please make sure to also set these environment variables: ‘[’${RASA_MODEL_SERVER}’]’.

Any advice?

You’re not supposed to start Rasa X by entering that command in Powershell.

Look around in your project directory for a file named docker-compose.yml. cd to that directory in your Powershell window and run docker-compose up -d. The RasaX instance should start once all the containers are up and active.

Thanks … i tried the steps again but ran into this

My env has these versions python -V Python 3.7.3

docker -v Docker version 19.03.8, build afacb8b

docker-compose -v docker-compose version 1.25.4, build 8d51620a

Hi @bharatji30 could you change the port for nginx service in docker-compose.yml to an unallocated one ? , then prune every docker container to be sure , then again perform : docker-compose up -d

@bharatji30 please try panda’s suggestion. Additionally, I’ve noticed you’re using an older version of the Windows script. Please use the script uploaded in this post instead, along with the config.json uploaded right above it.

1 Like

Thank you all for your suggestions.

I have updated the script file, but landed on the same error. To try the other suggestion, could you please help me on how to find which port should i mention for nginx? right now it has:

ports: - “80:8080” - “443:8443”

I am sorry for dragging this so long.

Hi , let’s not change the port for now yet. Can you show us how many docker images you have downloaded ? and how many containers are run with docker-compose up -d ? ( i suspect you already had a nginx server running when you did docker-compose up and had that error , if not let’s figure this out together )

great idea.

on listing currently running containers i did see a container with nginx node … from a previous installation attempt … so i killed it and ran the docker-compose up -d again … and now the error is gone and below are the containers which are running.

and the docker-compose up -d completes OK, but nothing else happens. image

So now what should i do to start Rasa-X?

Alright , now everything looks clearer . The command you’ve just typed : docker-compose up Builds, (re)creates, starts, and attaches to containers for a service.(see docker-compose doc for more info) So now create a user via : python rasa_x_commands.py create --update admin me PASSWORD , then head to http://localhost/ .

1 Like

please be patient with be … i am not out of the woods just yet.

Running rasa_x_commands gives me below error

Error response from daemon: Container be0e2034a9a96ec957d8528e61cc43589e0e34eec27a6342f12dbdbc07c10fa3 is restarting, wait until the container is running ERROR:main:Failed to create user.

So on checking the containers again it seems one of them goes in “restarting” status when i run rasa_x_commands script

i didn’t try individually killing this one … instead i ran the rasa_x_turbo again … and docker-compose after that, which brought all the containers up again. But when i ran the rasa_x_command this one container went into restarting status. Which resulted in the error i have included above.

am i missing a step?

I don’t consider myself an expert when it comes to containerization to narrow down where the problem is , but could you execute the command : docker system prune, then try docker-compose down , then docker-compose up again ? (keep down-ing and up-ing and see if it solves anything) if this doesn’t solve your problem then in that case you should read the docker doc and see the logs on why the container fails to be running …

@pandaxar Thanks for all your help. @ActuallyAcey for posting the script for someone like me to get started with Rasa-X installation.

I learnt about dockers when i first tried installing rasa-x … so i am newbie at best when it comes to containers :frowning:

Apparently “rasaxtest_rasa-x_1” container goes into “restarting” mode soon after it is created/refreshed.

I will try to read and see if i get a clue. But my best bet is you or someone pointing me to a solution.

But trying to install Rasa-X has been a tremendous learning experience in itself. Hopefully i will get over this last hurdle soon.

@bharatji30 can you try running docker-compose logs rasa-x and post the output here? You may have to run it a few times to get output, in case it’s stuck in a loop.