Rasa 3 Model Custom Graph Component with in Docker

Hi Team, I built a rasa model using a custom graph component and the model is working as expected. I want to build a docker container for this model and connect it to the action server(docker). Please find the Dockerfile I used to containerize rasa model

--------------- Dockerfile---------------

FROM python:3.9.1

WORKDIR /app

ENV HOME=/app/

COPY …

#install dependencies RUN pip install -r requirements.txt

CMD [“run”,“–enable-api”,“–port”,“8080”]

I executed the below docker run command and resulted in below error-

C:\Users\Nejina>docker run -it -p 8080:8080 -v C:/conversationalAI/Bot-Docker:/app rasa/rasa:3.2.4 run --enable-api --port 8080 2022-10-12 10:29:11 INFO root - Starting Rasa server on http://0.0.0.0:8080 2022-10-12 10:29:14 INFO rasa.core.processor - Loading model models/20220906-121849-stubborn-torpedo.tar.gz… 2022-10-12 10:29:16 ERROR rasa.core.agent - Could not load model due to Error deserializing graph schema. Can’t find class for graph component type ‘customcomponentscript.Preprocess’… 2022-10-12 10:29:16 INFO root - Rasa server is up and running.

Can anybody please help me out with how to fix this issue? How do I have to include the custom graph component within a Dockerfile?

Please find the config file

--------------- config.yml ---------------

recipe: default.v1

language: en

pipeline:

  • name: WhitespaceTokenizer
  • name: customcomponentscript.Preprocess …

Thanks in advance

Hi, can you share both of your complete dockerfiles?

I have prepared only one docker file for the rasa model, the action server docker file I have to prepare. I have included the docker file for the rasa model along with the issue mentioned above

Hi, did you build an image out of this Dockerfile?

As I can see you’re using the rasa image (rasa/rasa:3.2.4) here and not the image from the Dockerfile

Here is an example,

FROM rasa/rasa:3.1.1

WORKDIR /app

COPY . . 

COPY ./models /app/models # if you want to directly use the trained model

USER root

RUN rasa train

USER 1001

VOLUME /app

VOLUME /app/data

VOLUME /app/models

EXPOSE 5005

CMD [ "run", "-m", "/app/models", "--enable-api", "--cors", "*", "--debug", "-p", "5005" ]

Then you build the image with the Dockerfile and run it.

@rasa_learner , I followed steps you suggested, and helped me to fix the issue Thank you

Hi, glad I could help. You can mark it as a solution, so it can be useful for others with the same issue.