Custom channel setup for docker

Hello! I’m using rasa x for some time and used to install it as a pip package and therefore run everything manually using rasa command. Now I decided to switch to docker setup, thankfully there are some good tutorials from Juste, but there are some things that I’m still not able to figure out.

First, how do I add my custom channel. With pip package I used to create .py file in specified pip package folder, in my case it was livechat.py, then I just added livechat: line in my credentials file.

Second question might look dumb, but I failed to find an answer to it. I know that there is an integrated vcs to sync rasa x with rasa bot itself. Following tutorial to make a sync I need to run some commands. I assume I need to run them every time I restart rasa X. Is that true or am I missing something?

Related to question above, is there a different way to connect rasa bot and get bot files back after changing them in rasa X? e.g. where to store them and how to pass them to rasa X and get them back?

There is another question, but it is more related to docker itself and since I’m totally newbie in that I would be pleased to hear your advice.

For action server I have to create an image and then pass it to docker-compose file. For that I need a dockerfile with for example requirements.txt file that will install required packages. But if I change something in requirements then I would have to create a new image once again and then restart rasa x. Is there a way to create an image while restarting rasa x? What I mean is that when you change your custom action in actions.py you just restart rasa x and that’s it, I want something similar to that.

Sorry for so many dumb questions, looking forward to your smart answers!

UPD: I moved this question to rasa X since it’s related to setting up rasa with the docker, which I believe is the case for rasa X.

Your first question is not dumb. I havent been able to get a custom channel working yet with Rasa X either.

First, how do I add my custom channel. With pip package I used to create .py file in specified pip package folder, in my case it was livechat.py, then I just added livechat: line in my credentials file.

You’ll do the same, you’ll just need to add

- ./livechat.py:/app/livechat.py

to the volumes mounted to the rasa-production and rasa-worker containers.

Following tutorial to make a sync I need to run some commands. I assume I need to run them every time I restart rasa X. Is that true or am I missing something?

Nope! That information is stored in the database, you shouldn’t need to connect it every time. You also shouldnt really be restarting your rasa X much, though, as it’s a server meant to be running continuously.

Related to question above, is there a different way to connect rasa bot and get bot files back after changing them in rasa X? e.g. where to store them and how to pass them to rasa X and get them back?

You can upload and download most files in the UI, but I wouldn’t recommend that approach as it’s easy for things to get out of sync.

But if I change something in requirements then I would have to create a new image once again and then restart rasa x.

You would indeed need to create a new image. You wouldn’t have to restart rasa x, just the app service that uses that image.

I see, very demonstrative, thank you very much. I have another question if you could help.

I created rasa X from scratch in multiple ways using docker, but everytime I can’t add story, e.g. when I click create new story nothing happens.

Another thing is with git repository, I get some error in rasa x logs regarding this so it doesn’t really sync however it says that is sync(seems like that’s because of the error).

/usr/local/lib/python3.6/site-packages/rasa/core/domain.py:151: FutureWarning: No tracker session configuration was found in the loaded domain. Domains without a session config will automatically receive a session expiration time of 60 minutes in Rasa version 2.0 if not configured otherwise. session_config = cls._get_session_config(data.get(SESSION_CONFIG_KEY, {})) Job "GitService.run_background_synchronization (trigger: cron[minute='*'], next run at: 2020-03-24 07:24:00 UTC)" raised an exception Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/apscheduler/executors/base.py", line 125, in run_job retval = job.func(*job.args, **job.kwargs) File "/usr/local/lib/python3.6/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 826, in run_background_synchronization git_service.synchronize_project(force_data_injection) File "uvloop/loop.pyx", line 1450, in uvloop.loop.Loop.run_until_complete File "uvloop/loop.pyx", line 1443, in uvloop.loop.Loop.run_until_complete File "uvloop/loop.pyx", line 1351, in uvloop.loop.Loop.run_forever File "uvloop/loop.pyx", line 519, in uvloop.loop.Loop._run File "uvloop/loop.pyx", line 436, in uvloop.loop.Loop._on_idle File "uvloop/cbhandles.pyx", line 90, in uvloop.loop.Handle._run File "uvloop/cbhandles.pyx", line 68, in uvloop.loop.Handle._run File "/usr/local/lib/python3.6/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 700, in synchronize_project await self._inject_data() File "/usr/local/lib/python3.6/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 710, in _inject_data str(self.repository_path()), str(data_path), self.session, SYSTEM_USER File "/usr/local/lib/python3.6/site-packages/rasax/community/initialise.py", line 297, in inject_files_from_disk inject_config(os.path.join(project_path, config_path), settings_service) File "/usr/local/lib/python3.6/site-packages/rasax/community/initialise.py", line 50, in inject_config f"Failed to inject Rasa configuration:\n" File "/usr/local/lib/python3.6/site-packages/rasa/cli/utils.py", line 241, in print_error_and_exit sys.exit(exit_code) SystemExit: 1

I got it when updated my github repo.

Seems like I was able to get a solution for that, if rasa sees files with incorrect format or for example empty config.yml(or story.yml if I understood it correctly), it just doesn’t work therefore throwing exceptions and some other stuff. So I recommend anyone who face this issue to configure your git rep with correct files, then sync and upload them to rasa X, otherwise your rasa just won’t work, at least it was in my case. Tbh there are plenty of things(more like bugs) that are not mentioned in video tutorials(probably there are in docs, but I haven’t seen that as well), that stops you from creating default bot that responds with hello and goodbye, it really took me some time to set it up even though I used rasa for quite some time :(.

Regarding custom connector, I was able to add livechat.py file to the /app folder on both worker and production, however I get the same error that livechat was not found. I assume I need to provide __init__.py file as well with changed input channels. Can you describe how to do that precisely? Because when I just put new __init__.py file same error appears.