Skip to content

Commit d55414b

Browse files
authored
Merge branch 'master' into bert-docs
2 parents c027ad3 + 90dde9d commit d55414b

File tree

13 files changed

+651
-156
lines changed

13 files changed

+651
-156
lines changed

CHANGELOG.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,35 @@ This project adheres to `Semantic Versioning`_ starting with version 1.0.
1717

1818
.. towncrier release notes start
1919
20+
[1.9.5] - 2020-04-01
21+
^^^^^^^^^^^^^^^^^^^^
22+
23+
Improvements
24+
------------
25+
- `#5533 <https://github.com/rasahq/rasa/issues/5533>`_: Support for
26+
`PostgreSQL schemas <https://www.postgresql.org/docs/11/ddl-schemas.html>`_ in
27+
:ref:`sql-tracker-store`. The ``SQLTrackerStore``
28+
accesses schemas defined by the ``POSTGRESQL_SCHEMA`` environment variable if
29+
connected to a PostgreSQL database.
30+
31+
The schema is added to the connection string option's ``-csearch_path`` key, e.g.
32+
``-options=-csearch_path=<SCHEMA_NAME>`` (see
33+
`<https://www.postgresql.org/docs/11/contrib-dblink-connect.html>`_ for more details).
34+
As before, if no ``POSTGRESQL_SCHEMA`` is defined, Rasa uses the database's default
35+
schema (``public``).
36+
37+
The schema has to exist in the database before connecting, i.e. it needs to have been
38+
created with
39+
40+
.. code-block:: postgresql
41+
42+
CREATE SCHEMA schema_name;
43+
44+
Bugfixes
45+
--------
46+
- `#5547 <https://github.com/rasahq/rasa/issues/5547>`_: Fixed ambiguous logging in ``DIETClassifier`` by adding the name of the calling class to the log message.
47+
48+
2049
[1.9.4] - 2020-03-30
2150
^^^^^^^^^^^^^^^^^^^^
2251

