From 015c959831bd6310f965f79a606e0d132196cbeb Mon Sep 17 00:00:00 2001 From: melindaloubser1 Date: Wed, 26 Jan 2022 11:33:49 +0200 Subject: [PATCH 1/9] update versions --- .github/workflows/continuous_deployment.yml | 4 ++-- Dockerfile | 2 +- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous_deployment.yml b/.github/workflows/continuous_deployment.yml index 0b45d8ae6..1256af647 100644 --- a/.github/workflows/continuous_deployment.yml +++ b/.github/workflows/continuous_deployment.yml @@ -39,8 +39,8 @@ env: # NB! The rasa/rasa-x versions should be in sync with: # * rasa version in requirements.txt # * rasa-sdk base image version in Dockerfile - RASA_X_VERSION: "0.42.0" - RASA_VERSION: "2.8.2" + RASA_X_VERSION: "1.0.1" + RASA_VERSION: "2.8.17" # Due to the issue with openssl library for Google Cloud SDK (gcloud) # (https://github.com/GoogleCloudPlatform/github-actions/issues/128) # we use 297.0.01 version diff --git a/Dockerfile b/Dockerfile index 3155be003..c76543a8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # * rasa version in requirements.txt # * RASA_VERSION and RASA_X_VERSION in .github/workflows/continuous-deployment.yml # Pull SDK image as base image -FROM rasa/rasa-sdk:2.8.0 +FROM rasa/rasa-sdk:2.8.3 # Use subdirectory as working directory WORKDIR /app diff --git a/requirements.txt b/requirements.txt index 159ffbed5..1aae3d573 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -rasa==2.8.2 # NB! when updating, make sure to also update: +rasa==2.8.17 # NB! when updating, make sure to also update: # * rasa-sdk base image in Dockerfile # * RASA_VERSION and RASA_X_VERSION in .github/workflows/continuous-deployment.yml -r actions/requirements-actions.txt From 37a7e623d62c389e5876aa7ff6ba9d608e0943a8 Mon Sep 17 00:00:00 2001 From: melindaloubser1 Date: Wed, 26 Jan 2022 12:55:17 +0200 Subject: [PATCH 2/9] 1.0 --- .github/deployments/helmfile.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/deployments/helmfile.yaml b/.github/deployments/helmfile.yaml index ec8890f65..60d88761d 100644 --- a/.github/deployments/helmfile.yaml +++ b/.github/deployments/helmfile.yaml @@ -59,6 +59,10 @@ releases: name: {{ requiredEnv "ACTION_SERVER_SECRET_NAME" }} key: "ALGOLIA_DOCS_INDEX" - postgresql: + tag: "12.9.0" + extraEnv: + - name: PGDATA + value: /bitnami/postgresql/data_12 persistence: existingClaim: {{ requiredEnv "POSTGRES_PVC" }} - global: @@ -93,6 +97,7 @@ releases: tag: {{ requiredEnv "RASA_VERSION" }}-full versions: rasaProduction: + enabled: true resources: requests: memory: {{ .Values.rasaProduction.resources.requests.memory }} @@ -111,8 +116,9 @@ releases: session_persistence: true rest: {} - rabbitmq: - rabbitmq: + auth: password: {{ requiredEnv "RABBITMQ_PASSWORD" }} + erlangCookie: {{ requiredEnv "RABBITMQ_ERLANGCOOKIE" }} - eventService: tag: {{ requiredEnv "RASA_X_VERSION" }} name: {{ requiredEnv "RASA_X_IMAGE_NAME" }} From f993781683adff756535a9dd557956dc76282449 Mon Sep 17 00:00:00 2001 From: melindaloubser1 Date: Wed, 26 Jan 2022 12:58:22 +0200 Subject: [PATCH 3/9] add rabbitmqerlangcookie --- .github/workflows/continuous_deployment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/continuous_deployment.yml b/.github/workflows/continuous_deployment.yml index 1256af647..ce06c57ec 100644 --- a/.github/workflows/continuous_deployment.yml +++ b/.github/workflows/continuous_deployment.yml @@ -23,6 +23,7 @@ env: RASA_X_PVC: ${{ secrets.RASA_X_PVC }} POSTGRES_PVC: ${{ secrets.POSTGRES_PVC }} RABBITMQ_PASSWORD: ${{ secrets.RABBITMQ_PASSWORD }} + RABBITMQ_ERLANGCOOKIE: ${{ secrets.RABBITMQ_ERLANGCOOKIE }} REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }} RASA_TOKEN: ${{ secrets.RASA_TOKEN }} RASA_X_TOKEN: ${{ secrets.RASA_X_TOKEN }} From 512d3223c5c01e0d752608b56d56b89372fc10a8 Mon Sep 17 00:00:00 2001 From: melindaloubser1 Date: Fri, 28 Jan 2022 10:35:15 +0200 Subject: [PATCH 4/9] rename tags endpoint --- actions/api/rasaxapi.py | 2 +- tests/test_actions.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/actions/api/rasaxapi.py b/actions/api/rasaxapi.py index 1e2520de1..e39d33eaa 100644 --- a/actions/api/rasaxapi.py +++ b/actions/api/rasaxapi.py @@ -44,7 +44,7 @@ def tag_convo(self, tracker: Tracker, label: Text) -> requests.Response: """Tag a conversation in Rasa X with a given label""" auth_header = self.get_auth_header() endpoint = ( - f"{self.schema}://{self.host}/api/conversations/{tracker.sender_id}/tags" + f"{self.schema}://{self.host}/api/conversations/{tracker.sender_id}/data-tags" ) response = requests.post(url=endpoint, data=label, headers=auth_header) return response diff --git a/tests/test_actions.py b/tests/test_actions.py index 82b39d86a..1860dab0a 100644 --- a/tests/test_actions.py +++ b/tests/test_actions.py @@ -34,7 +34,6 @@ def test_action_tag_feedback( domain: DomainDict, feedback_value: Text, expected_tags: List[Dict], - rasa_x_convo: None, rasa_x_auth_header: Dict[Text, Text], rasa_x_conversation_endpoint: Text, ): @@ -45,7 +44,7 @@ def test_action_tag_feedback( assert actual_events == expected_events tag_response = requests.get( - f"{rasa_x_conversation_endpoint}/{tracker.sender_id}/tags", + f"{rasa_x_conversation_endpoint}/{tracker.sender_id}/data-tags", headers=rasa_x_auth_header, ) actual_tags = [{"value": tag.get("value")} for tag in tag_response.json()] From a5a0e0c7eb33d86e106e343056b82da695e04623 Mon Sep 17 00:00:00 2001 From: melindaloubser1 Date: Fri, 28 Jan 2022 10:37:16 +0200 Subject: [PATCH 5/9] forms keyword --- domain.yml | 66 +++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/domain.yml b/domain.yml index 13ed910a6..b894e09ef 100644 --- a/domain.yml +++ b/domain.yml @@ -542,34 +542,37 @@ actions: - validate_sales_form forms: playground_form: - problem_description: - - type: from_text + required_slots: + problem_description: + - type: from_text suggestion_form: - suggestion: - - type: from_text + required_slots: + suggestion: + - type: from_text sales_form: - budget: - - entity: amount-of-money - type: from_entity - - entity: number - type: from_entity - - intent: enter_data - type: from_text - business_email: - - entity: email - type: from_entity - - intent: enter_data - type: from_text - company: - - entity: company - type: from_entity - - intent: enter_data - type: from_text - job_function: - - entity: job_function - type: from_entity - - intent: enter_data - type: from_text + required_slots: + budget: + - entity: amount-of-money + type: from_entity + - entity: number + type: from_entity + - intent: enter_data + type: from_text + business_email: + - entity: email + type: from_entity + - intent: enter_data + type: from_text + company: + - entity: company + type: from_entity + - intent: enter_data + type: from_text + job_function: + - entity: job_function + type: from_entity + - intent: enter_data + type: from_text person_name: - entity: name type: from_entity @@ -579,9 +582,10 @@ forms: - intent: enter_data type: from_text subscribe_newsletter_form: - email: - - entity: email - type: from_entity - - intent: enter_data - type: from_text + required_slots: + email: + - entity: email + type: from_entity + - intent: enter_data + type: from_text e2e_actions: [] From 4f53ec475061493b75fab40d2be68551d31d4430 Mon Sep 17 00:00:00 2001 From: melindaloubser1 Date: Fri, 28 Jan 2022 10:48:17 +0200 Subject: [PATCH 6/9] reformat --- actions/api/rasaxapi.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/actions/api/rasaxapi.py b/actions/api/rasaxapi.py index e39d33eaa..cc7841fd8 100644 --- a/actions/api/rasaxapi.py +++ b/actions/api/rasaxapi.py @@ -43,8 +43,6 @@ def get_auth_header(self): def tag_convo(self, tracker: Tracker, label: Text) -> requests.Response: """Tag a conversation in Rasa X with a given label""" auth_header = self.get_auth_header() - endpoint = ( - f"{self.schema}://{self.host}/api/conversations/{tracker.sender_id}/data-tags" - ) + endpoint = f"{self.schema}://{self.host}/api/conversations/{tracker.sender_id}/data-tags" response = requests.post(url=endpoint, data=label, headers=auth_header) return response From 3ffc99ddda2e9b778efbf8233a9c009576117039 Mon Sep 17 00:00:00 2001 From: melindaloubser1 Date: Fri, 28 Jan 2022 13:22:10 +0200 Subject: [PATCH 7/9] rename tags --- tests/api/test_rasaxapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/api/test_rasaxapi.py b/tests/api/test_rasaxapi.py index eb47212e9..5310665f6 100644 --- a/tests/api/test_rasaxapi.py +++ b/tests/api/test_rasaxapi.py @@ -24,7 +24,7 @@ def test_tag_convo( rasax = RasaXAPI() rasax.tag_convo(tracker, labeldata) tag_response = requests.get( - f"{rasa_x_conversation_endpoint}/{tracker.sender_id}/tags", + f"{rasa_x_conversation_endpoint}/{tracker.sender_id}/data-tags", headers=rasa_x_auth_header, ) actual_tags = [{"value": tag.get("value")} for tag in tag_response.json()] From 802c16c5ea70dab8763e7b612e4802261c28b464 Mon Sep 17 00:00:00 2001 From: melindaloubser1 Date: Fri, 28 Jan 2022 16:07:21 +0200 Subject: [PATCH 8/9] remaining tag renames --- tests/api/test_rasaxapi.py | 2 ++ tests/test_actions.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/api/test_rasaxapi.py b/tests/api/test_rasaxapi.py index 5310665f6..348b3c2b8 100644 --- a/tests/api/test_rasaxapi.py +++ b/tests/api/test_rasaxapi.py @@ -1,10 +1,12 @@ import requests from typing import Dict, Text +import logging from rasa_sdk import Tracker from actions.api.rasaxapi import RasaXAPI +logger = logging.getLogger(__name__) def test_get_auth(): rasax = RasaXAPI() diff --git a/tests/test_actions.py b/tests/test_actions.py index 1860dab0a..56ecb3f6c 100644 --- a/tests/test_actions.py +++ b/tests/test_actions.py @@ -34,8 +34,9 @@ def test_action_tag_feedback( domain: DomainDict, feedback_value: Text, expected_tags: List[Dict], + rasa_x_convo: None, rasa_x_auth_header: Dict[Text, Text], - rasa_x_conversation_endpoint: Text, + rasa_x_conversation_endpoint: Text ): tracker.slots["feedback_value"] = feedback_value action = actions.ActionTagFeedback() @@ -76,7 +77,7 @@ def test_action_tag_docs_search( assert actual_events == expected_events tag_response = requests.get( - f"{rasa_x_conversation_endpoint}/{tracker.sender_id}/tags", + f"{rasa_x_conversation_endpoint}/{tracker.sender_id}/data-tags", headers=rasa_x_auth_header, ) actual_tags = [{"value": tag.get("value")} for tag in tag_response.json()] From 9e8c9825014c79cec21155849922f92ac2d6288f Mon Sep 17 00:00:00 2001 From: melindaloubser1 Date: Mon, 31 Jan 2022 09:24:49 +0200 Subject: [PATCH 9/9] reformat --- tests/api/test_rasaxapi.py | 1 + tests/test_actions.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/api/test_rasaxapi.py b/tests/api/test_rasaxapi.py index 348b3c2b8..3653d9d86 100644 --- a/tests/api/test_rasaxapi.py +++ b/tests/api/test_rasaxapi.py @@ -8,6 +8,7 @@ logger = logging.getLogger(__name__) + def test_get_auth(): rasax = RasaXAPI() actual_auth_headers = rasax.get_auth_header() diff --git a/tests/test_actions.py b/tests/test_actions.py index 56ecb3f6c..2277c6c4a 100644 --- a/tests/test_actions.py +++ b/tests/test_actions.py @@ -36,7 +36,7 @@ def test_action_tag_feedback( expected_tags: List[Dict], rasa_x_convo: None, rasa_x_auth_header: Dict[Text, Text], - rasa_x_conversation_endpoint: Text + rasa_x_conversation_endpoint: Text, ): tracker.slots["feedback_value"] = feedback_value action = actions.ActionTagFeedback()