notice

This is documentation for Rasa X/Enterprise Documentation v1.1.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (1.4.x).

Version: 1.1.x

Database

Rasa Enterprise is officially compatible with the following databases:

  • PostgreSQL

  • Oracle ≥ 11.0

By default, Rasa Enterprise uses PostgreSQL as a database. It can be configured to use an on-premise database or your own cloud provided database. Using Oracle as your Rasa Enterprise database instead of PostgreSQL also requires some additional setup (see below).

PostgreSQL

The default database started by the Rasa Enterprise Helm chart is PostgreSQL, which refers to the PostgreSQL subchart. See the page on configuring the subcharts to configure the default instance or to use an external Postgres instance.

Oracle

Using Oracle as your Rasa Enterprise database instead of PostgreSQL requires some additional setup, which we’ll go over here.

  1. Database Setup

    In your Oracle database, create an empty database called rasa and configure a user/password that has access to it. You can also use a database with a different name, as long as it is empty and you specify this in the DB_DATABASE environment variable (read more in Adding Environment Variables).

  2. Rasa Enterprise Configuration

    Next you have to extend the Rasa Enterprise image to include the necessary drivers and clients. First download the Oracle Instant Client, rename it to oracle.rpm and store it in the directory from where you’ll be building the Docker image.

    Copy the following into a file called Dockerfile:

    FROM rasa/rasa-x:1.1.3
    # Switch to root user to install packages
    USER root
    RUN apt-get update -qq && apt-get install -y --no-install-recommends alien libaio1 && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
    # Copy in oracle instaclient
    # [https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html)
    COPY oracle.rpm oracle.rpm
    # Install the Python wrapper library for the Oracle drivers
    RUN pip install cx-Oracle
    # Install Oracle client libraries
    RUN alien -i oracle.rpm
    USER 1001

    Then build the Docker image:

    docker build . -t rasa/rasa-x:1.1.3-oracle

    Then push it to your private image registry.

    You can now use this image instead of the standard one, by replacing it in your values.yml:

    rasax:
    name: "<your-registry/your-extended-image>"
    tag: "<tag-for-extended-image>"

You will also have to disable installing Postgres and configure the following environment variables and a secret for the rasax, eventService and dbMigrationService sections.

Create the secret as follows:

# This will prompt for the oracle password and not echo the characters to your screen
read -s ORACLE_PASSWORD
kubectl create secret generic oracle-password --from-literal=oracle-password="${ORACLE_PASSWORD}"

And update the values.yaml as follows:

postgresql:
install: false
rasax:
extraEnvs:
- name: "DB_USER"
value: "<user>"
- name: "DB_PASSWORD"
valueFrom:
secretKeyRef:
key: oracle-password
name: oracle-password
- name: "DB_DATABASE"
value: "rasa"
- name: "DB_DRIVER"
value: "oracle+cx_oracle"
- name: "DB_PORT"
value: "<port of db>"
- name: "DB_HOST"
value: "<host of db>"
- name: "DB_QUERY"
value: "<query>"
dbMigrationService:
extraEnvs:
<as above>
eventService:
extraEnvs:
<as above>

Alternatively, you can also directly pass the database connection URL to the container, by defining the DB_URL variable (this is not advised as it leaves the database password in plaintext):

rasax:
extraEnvs:
- name: "DB_URL"
value: "oracle+cx_oracle://user:password@your.database.com:<port>/<database name>"
dbMigrationService:
extraEnvs:
<as above>
eventService:
extraEnvs:
<as above>
note

The settings above do not set up Oracle as a tracker store. To use Oracle for the tracker store, please see the Rasa Open Source docs and configure the endpoints for your Rasa Open Source servers correctly.