Quick Start

Quick Start

ℹ️

This quickstart guide assumes a local installation, but Grai can be installed anywhere.

What we'll cover here

In order to build your data lineage chart you will need to run Grai server and client, and download metadata from your data tools.

This will take less than five minutes and involves three easy steps:

  • Launch the Grai Server
  • Install the Grai Connector for your data sources
  • Update the server with your source metadata

If you'd prefer to skip straight to a demo you can also use the CLI

pip install grai-cli
grai demo start

Step 1: Clone the repository and run locally

git clone https://github.com/grai-io/grai-core.git
cd grai-core/examples/deployment/docker-compose/complete
docker compose up

This sets up three containers running

These settings are all configurable.

Your default login credentials, are:

username: null@grai.io
password: super_secret

Step 2: Pick your data source and install out-of-the-box integrations:

For this example

pip install grai-source-postgres

Step 3: Update the server with your source metadata:

The integration comes equipped with the client library already but we will need a python terminal or Jupyter Notebook to execute a few commands to establish a connection and begin querying the server.

Spin up your favorite python terminal then:

import os
from grai_source_postgres.base import update_server
from grai_client.endpoints.v1.client import ClientV1

For now we will use the default user credentials though you are free to create a new user / api keys from the server admin interface at http://localhost:8000/admin (opens in a new tab).

client = ClientV1(host='localhost', port='8000', insecure=True, username="null@grai.io", password="super_secret")

Now we can update the server with data from any postgres source. In order to do so you will need to pass credentials and namespace into the update_server function. Namespace is used to uniquely identify the nodes and when used consistently will allow you to add to the node from any source.

Using example variables, in order to update the server with your metadata, simply run:

update_server(client, dbname='grai', user='grai', password='grai', namespace='default', host='localhost', port='8000')

Using Lineage

Once your nodes and edges are setup, you can go ahead and use your lineage!