首页 > 解决方案 > 错误 R14(超出内存配额)和错误 R10(启动超时)-> Web 进程未能在启动后 60 秒内绑定到 $PORT

问题描述

我正在 Heroku 上部署 RASA 聊天机器人,我正在使用以下 Docker 和脚本文件。服务器正在完美启动,但我认为模型提取可能存在问题。我无法得到。

Dockerfile

FROM rasa/rasa:1.9.7
USER root
ENTRYPOINT []
ADD . /app/
RUN pip install rasa[spacy]
RUN python -m spacy download en_core_web_md
RUN python -m spacy link en_core_web_md en
RUN ls /app
RUN chmod +x /app/server.sh
CMD /app/server.sh
credentials.yml --debug

服务器.sh

rasa run -m models --cors "*" --enable-api --port $PORT --endpoints endpoints.yml --credentials credentials.yml --debug

以下轨迹来自heroku logs -t

2020-06-09T11:25:15.037081+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-09T11:25:49.798297+00:00 heroku[web.1]: Starting process with command `/bin/bash -o pipefail -c /app/server.sh`
2020-06-09T11:25:56.027748+00:00 app[web.1]: 2020-06-09 11:25:56 DEBUG    rasa.core.utils  - Available web server routes:
2020-06-09T11:25:56.027812+00:00 app[web.1]: /conversations/<conversation_id>/messages          POST                           add_message
2020-06-09T11:25:56.027813+00:00 app[web.1]: /conversations/<conversation_id>/tracker/events    POST                           append_events
2020-06-09T11:25:56.027815+00:00 app[web.1]: /webhooks/rasa                                     GET                            custom_webhook_RasaChatInput.health
2020-06-09T11:25:56.027815+00:00 app[web.1]: /webhooks/rasa/webhook                             POST                           custom_webhook_RasaChatInput.receive
2020-06-09T11:25:56.027816+00:00 app[web.1]: /webhooks/rest                                     GET                            custom_webhook_RestInput.health
2020-06-09T11:25:56.027816+00:00 app[web.1]: /webhooks/rest/webhook                             POST                           custom_webhook_RestInput.receive
2020-06-09T11:25:56.027824+00:00 app[web.1]: /model/test/intents                                POST                           evaluate_intents
2020-06-09T11:25:56.027825+00:00 app[web.1]: /model/test/stories                                POST                           evaluate_stories
2020-06-09T11:25:56.027825+00:00 app[web.1]: /conversations/<conversation_id>/execute           POST                           execute_action
2020-06-09T11:25:56.027826+00:00 app[web.1]: /domain                                            GET                            get_domain
2020-06-09T11:25:56.027826+00:00 app[web.1]: /socket.io                                         POST                           handle_request
2020-06-09T11:25:56.027826+00:00 app[web.1]: /                                                  GET                            hello
2020-06-09T11:25:56.027827+00:00 app[web.1]: /model                                             PUT                            load_model
2020-06-09T11:25:56.027827+00:00 app[web.1]: /model/parse                                       POST                           parse
2020-06-09T11:25:56.027828+00:00 app[web.1]: /conversations/<conversation_id>/predict           POST                           predict
2020-06-09T11:25:56.027829+00:00 app[web.1]: /conversations/<conversation_id>/tracker/events    PUT                            replace_events
2020-06-09T11:25:56.027830+00:00 app[web.1]: /conversations/<conversation_id>/story             GET                            retrieve_story
2020-06-09T11:25:56.027830+00:00 app[web.1]: /conversations/<conversation_id>/tracker           GET                            retrieve_tracker
2020-06-09T11:25:56.027830+00:00 app[web.1]: /webhooks/socketio                                 GET                            socketio_webhook.health
2020-06-09T11:25:56.027831+00:00 app[web.1]: /status                                            GET                            status
2020-06-09T11:25:56.027831+00:00 app[web.1]: /model/predict                                     POST                           tracker_predict
2020-06-09T11:25:56.027832+00:00 app[web.1]: /model/train                                       POST                           train
2020-06-09T11:25:56.027832+00:00 app[web.1]: /conversations/<conversation_id>/trigger_intent    POST                           trigger_intent
2020-06-09T11:25:56.027832+00:00 app[web.1]: /model                                             DELETE                         unload_model
2020-06-09T11:25:56.027833+00:00 app[web.1]: /version                                           GET                            version
2020-06-09T11:25:56.027882+00:00 app[web.1]: 2020-06-09 11:25:56 INFO     root  - Starting Rasa server on http://localhost:17793
2020-06-09T11:25:56.028133+00:00 app[web.1]: 2020-06-09 11:25:56 DEBUG    rasa.core.utils  - Using the default number of Sanic workers (1).
2020-06-09T11:25:56.029616+00:00 app[web.1]: 2020-06-09 11:25:56 INFO     root  - Enabling coroutine debugging. Loop id 94472838346280.
2020-06-09T11:25:56.345896+00:00 app[web.1]: 2020-06-09 11:25:56 DEBUG    rasa.model  - Extracted model to '/tmp/tmp6ebr6r7s'.
2020-06-09T11:26:03.846339+00:00 heroku[web.1]: Process running mem=685M(133.9%)
2020-06-09T11:26:03.848858+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2020-06-09T11:26:25.775231+00:00 heroku[web.1]: Process running mem=909M(177.7%)
2020-06-09T11:26:25.777768+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2020-06-09T11:26:34.617203+00:00 app[web.1]: 2020-06-09 11:26:34 INFO     rasa.nlu.components  - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en'.
2020-06-09T11:26:34.715295+00:00 app[web.1]: 2020-06-09 11:26:34 DEBUG    rasa.utils.tensorflow.models  - Loading the model ...
2020-06-09T11:26:35.297208+00:00 app[web.1]: 2020-06-09 11:26:35.296743: E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303)
2020-06-09T11:26:41.647385+00:00 app[web.1]: 2020-06-09 11:26:41 DEBUG    rasa.utils.tensorflow.models  - Finished loading the model.
2020-06-09T11:26:41.648183+00:00 app[web.1]: 2020-06-09 11:26:41 DEBUG    rasa.utils.tensorflow.models  - Building tensorflow prediction graph...
2020-06-09T11:26:47.461993+00:00 heroku[web.1]: Process running mem=979M(191.2%)
2020-06-09T11:26:47.463550+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2020-06-09T11:26:49.828941+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

标签: bashdockerherokudeploymentrasa

解决方案


推荐阅读