Location of action.py on Kubenetes cluster

Dear All,

Could you please let me know the location of action.py (custome action) I followed this link: https://towardsdatascience.com/create-chatbot-using-rasa-part-1-67f68e89ddad and try to use action_check_weather in action.py But i dont know the location to put action.py in Kubenetes cluster.

I got ERROR log:

2020-02-22 05:14:27 ERROR rasa.core.processor - Encountered an exception while running action ‘action_check_weather’. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.

Please advise this.

It located at: rasa-app? or rasa-production? or rasa-rasa-x ?

Please advise.

On rasa-app i got log:

DEBUG:rasa_sdk.executor:Received request to run ‘action_check_weather’ ERROR:rasa_sdk.endpoint:No registered action found for name ‘action_check_weather’.

Below is my information on rasa-app pod.

root@rasa-app-65b68df565-b7tdz:/app# ls -lrt actions/actions.py -rw-r–r--. 1 root root 571 Feb 23 08:13 actions/actions.py root@rasa-app-65b68df565-b7tdz:/app# cat actions/actions.py from typing import List, Dict, Text, Any

from rasa_sdk import Action, Tracker from rasa_sdk.events import SlotSet from rasa_sdk.executor import ActionExecutor, CollectingDispatcher from rasa_sdk.utils import is_coroutine_action

class ActionCheckWeather(Action): def name(self) -> Text: return “utter_action_check_weather”

def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

  dispatcher.utter_message("Hello World! from custom action")
  return []

root@rasa-app-65b68df565-b7tdz:/app#

stories.md:

happy path

  • weather
  • action_check_weather

domain: actions:

  • utter_greet
  • action_check_weather

Please advise

I checked rasa-app:

As the main.py, it seems that rasa-app does not load any actions? i meant custom actions.

root@rasa-app-65b68df565-69p67:/app# ps -ef | grep python root 1 0 0 02:04 ? 00:00:01 python /app/main.py root 508 11 0 03:18 pts/0 00:00:00 grep python root@rasa-app-65b68df565-69p67:/app# cat main.py import logging

from rasa_sdk import constants, endpoint

logger = logging.getLogger(name)

if name == “main”: logging.basicConfig(level=logging.DEBUG) logging.getLogger(“matplotlib”).setLevel(logging.WARN)

# if you create custom actions, use a module path for the action package to
# point the server to them e.g. "mymodule.actions"
endpoint.run(
    None,  # action package
    constants.DEFAULT_SERVER_PORT,  # port of the web server
    "*"  # cors origins
)

root@rasa-app-65b68df565-69p67:/app#

Hi @nhha1602. Your actions.py should not be mounted on your kubernetes cluster. The code for it should be copied into your Docker image for your custom action server: Deploy in a Cluster Environment

It seems you are still on the demo image, and haven’t added your own image. A super simple image might look like:

FROM rasa/rasa-sdk:1.7.0

COPY ./actions /app/actions

if you don’t have any extra dependencies to add to the image.

For example, you can see the Dockerfile we use to create the custom actions image of our demobot: rasa-demo/Dockerfile at master · RasaHQ/rasa-demo · GitHub you can see that we copy all of the actions code inside demo into the container.

Hi,

Yes, thank you. It worked.

Thank you again.

No problem. Sorry for the late response!