Setup and installation

In this guide, we will help you to get up and running with Rubrix. Basically, you need to:

  1. Install the Python client

  2. Launch the web app

1. Install the Rubrix Python client

First, make sure you have Python 3.6 or above installed.

Then you can install Rubrix with pip:

pip install rubrix

2. Setup and launch the webapp

There are two ways to launch the webapp:

  1. Using docker-compose (recommended).

  2. Executing the server code manually

Executing the server code manually

When executing the server code manually you need to provide an Elasticsearch instance yourself. This method may be preferred if you (1) want to avoid or cannot use Docker, (2) have an existing Elasticsearch service, or (3) want to have full control over your Elasticsearch configuration.

  1. First you need to install Elasticsearch (we recommend version 7.10) and launch an Elasticsearch instance. For MacOS and Windows there are Homebrew formulae and a msi package, respectively. If you already have an Elasticsearch instance, see the section “Configuring your Elasticsearch instance for Rubrix” below.

  2. Install the Rubrix Python library together with its server dependencies:

pip install rubrix[server]
  1. Launch a local instance of the Rubrix web app

python -m rubrix.server

By default, the Rubrix server will look for your Elasticsearch endpoint at http://localhost:9200. If you want to customize this, you can set the ELASTICSEARCH environment variable pointing to your endpoint.

Configuring your Elasticsearch instance for Rubrix

If you have an Elasticsearch instance and want to share resources with other applications, you can easily configure it for using Rubrix.

All you need to take into account is:

  • Rubrix will create its ES indices with the following pattern .rubrix_*. It’s recommended to create a new role (e.g., rubrix) and provide it with all privileges for this index pattern.

  • Rubrix creates an index template for these indices, so you may provide related template privileges to this ES role.

Rubrix use the ELASTICSEARCH environment variable to set the ES connection.

You can provide the credentials using the following scheme:

http(s)://user:passwd@elastichost
http(s)://user:passwd@elastichost...

Below you can see a screenshot for setting up a new rubrix Role and its permissions:

Elasticsearch Rubrix role permission

Checking your webapp and REST API

Now you should be able to access Rubrix via http://localhost:6900/, and you can also check the API docs at http://localhost:6900/api/docs.

3. Testing the installation by logging some data

The following code will log one record into a data set called example-dataset :

import rubrix as rb

rb.log(
    rb.TextClassificationRecord(inputs={"text": "my first rubrix example"}),
    name='example-dataset'
)

You should receive this response in your terminal or Jupyter Notebook:

BulkResponse(dataset='example-dataset', processed=1, failed=0)

This means that the data has been logged correctly.

If you now go to your Rubrix app at http://localhost:6900/ , you will find your first data set.

Congratulations! You are ready to start working with Rubrix.

Next steps

To continue learning we recommend you to:

  • Check our guides and tutorials.

  • Read about Rubrix’s main concepts.