I changed the Dockerfile like above. Running cloud run instance on port 5005 now. This did not change the outcome though
2022-02-07T05:16:37.363167Z2022-02-07 05:16:37 ERROR rasa.core.agent - Could not load model due to [Errno 39] Directory not empty: '/tmp/tmpxjw4yz_2'.
2022-02-07T05:16:37.363180Z2022-02-07 05:16:37 INFO root - Rasa server is up and running.
...
2022-02-07T05:19:04.914524Z2022-02-07 05:19:04 INFO rasa.core.agent - Ignoring message as there is no agent to handle it.
Still getting empty response on calling webhook API
It’s difficult (maybe even not possible), to exec into the docker container running on Google cloud run. Not sure how that can be done.
As I said earlier, when the same docker runs on my Ubuntu 18.04 everything works fine.
The following error:
ERROR rasa.core.agent - Could not load model due to [Errno 39] Directory not empty: '/tmp/tmpxjw4yz_2'.
Tells me there is a requirement for /tmp/ folder to be empty but somehow in cloud run it’s not.
I have also tried to empty the /tmp/ folder just before doing ‘rasa run’ but still got the same error.
Thanks @nik202 . Appreciate your detailed response.
I am able to run my Docker instance on Google Compute Engine VM so taking that route for now. Interestingly cloud run also requires more memory than normal GCE VM.
I suppose this problem is specific to cloud run environment only. So if anyone had tried deploying Rasa on cloud run maybe able to point out the issue here.
I deployed Rasa on Cloud Run, this is my Dockerfile:
FROM rasa/rasa:3.5.2-full as step1
USER root
COPY ./app/ /app/
RUN pip3 install --no-cache-dir spacy
RUN python -m spacy download pt_core_news_sm
RUN python -m spacy link pt_core_news_sm pt
FROM step1 as runner
COPY --from=step1 /opt/venv /opt/venv
# make sure we use the virtualenv
ENV PATH="/opt/venv/bin:$PATH"
# update permissions & change user to not run as root
WORKDIR /app
RUN chgrp -R 0 /app && chmod -R g=u /app
USER 1001
# the entry point
# EXPOSE 5005
ENTRYPOINT ["rasa", "run"]
My Cloud Run setup has port 5005 and a minimum of 2GiB of memory.