How to change Dockerfile for Rasa-Worker with quick-install script for Rasa X

Hey there, I am using custom components in my config.yml (from GitHub - RasaHQ/rasa-nlu-examples: This repository contains examples of custom components for educational purposes.). My deployment does not work because this module is missing in my rasa-worker pod. How can I fix that? I only found the possibility to change the dockerfile for my action server. Is there a similar possibility?

1 Like

I have the exact same issue! I assume I am running into this because I am new to Docker, so thanks for your understanding, and for any help you may have!

Dear Jessica I actually managed to solve this, are you still running into this problem? Nir

Dear Nir, yes I still do. It would be great if you could share your solution with me.

Ok so I created a Dockerfile with the following:

FROM rasa/rasa:latest-full USER root RUN apt-get install -y build-essential git-all RUN . /opt/venv/bin/activate RUN pip install --upgrade pip RUN pip install --no-cache-dir fasttext RUN pip install --no-cache-dir git+https://github.com/RasaHQ/rasa-nlu-examples RUN mkdir /vecs ADD vecs/cc.he.100.bin /vecs/cc.he.100.bin RUN chmod -R a+rxw /vecs

As you can see, the Dockerfile inherits from the latest rasa Dockerfile, and adds some commands that install rasa-nlu-examples (which is what you need) and also fasttext (which was what I used in my case). I don’t know if you are using fasttext or something else, but the ADD command makes sure to pass on my embedding file to the running docker instance, where it will be copied from vecs/cc.he.100.bin (with respect to the same path where you put the Dockerfile) to the path /vec/… in the running docker instance.

In case you are also using the docker-compose installation (from here: Docker Compose Installation) then there is another change you need to do in docker-compose.yml, to make sure it uses your new Dockerfile (instead of the standard rasa image). But I don’t know exactly what your setup is. Let me know if this helped.

Thanks for sharing this with me! Where do I have to put the Dockerfile, when I use the quick-install script (with the kubernetes solution)?

I use a second server with the docker-compose installation (just because to try it). So the next step would be to create an image from this Dockerfile and add it to the worker? So I just add the line image: name_of_my_image ? Or how does it have to be?

Hi Jessica, I actually don’t use kubernetes (and I don’t know how to use it…) I use the docker-compose solution (see Rasa X documentation, docker installation

)

The relevant lines I changed in the file docker-compose.yml are as follows: … x-rasa-services: &default-rasa-service restart: always build: context: . dockerfile: Dockerfile …

They replace the x-rasa-services section that you get from the file docker-compose.yml, which you get as you follow the instructions in the link above.

The Docker file is located in the same directory as the docker-compose.yml Then I sumply run [sudo] docker-compose up -d and it builds the image from the Dockerfile and simply works…

I am actually far from being an expert in docker technology so this solution is a lot of patchy work that I put together by quickly skimming through tutorials and some random stackexchange pages. I hope it works for you :slight_smile:

1 Like

I just did that and it works fine. Thanks a lot for your help!