CONTRIBUTING.md

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
<div class="toc">
2+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
3+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
4+
5+
- [How to open a GitHub issue & file a bug report](#how-to-open-a-github-issue--file-a-bug-report)
6+
- [Working on a new feature or filing a bug report](#working-on-a-new-feature-or-filing-a-bug-report)
7+
- [Working on an existing feature](#working-on-an-existing-feature)
8+
- [How to open a GitHub Pull Request](#how-to-open-a-github-pull-request)
9+
- [What is a Pull Request (PR)?](#what-is-a-pull-request-pr)
10+
- [What to know before opening a PR](#what-to-know-before-opening-a-pr)
11+
- [Opening issues before PRs](#opening-issues-before-prs)
12+
- [Draft PRs](#draft-prs)
13+
- [PRs should be a reasonable length](#prs-should-be-a-reasonable-length)
14+
- [Code style](#code-style)
15+
- [Formatting and Type Checking](#### Formatting and Type Checking)
16+
- [How to open a PR and contribute code to Rasa Open Source](#how-to-open-a-pr-and-contribute-code-to-rasa-open-source)
17+
- [1. Forking the Rasa Repository](#1-forking-the-rasa-repository)
18+
- [2. Cloning the Forked Repository Locally](#2-cloning-the-forked-repository-locally)
19+
- [3. Update your Forked Repository](#3-update-your-forked-repository)
20+
- [4. Implement your code contribution](#4-implement-your-code-contribution)
21+
- [5. Push changes to your forked repository on GitHub](#5-push-changes-to-your-forked-repository-on-github)
22+
- [6. Opening the Pull Request on Rasa Open Source](#6-opening-the-pull-request-on-rasa-open-source)
23+
- [7. Signing the Contributor Licence Agreement (CLA)](#7-signing-the-contributor-licence-agreement-cla)
24+
- [8. Merging your PR and the final steps of your contribution](#8-merging-your-pr-and-the-final-steps-of-your-contribution)
25+
- [9. Share your contributions with the world!](#9-share-your-contributions-with-the-world)
26+
- [10. Non-code contributions](#10-non-code-contributions)
27+
28+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
29+
</div>
30+
31+
---
32+
33+
## How to open a GitHub issue & file a bug report
34+
35+
### Working on a new feature or fixing a bug
36+
37+
If you would like to add a new feature or fix an existing bug, we prefer that you open a new issue on the Rasa repository before creating a pull request.
38+
39+
It’s important to note that when opening an issue, you should first do a quick search of existing issues to make sure your suggestion hasn’t already been added as an issue.
40+
If your issue doesn’t already exist, and you’re ready to create a new one, make sure to state what you would like to implement, improve or bugfix. We have provided templates to make this process easier for you.
41+
42+
**To open a Github issue, go to the RasaHQ repository, select “Issues”, “New Issue” then “Feature Request” or “Bug Report” and fill out the template.**
43+
44+
![](https://www.rasa.com/assets/img/contributor-guidelines/opening-new-issue.png)
45+
46+
The Rasa team will then get in touch with you to discuss if the proposed feature aligns with the company's roadmap, and we will guide you along the way in shaping the proposed feature so that it could be merged to the Rasa codebase.
47+
48+
### Working on an existing feature
49+
50+
If you want to contribute code, but don't know what to work on, check out the Rasa contributors board to find existing open issues.
51+
52+
The issues are handpicked by the Rasa team to have labels which correspond to the difficulty/estimated time needed to resolve the issue.
53+
54+
**To work on an existing issue, go to the contributor project board, add a comment stating you would like to work on it and include any solutions you may already have in mind.**
55+
56+
![](https://www.rasa.com/assets/img/contributor-guidelines/exiting-issue-sara.png)
57+
58+
Someone from Rasa will then assign that issue to you and help you along the way.
59+
60+
---
61+
62+
## How to open a GitHub Pull Request
63+
64+
### What is a Pull Request (PR)?
65+
66+
This is how the GitHub team defines a PR:
67+
68+
> “Pull requests let you tell others about changes you’ve pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.”
69+
70+
This process is used by both Rasa team members and Rasa contributors to make changes and improvements to Rasa Open Source.
71+
72+
### What to know before opening a PR
73+
74+
#### Opening issues before PRs
75+
76+
We usually recommend opening an issue before a pull request if there isn’t already an issue for the problem you’d like to solve. This helps facilitate a discussion before deciding on an implementation. See How to open a GitHub issue & file a bug report.
77+
78+
#### Draft PRs
79+
80+
If you're ready to get some quick initial feedback from the Rasa team, you can create a draft pull request.
81+
82+
#### PRs should be a reasonable length
83+
84+
If your PR is greater than 500 lines, please consider splitting it into multiple smaller contributions.
85+
86+
#### Code style
87+
88+
To ensure a standardized code style we recommend using formatter black. To ensure our type annotations are correct we also suggest using the type checker pytype.
89+
90+
#### Formatting and Type Checking
91+
92+
If you want to automatically format your code on every commit, you can use pre-commit. Just install it via `pip install pre-commit` and execute `pre-commit install` in the root folder. This will add a hook to the repository, which reformats files on every commit.
93+
94+
If you want to set it up manually, install black via `pip install -r requirements-dev.txt.` To reformat files execute `make formatter`.
95+
96+
If you want to check types on the codebase, install pytype using `pip install -r requirements-dev.txt`. To check the types execute `make types`.
97+
98+
The CI/CD tests that we run can be found in the [continous-integration.yml](https://github.com/RasaHQ/rasa/blob/master/.github/workflows/continous-integration.yml) file.
99+
100+
---
101+
102+
## How to open a PR and contribute code to Rasa Open Source
103+
104+
#### 1. Forking the Rasa Repository
105+
106+
Head to Rasa repository and click ‘Fork’. Forking a repository creates you a copy of the project which you can edit and use to propose changes to the original project.
107+
108+
![](https://www.rasa.com/assets/img/contributor-guidelines/fork.png)
109+
110+
Once you fork it, a copy of the Rasa repository will appear inside your GitHub repository list.
111+
112+
#### 2. Cloning the Forked Repository Locally
113+
114+
To make changes to your copy of the Rasa repository, clone the repository on your local machine. To do that, run the following command in your terminal:
115+
116+
```
117+
git clone https://github.com/your_github_username/rasa.git
118+
```
119+
120+
The link to the repository can be found after clicking Clone or download button as shown in the image below:
121+
122+
![](https://www.rasa.com/assets/img/contributor-guidelines/clone.png)
123+
124+
Note: this assumes you have git installed on your local machine. If not, check out the [following guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) to learn how to install it.
125+
126+
#### 3. Update your Forked Repository
127+
128+
Before you make any changes to your cloned repository, make sure you have the latest version of the original Rasa repository. To do that, run the following commands in your terminal:
129+
130+
```
131+
cd rasa
132+
git remote add upstream git://github.com/RasaHQ/rasa.git
133+
git pull upstream master
134+
```
135+
136+
This will update the local copy of the Rasa repository to the latest version.
137+
138+
#### 4. Implement your code contribution
139+
140+
At this point, you are good to make changes to the files in the local directory of your project.
141+
142+
Alternatively, you can create a new branch which will contain the implementation of your contribution. To do that, run:
143+
144+
```
145+
git checkout -b name-of-your-new-branch
146+
```
147+
148+
#### 5. Push changes to your forked repository on GitHub
149+
150+
Once you are happy with the changes you made in the local files, push them to the forked repository on GitHub. To do that, run the following commands:
151+
152+
```
153+
git add .
154+
git commit -m ‘fixed a bug’
155+
git push origin name-of-your-new-branch
156+
```
157+
158+
This will create a new branch on your forked Rasa repository, and now you’re ready to create a Pull Request with your proposed changes!
159+
160+
#### 6. Opening the Pull Request on Rasa Open Source
161+
162+
Head to the forked repository and click on a _Compare & pull_ request button.
163+
164+
![](https://www.rasa.com/assets/img/contributor-guidelines/openpr-1.png)
165+
166+
This will open a window where you can choose the repository and branch you would like to propose your changes to, as well as specific details of your contribution. In the top panel menu choose the following details:
167+
168+
- Base repository: RasaHQ/rasa
169+
- Base branch: master
170+
- Head repository: your_github_username/rasa
171+
- Head branch: name-of-your-new-branch
172+
173+
![](https://www.rasa.com/assets/img/contributor-guidelines/openpr-2.png)
174+
175+
Next, make sure to update the pull request card with as many details about your contribution as possible. _Proposed changes_ section should contain the details of what has been fixed/implemented, and Status should reflect the status of your contributions. Any reasonable change (not like a typo) should include a changelog entry, a bug fix should have a test, a new feature should have documentation, etc.
176+
177+
If you are ready to get feedback on your contribution from the Rasa team, tick the _made PR ready for code review_ and _allow edits from maintainers_ box.
178+
179+
Once you are happy with everything, click the _Create pull request_ button. This will create a Pull Request with your proposed changes.
180+
181+
![](https://www.rasa.com/assets/img/contributor-guidelines/openpr-3.png)
182+
183+
#### 7. Signing the Contributor Licence Agreement (CLA)
184+
185+
To merge your contributions to the Rasa codebase, you will have to sign a Contributor License Agreement (CLA).
186+
187+
It is necessary for us to know that you agree for your code to be included into the Rasa codebase and allow us to use it in our later releases. You can find a detailed Rasa Contributor Licence Agreement [here](https://cla-assistant.io/RasaHQ/rasa).
188+
189+
#### 8. Merging your PR and the final steps of your contribution
190+
191+
Once you sign the CLA, a member from the Rasa team will get in touch with you with the feedback on your contribution. In some cases, contributions are accepted right away, but often, you may be asked to make some edits/improvements. Don’t worry if you are asked to change something - it’s a completely normal part of software development.
192+
193+
If you have been requested to make changes to your contribution, head back to the local copy of your repository on your machine, implement the changes and push them to your contribution branch by repeating instructions from step 5. Your pull request will automatically be updated with the changes you pushed. Once you've implemented all of the suggested changes, tag the person who first reviewed your contribution by mentioning them in the comments of your PR to ask them to take another look.
194+
Finally, if your contribution is accepted, the Rasa team member will merge it to the Rasa codebase.
195+
196+
#### 9. Share your contributions with the world!
197+
198+
Contributing to open source can take a lot of time and effort, so you should be proud of the great work you have done!
199+
Let the world know that you have become a contributor to the Rasa open source project by posting about it on your social media (make sure to tag @RasaHQ as well), mention the contribution on your CV and get ready to get some really cool [Rasa contributor swag](https://blog.rasa.com/announcing-the-rasa-contributor-program/)!
200+
201+
#### 10. Non-code contributions
202+
203+
Contributing doesn’t start and end with code. You can support the project by planning community events, creating tutorials, helping fellow community members find answers to their questions or translating documentation and news. Every contribution matters! You can find more details [on our website](https://rasa.com/community/contribute/).

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B8141%2Fgit%40github.com%3ARasaHQ%2Frasa.git.svg?type=shield)](https://app.fossa.com/projects/custom%2B8141%2Fgit%40github.com%3ARasaHQ%2Frasa.git?ref=badge_shield)
1010
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/orgs/RasaHQ/projects/23)
1111

12-
<img align="right" height="244" src="https://www.rasa.com/assets/img/sara/sara-open-source-lg.png">
12+
<img align="right" height="244" src="https://www.rasa.com/assets/img/sara/sara-open-source-2.0.png">
1313

1414
Rasa is an open source machine learning framework to automate text-and voice-based conversations. With Rasa, you can build contexual assistants on:
1515
- Facebook Messenger
@@ -73,9 +73,7 @@ questions.
7373
- [License](#license)
7474

7575
### How to contribute
76-
We are very happy to receive and merge your contributions. You can
77-
find more information about how to contribute to Rasa (in lots of
78-
different ways!) [here](http://rasa.com/community/contribute).
76+
We are very happy to receive and merge your contributions into this repository!
7977

8078
To contribute via pull request, follow these steps:
8179

@@ -84,6 +82,11 @@ To contribute via pull request, follow these steps:
8482
2. Write your code, tests and documentation, and format them with ``black``
8583
3. Create a pull request describing your changes
8684

85+
For more detailed instructions on how to contribute code, check out these [code contributor guidelines](CONTRIBUTING.md).
86+
87+
You can find more information about how to contribute to Rasa (in lots of
88+
different ways!) [on our website.](http://rasa.com/community/contribute).
89+
8790
Your pull request will be reviewed by a maintainer, who will get
8891
back to you about any necessary changes or questions. You will
8992
also be asked to sign a

docs/user-guide/docker/deploying-in-docker-compose.rst

Lines changed: 3 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ REST channel, uncomment this section in the ``credentials.yml``:
4848
The REST channel will open your bot up to incoming requests at the ``/webhooks/rest/webhook`` endpoint.
4949

5050

51+
.. _running-multiple-services:
52+
5153
Using Docker Compose to Run Multiple Services
5254
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5355

@@ -101,7 +103,7 @@ an action server image, see :ref:`building-an-action-server-image`.
101103
command:
102104
- run
103105
app:
104-
image: <your action server image>
106+
image: <image:tag>
105107
expose: 5055
106108
107109
The ``expose: 5005`` is what allows the ``rasa`` service to reach the ``app`` service on that port.
@@ -127,106 +129,6 @@ corresponds to a :ref:`configured channel <docker-compose-configuring-channels>`
127129
-H "Content-type: application/json" \
128130
-d '{"sender": "test", "message": "hello"}'
129131
130-
.. _building-an-action-server-image:
131-
132-
Building an Action Server Image
133-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134-
135-
If you build an image that includes your action code and store it in a container registry, you can run it locally
136-
or as part of your deployment, without having to move code between servers.
137-
In addition, you can add any additional dependencies of systems or Python libraries
138-
that are part of your action code but not included in the base ``rasa/rasa-sdk`` image.
139-
140-
This documentation assumes you are pushing your images to `DockerHub <https://hub.docker.com/>`_.
141-
DockerHub will let you host multiple public repositories and
142-
one private repository for free. Be sure to first `create an account <https://hub.docker.com/signup/>`_
143-
and `create a repository <https://hub.docker.com/signup/>`_ to store your images. You could also push images to
144-
a different Docker registry, such as `Google Container Registry <https://cloud.google.com/container-registry>`_,
145-
`Amazon Elastic Container Registry <https://aws.amazon.com/ecr/>`_, or
146-
`Azure Container Registry <https://azure.microsoft.com/en-us/services/container-registry/>`_.
147-
148-
To create your image:
149-
150-
#. Move your actions code to a folder ``actions`` in your project directory.
151-
Make sure to also add an empty ``actions/__init__.py`` file:
152-
153-
.. code-block:: bash
154-
155-
mkdir actions
156-
mv actions.py actions/actions.py
157-
touch actions/__init__.py # the init file indicates actions.py is a python module
158-
159-
The ``rasa/rasa-sdk`` image will automatically look for the actions in ``actions/actions.py``.
160-
161-
#. If your actions have any extra dependencies, create a list of them in a file,
162-
``actions/requirements-actions.txt``.
163-
#. Create a file named ``Dockerfile`` in your project directory,
164-
in which you'll extend the official SDK image, copy over your code, and add any custom dependencies (if necessary).
165-
For example:
166-
167-
.. parsed-literal::
168-
169-
# Extend the official Rasa SDK image
170-
FROM rasa/rasa-sdk:\ |version|.0
171-
172-
# Use subdirectory as working directory
173-
WORKDIR /app
174-
175-
# Copy any additional custom requirements
176-
COPY actions/requirements-actions.txt ./
177-
178-
# Change back to root user to install dependencies
179-
USER root
180-
181-
# Install extra requirements for actions code, if necessary (otherwise comment this out)
182-
RUN pip install -r requirements-actions.txt
183-
184-
# Copy actions folder to working directory
185-
COPY ./actions /app/actions
186-
187-
# By best practices, don't run the code with root user
188-
USER 1001
189-
190-
You can then build the image via the following command:
191-
192-
.. code-block:: bash
193-
194-
docker build . -t <account_username>/<repository_name>:<custom_image_tag>
195-
196-
The ``<custom_image_tag>`` should reference how this image will be different from others. For
197-
example, you could version or date your tags, as well as create different tags that have different code for production
198-
and development servers. You should create a new tag any time you update your code and want to re-deploy it.
199-
200-
If you are using Docker Compose locally, you can use this image directly in your
201-
``docker-compose.yml``:
202-
203-
.. code-block:: yaml
204-
205-
version: '3.0'
206-
services:
207-
app:
208-
image: <account_username>/<repository_name>:<custom_image_tag>
209-
210-
If you're building this image to make it available from another server,
211-
for example a Rasa X or Rasa Enterprise deployment, you should push the image to a cloud repository.
212-
You can push the image to DockerHub via:
213-
214-
.. code-block:: bash
215-
216-
docker login --username <account_username> --password <account_password>
217-
docker push <account_username>/<repository_name>:<custom_image_tag>
218-
219-
To authenticate and push images to a different container registry, please refer to the documentation of
220-
your chosen container registry.
221-
222-
Then, reference the new image tag in your ``docker-compose.override.yml``:
223-
224-
.. code-block:: yaml
225-
226-
version: '3.0'
227-
services:
228-
app:
229-
image: <account_username>/<repository_name>:<custom_image_tag>
230132
231133
Configuring a Tracker Store
232134
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)