I try to run rasa in docker-compose. Here is my Dockerfile
# Extend the official RASA SDK image
FROM rasa/rasa-sdk:2.2.0
# Use subdirectory as working directory
WORKDIR /app
# Copy any additional custom requirements, if necessary (uncomment next line)
COPY actions/requirements-actions.txt ./
# Change back to root user to install dependencies
USER root
# Install extra requirements for actions code, if necessary (uncomment next line)
RUN pip install -r requirements-actions.txt
# Link spacy model
RUN python -m spacy download de_core_news_lg
RUN python -m spacy link de_core_news_lg de_core_news_lg
# Copy actions folder to working directory
COPY ./actions /app/actions
COPY ./load_credentials.py /app/load_credentials.py
COPY ./intern_cred.yml /app/intern_cred.yml
# By best practices, don't run the code with root user
USER 1001
and here my docker-compose.yml
version: '3'
services:
rasa:
container_name: rasa-server
image: rasa/rasa:2.2.8-full
ports:
- 5005:5005
volumes:
- ./:/app
command:
- run
- --enable-api
app:
container_name: rasa-action-server
image: rasa-action-server:rasa-action-server-latest
ports:
- 5055:5055
With the command docker-compose up
I can run rasa. Since I updated to 2.2.8 I have to retain my models. I tried
docker run -v $(pwd):/app rasa/rasa:2.2.8-full train --domain domain.yml --data data --out models
But it throws an error, so I replaced $(pwd) with my absolute projectpath. I get following error message after that:
2021-02-02 08:59:08 INFO rasa.model - Data (core-config) for Core model section changed.
2021-02-02 08:59:08 INFO rasa.model - Data (nlu-config) for NLU model section changed.
2021-02-02 08:59:08 INFO rasa.model - Data (nlg) for NLG templates section changed.
2021-02-02 08:59:08 INFO rasa.model - Data (core-config) for Core model section changed.
2021-02-02 08:59:08 INFO rasa.model - Data (nlu-config) for NLU model section changed.
2021-02-02 08:59:08 INFO rasa.model - Data (nlg) for NLG templates section changed.
2021-02-02 08:59:08 WARNING rasa.utils.common - Failed to write global config. Error: [Errno 13] Permission denied: '/.config'. Skipping.
2021-02-02 08:59:09 INFO rasa.nlu.utils.spacy_utils - Trying to load spacy model with name 'de_core_news_lg'
Training NLU model...
InvalidModelError: Model 'de_core_news_lg' is not a linked spaCy model. Please download and/or link a spaCy model, e.g. by running:
python -m spacy download en_core_web_md
python -m spacy link en_core_web_md en
I can´t understand why de_core_news_lg is not a linked spaCy model, I already linked it in my Dockerfile.
If I run docker build . -t rasa-action-server:rasa-action-server-latest
this is part of the log
Using legacy 'setup.py install' for de-core-news-lg, since package 'wheel' is not installed.
Installing collected packages: de-core-news-lg
Running setup.py install for de-core-news-lg: started
Running setup.py install for de-core-news-lg: finished with status 'done'
Successfully installed de-core-news-lg-2.3.0
WARNING: You are using pip version 20.3.1; however, version 21.0.1 is available.
You should consider upgrading via the '/opt/venv/bin/python -m pip install --upgrade pip' command.
✔ Download and installation successful
You can now load the model via spacy.load('de_core_news_lg')
Removing intermediate container ebd174fa70c2
---> 466c517556d0
Step 7/11 : RUN python -m spacy link de_core_news_lg de_core_news_lg
---> Running in a1b78a9ab324
✔ Linking successful
/opt/venv/lib/python3.7/site-packages/de_core_news_lg -->
/opt/venv/lib/python3.7/site-packages/spacy/data/de_core_news_lg
You can now load the model via spacy.load('de_core_news_lg')
Also this shows that I successfully linked the model. Any ideas why I can´t train my model? If I run rasa train outside docker-compose I have no problems with the spacy model.