First of all, I’m brand new to Rasa…and development in general.
I’m trying to deploy my Rasa (OS) assistant as a multi-container web app running on a VM. I’ve configured an NLU server, an action server, and a web server (using Nginx). While the action and web servers appear to be running normally, my NLU server can’t seem to locate the trained model.
Here’s the relevant part of my docker-compose.yml
file:
version: '3'
services:
nlu_server:
container_name: "nlu_server"
build:
context: backend
volumes:
- ./backend:/app
- ./backend/data:/app/data
- ./backend/models:/app/models
ports:
- "5005:5005"
action_server:
...
nginx:
...
My backend
directory structure looks like this:
|-- backend
| |-- data
| | |-- nlu.yml
| | |-- rules.yml
| | |-- stories.yml
| |-- models
| | |-- model_0.tar.gz
| |-- config.yml
| |-- credentials.yml
| |-- domain.yml
| |-- endpoints.yml
| |-- Dockerfile
And here’s my Dockerfile
for the backend
context:
FROM rasa/rasa:3.3.1
WORKDIR /app
USER root
COPY ./data /app/data
COPY ./models /app/models
COPY . /app
RUN rasa train --force --out /app/models
ENTRYPOINT ["rasa", "run", "-m", "/app/models", "--enable-api", "--cors", "*", "--debug"]
I can confirm that running docker compose build
does, indeed, train a new Rasa model (call it model_1.tar.gz
) and (claims to) save it to /app/models
(which already contains model_0.tar.gz
since it’s copied from the context). However, when I run docker compose up
, the last few lines of the log are:
nlu_server | 2023-04-07 21:08:08 INFO rasa.core.processor - Loading model /app/models/model_0.tar.gz...
nlu_server | /opt/venv/lib/python3.8/site-packages/rasa/shared/utils/io.py:98: UserWarning: No valid model found at /app/models!
nlu_server | 2023-04-07 21:08:08 INFO root - Rasa server is up and running.
So Rasa is attempting to load the pre-existing model (the one included with the build context), and finds it to be invalid for some reason…? (To be honest, this is why I included a rasa train
command in the Dockerfile
in the first place…)
EDIT: After running docker exec -it <container id> bash
, I can see that the model trained during the build is not in the container.
What I am doing wrong?