Skip to content

vladov3000/rasa-chatbot

Repository files navigation

rasa assistant

Google Cloud VM setup

  1. Go to https://console.cloud.google.com/
  2. Sign in with .edu
  3. Activate Google Cloud $300 credit (requires credit card but no autocharge)
  4. Click on the project select button right next to the "Google Cloud Platform" logo in the upper left
  5. Select "New Project" in the upper right of the pop up
  6. Create a new project called rasa
  7. On the sidebar select Compute Engine -> VM Instances
  8. Create VM instance:
  9. Machine type set to n1-standard-4(4 vCPU, 15 GB memory)
  10. Change Boot Disk Image to 100 GB Ubuntu 18.02
  11. Create instance
  12. Click on ssh button for instance
  13. git clone https://github.com/vladov3000/rasa-tutorial.git
  14. cd rasa-tutorial
  15. sudo apt-get update
  16. sudo apt install python3-pip
  17. pip3 install --upgrade pip
  18. pip3 install rasa==1.10.2
  19. ls /home
  20. export PATH=$PATH:/home/$USERNAMEHERE/.local/bin
  21. rasa train
  22. tmux (ctrl B, C to create window ctrl B, 1 to switch to window 1)
  23. rasa run actions (in seperate window)
  24. rasa shell

Run Telegram API

  1. sudo apt-get install nginx
  2. sudo apt install docker.io
  3. sudo apt install docker-compose
  4. sudo groupadd docker
  5. sudo usermod -aG docker $USER
  6. newgrp docker
  7. docker login
  8. sudo service nginx start
  9. sudo service docker start
  10. sudo apt-get install snapd
  11. sudo apt-get remove certbot
    NOTE: make sure to allow HTTP and HTTPS traffic to VM.
  12. docker build -t rasa/actions -f Dockerfile.actions .
  13. docker-compose up

Run Kubernetes

Install kubernetes cli

curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version --client

Install minikube

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \ && chmod +x minikube
sudo mkdir -p /usr/local/bin/
sudo install minikube /usr/local/bin/`
minikube start --driver=docker
kubectl get nodes

Convert docker compose to kube resources

curl -L https://github.com/kubernetes/kompose/releases/download/v1.21.0/kompose-linux-amd64 -o kompose
chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
kompose convert --volumes hostPath -o kuberes
sed -ri "s/extensions\/v1beta1/networking.k8s.io\/v1/" kuberes/rasa-network-networkpolicy.yaml

Run kubernetes

sudo docker build -t rasa/train -f Dockerfile.train .
docker save rasa/actions | pv | (eval $(minikube docker-env) && docker load)
docker save rasa/train | pv | (eval $(minikube docker-env) && docker load)
kubectl create configmap action-config --from-file=actions
kubectl get configmap action-config -o yaml > kuberes/action-config.yml
kubectl create configmap nginx-config --from-file=nginx/conf
kubectl get configmap nginx-config -o yaml > kuberes/nginx-config.yml
sudo kubectl create configmap nginx-cert-config --from-file nginx/certs/
(Fix rasa-action-deploy to use config map instead of persistent volume)
kubectl apply -f kuberes
kubectl get pods
sudo kubectl port-forward nginx-745d76696b-tv98m 80:80
sudo kubectl proxy --port=80

Enviroment setup:

Ubuntu 18
python version: 3.6.9
pip version: 20.1.2
rasa == 1.10.2

Or use virtual env (you will have to be source for every tmux window):

python3 -m venv ./venv
source /venv/bin/activate
pip install -r requirements.txt

To run rasa with command line shell:

rasa train
rasa run actions (in seperate window)
rasa shell

To run tests:

rasa test --stories tests/conversation_tests.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published