From 3bc8e5f486ae335fa66fa006a639a9933aa3546b Mon Sep 17 00:00:00 2001 From: Tobias Wochinger Date: Wed, 11 Mar 2020 09:10:13 +0100 Subject: [PATCH 1/3] switch to newer 'async' syntax --- docs/user-guide/how-to-deploy.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/how-to-deploy.rst b/docs/user-guide/how-to-deploy.rst index 6b846998ef81..b8a03d0e18b5 100644 --- a/docs/user-guide/how-to-deploy.rst +++ b/docs/user-guide/how-to-deploy.rst @@ -332,7 +332,7 @@ Then build a custom action using the Rasa SDK, e.g.: def name(self): return "action_joke" - def run(self, dispatcher, tracker, domain): + async def run(self, dispatcher, tracker, domain): request = requests.get('http://api.icndb.com/jokes/random').json() # make an api call joke = request['value']['joke'] # extract a joke from returned json response dispatcher.utter_message(text=joke) # send the message back to the user From ddb688417beead193da1b37506883914fc9b7588 Mon Sep 17 00:00:00 2001 From: Tobias Wochinger Date: Wed, 11 Mar 2020 09:10:39 +0100 Subject: [PATCH 2/3] clarify no-root user usage with sdk image --- docs/user-guide/how-to-deploy.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/user-guide/how-to-deploy.rst b/docs/user-guide/how-to-deploy.rst index b8a03d0e18b5..bb0f0c698dfe 100644 --- a/docs/user-guide/how-to-deploy.rst +++ b/docs/user-guide/how-to-deploy.rst @@ -396,6 +396,10 @@ image and add your custom dependencies. For example: # Extend the official Rasa SDK image FROM rasa/rasa-sdk:latest + # The Rasa SDK image runs as non-root user by default. Hence, you have to switch + # back to the `root` user if you want to install additional dependencies. + USER root + # Add a custom system library (e.g. git) RUN apt-get update && \ apt-get install -y git @@ -403,6 +407,9 @@ image and add your custom dependencies. For example: # Add a custom python library (e.g. jupyter) RUN pip install --no-cache-dir jupyter + # Switch back to a non-root user + USER 1001 + You can then build the image via the following command, and use it in your ``docker-compose.yml`` instead of the ``rasa/rasa-sdk`` image. From 28c9b3ade0b04c7fbc756e4a422ad4908e2e91ed Mon Sep 17 00:00:00 2001 From: Tobias Wochinger Date: Wed, 11 Mar 2020 09:16:11 +0100 Subject: [PATCH 3/3] add changelog entry --- changelog/5404.doc.rst | 5 +++++ docs/user-guide/how-to-deploy.rst | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 changelog/5404.doc.rst diff --git a/changelog/5404.doc.rst b/changelog/5404.doc.rst new file mode 100644 index 000000000000..d27dc40af44c --- /dev/null +++ b/changelog/5404.doc.rst @@ -0,0 +1,5 @@ +Explain how to run commands as ``root`` user in Rasa SDK Docker images since version +``1.8.0``. Since version ``1.8.0`` the Rasa SDK Docker images does not longer run as +``root`` user by default. For commands which require ``root`` user usage, you have to +switch back to the ``root`` user in your Docker image as described in +:ref:`deploying-your-rasa-assistant_custom-dependencies`. diff --git a/docs/user-guide/how-to-deploy.rst b/docs/user-guide/how-to-deploy.rst index bb0f0c698dfe..b2142365427e 100644 --- a/docs/user-guide/how-to-deploy.rst +++ b/docs/user-guide/how-to-deploy.rst @@ -382,6 +382,8 @@ Add this to your ``endpoints.yml`` (if it does not exist, create it): Run ``docker-compose up`` to start the action server together with Rasa. +.. _deploying-your-rasa-assistant_custom-dependencies: + Adding Custom Dependencies **************************