I have a two dockerfiles for rasa server and action server. Do I need another one for the python package selenium?

my actions docker image contains the command to install selenium, but when I run docker compose with the rasa image and actions image, the bot works fine but when i ask it to do an action, it doesnt return anything, can someone help me figure this out?

these are all my docker files.

image

image

Can you share your endpoint.yml file?

Btw, you can fallow @nik202 steps on this comment :smiley:

Dockerizing my rasa chatbot application that has botfront - #11 by nik202

image it was originally set as localhost:5055/webhook but when making the images i set it to this. is it wrong?

No, it’s right :blush: Did you check nik steps? Has something diferent?

I will make docker-compose file using little project and i will share the folder with your

so when I run it in my machine (without docker) with the link localhost:5055/webhook it works, but when I run it in docker with action_server:5055/webhook it doesnt work. whats the reason? also here is a screenshot from the terminal:

snippet of what I get when I run compose up

It’s a networking problem. The rasa container for some reason don’t have communication with action containers

maybe try docker network like this docker-compose example rasa/docker-compose.yml at main · RasaHQ/rasa · GitHub

I dont know if i understand. should i just add “networks: {rasa-network: {}}” to my compose yml file?

I think I found the problem! the selenium python library requires chromedriver.exe to be in the path. should I just make a new actions image with chromdriver.exe inside the actions folder?

I did another actions image with chromedriver.exe inside but still error

I used selenium in the past but out of rasa stack

I think you need configure the PATH in rasa action Dockerfile or something like that. I’m not sure this way will work, just putting chromedrive.exe in files.

I used with container and work fine and believe this is the best way

Selenium docker-composer doc Get your driver and selenium-hub

and change your script connection for:

webdriver.Remote(command_executor='http://hub:4444/wd/hub',
                               desired_capabilities=caps)

Edit ——- I remembered what is selenium module :joy::joy:

Im a little bit confused haha. so I have to add this (chrome: image: selenium/node-chrome:4.1.3-20220405 shm_size: 2gb depends_on: - selenium-hub environment: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 )

to my docker-compose.yml and then add this

(webdriver.Remote(command_executor=‘http://hub:4444/wd/hub’, desired_capabilities=caps))

inside my actions.py ?

@mx06148391 one simple question, what are you trying to archive, and what you are doing?

@mx06148391 share all docker and docker-compose files for my ref and are you working on the server-side or local machine?

So my problem right now is that actions.py is using selenium package. now when I talk to the chatbot and call an action, it doesnt work. right now I have the following error:

my dockerfile for actions is like this:

@mx06148391 why you need chrome and selenium package? What is you use case? Are you using in your custom action code? Or you are trying to test the code? Please elaborate more for us.

Always tag me @ nik202. I will get the notification and try come to help you. If you not tag me then response can be delayed.

Thanks

@nik202 I am using selenium inside my actions.py, my chatbot scrapes information from a website and gives it to the user.

@mx06148391 interesting, then I will recommend to see the Selenium-based docker image, this issue is not related to rasa. I’d suggest first running the code on the local machine and then using docker. Are you able to run the code on a local machine?