Skip to content

Commit

Permalink
chore(docs): add helm chart deployment instructions (#45)
Browse files Browse the repository at this point in the history
Add deployment instructions for
1. Docker compose
2. Helm Chart
3. Ametnes Platform

Closes #25
  • Loading branch information
mawandm committed Apr 26, 2024
1 parent ff28d52 commit a59d1b3
Show file tree
Hide file tree
Showing 15 changed files with 377 additions and 96 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
paths:
- "nesis/api/core/**"
- "nesis/api/tests/**"
- "nesis/api/core/requirements*"
- "nesis/api/requirements*"
pull_request:
paths:
- "nesis/api/core/**"
- "nesis/api/tests/**"
- "nesis/api/core/requirements*"
- "nesis/api/requirements*"

jobs:
linter:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test_rag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
paths:
- "nesis/rag/core/**"
- "nesis/rag/tests/**"
- "nesis/rag/core/requirements*"
- "nesis/rag/requirements*"
- "nesis/rag/settings.yaml"
pull_request:
paths:
- "nesis/rag/core/**"
- "nesis/rag/tests/**"
- "nesis/rag/core/requirements*"
- "nesis/rag/requirements*"
- "nesis/rag/settings.yaml"

jobs:
linter:
Expand All @@ -27,6 +29,8 @@ jobs:
test:
runs-on: ubuntu-latest
name: Test RAG API
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
services:
postgres:
image: ametnes/postgresql:16-debian-12
Expand Down
5 changes: 4 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ markdown_extensions:
nav:
- Home: 'index.md'
- 'Quick Start': 'quick-start.md'
- 'Deployment': 'deployment.md'
- 'Installing':
- 'installing/compose.md'
- 'installing/helm.md'
- 'installing/ametnes.md'
- 'Access Control': 'rbac.md'
- 'Development Guide':
- 'Local Development': 'dev-guide/local.md'
Expand Down
9 changes: 0 additions & 9 deletions docs/src/deployment.md

This file was deleted.

7 changes: 4 additions & 3 deletions docs/src/dev-guide/local.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ get an overview of the components that make up Nesis and its architecture [here]
2. If you rather not install docker, you will need to have access to a Postgres and Memcached instance.
3. _Optional:_ The RAG Engine needs access to an LLM endpoint such as an OpenAI's endpoint or a private LLM endpoint
in order to start querying your documents. You will need to set the `OPENAI_API_KEY` and the `OPENAI_API_BASE`environment variables.
4. You need to have python 3.11 for the API and RAG Engine microservices.
5. You also need to have node and npm installed.
4. Recently, Huggingface requires a `HF_TOKEN` to download embedding models. You may need to obtain and set your `HF_TOKEN`.
5. You need to have python 3.11 for the API and RAG Engine microservices.
6. You also need to have node and npm installed.


!!! note "A word on vector databases"

Nesis' RAG Engine requires a vector database to store vector embeddings. In order to contain the number of
dependant services, we use pgvector packaged into an extended Bitnami Postgres docker image `ametnes/postgresql:16-debian-12`
components, we use pgvector packaged into an extended Bitnami Postgres docker image `ametnes/postgresql:16-debian-12`
[here](https://github.com/ametnes/postgresql){target="_blank"}. You are however free to use other vector databases.
Curently, we support `chromadb` and `qdrant`.

Expand Down
3 changes: 1 addition & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<a href="https://github.com/ametnes/nesis/actions/workflows/test_frontend.yml" target="_blank"><img src="https://github.com/ametnes/nesis/actions/workflows/test_frontend.yml/badge.svg" alt="Test Frontend"/></a>
<a href="https://github.com/ametnes/nesis/actions/workflows/test_api.yml" target="_blank"><img src="https://github.com/ametnes/nesis/actions/workflows/test_api.yml/badge.svg" alt="Test Frontend"/></a>
<a href="https://github.com/ametnes/nesis/actions/workflows/test_rag.yml" target="_blank"><img src="https://github.com/ametnes/nesis/actions/workflows/test_rag.yml/badge.svg" alt="Test Frontend"/></a>
<a href="https://github.com/ametnes/nesis/actions/workflows/test_helm.yml" target="_blank"><img src="https://github.com/ametnes/nesis/actions/workflows/test_helm.yml/badge.svg" alt="Test Helm"/></a>
<a href="./LICENSE" target="_blank"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License"/></a>
</p>

Expand All @@ -24,4 +23,4 @@ collected from different documents in multiple formats such as pdf, docx, xlsx a

# Demo

<iframe width="946" height="531" src="https://www.youtube.com/embed/TckJLflTVnk?si=MDHdOWPC51O3jaRr" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<iframe width="946" height="531" src="https://www.youtube.com/embed/TckJLflTVnk?si=MDHdOWPC51O3jaRr" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
43 changes: 43 additions & 0 deletions docs/src/installing/ametnes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Ametnes Platform

The Ametnes Platform helps orchestrate your business applications wherever you host them. This can be in your private
data-center, in AWS, GCP or Azure.

Nesis is available on the Ametnes Platform and can be deployed in your kubernetes cluster wherever you host it.

The first step is to setup your kubernetes cluster as an Ametnes Application Location. See these detailed <a href="https://cloud.ametnes.com/docs/concepts/data-service-location/" target="_blank">instructions</a>.

## Create the service

Log into your Ametnes Cloud console at <a href="https://cloud.ametnes.com/console/signin" target="_blank">here</a>
or sign up <a href="https://cloud.ametnes.com/console/signup" target="_blank">here</a> if you do not have one.

1. Using the **Services** left menu, navigate to the service management dashboard.
2. Click **New Service**.
3. Enter the **__Nesis__** to filter from the list and select **__Create__**
4. In the displayed form, enter the following info.
1. Enter the **Name**: `Nesis-Service-DSL1` and **Description**: `Nesis-Service-DSL1`.
2. Select a **Version** from the list.
3. Select the **Location**.
4. Set the `OPENAI_API_KEY` and the `HF_TOKEN` keys.
4. Click `Create`.

## Test connectivity

1. Using the **Services** left menu, navigate to the service management dashboard. Your service should be listed.

!!! note "Service not showing"
If your service list is empty, use the filter at the top right corner, to filter for ALL services.

2. After a while, your data service status will change to `ready`.
2. To the right of your service, click the `Admin` button and you will navigate to your service's details page.
3. At the bottom of the page, copy the endpoint of your service as well as your username/key and password.
4. In your browser, paste the URL `https://<your.instance.host.name>/`.
5. You should get a prompt to login.

## Clean up

### Delete all services
1. In your Ametnes Cloud console, navigate to the **Admin** section of each service
2. Delete the service.

164 changes: 164 additions & 0 deletions docs/src/installing/compose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Docker Compose
For your quick local test, a <a href="https://github.com/ametnes/nesis/blob/main/compose.yml" target="_blank">docker compose</a> file is provided which you can
run to standup a local instance of Nesis.

## Compose File

```yaml title="compose.yml" linenums="1"

version: '3'


networks:
nesis:
driver: overlay
attachable: true

services:

nesis_frontend:
image: ametnes/nesis:latest-frontend
ports:
- "58000:8000"
environment:
API_URL: http://nesis_api:6000
networks:
- nesis
depends_on:
- nesis_api
nesis_api:
image: ametnes/nesis:latest-api
ports:
- "56000:6000"
environment:
NESIS_API_PORT: "6000"
NESIS_API_DATABASE_URL: "postgresql://postgres:password@database:5432/nesis"
NESIS_API_TASKS_JOB_STORES_URL: "postgresql://postgres:password@database:5432/nesis"
NESIS_ADMIN_EMAIL: "some.email@domain.com"
NESIS_ADMIN_PASSWORD: "password"
NESIS_MEMCACHE_HOSTS: memcached:11211
NESIS_API_RAG_ENDPOINT: http://nesis_rag:8080
networks:
- nesis
depends_on:
database:
condition: service_healthy
links:
- database
- memcached
- nesis_rag
nesis_rag:
image: ametnes/nesis:latest-rag
ports:
- "58080:8080"
environment:
NESIS_RAG_SERVER_PORT: "8080"
NESIS_RAG_PGVECTOR_URL: postgresql://postgres:password@database:5432/nesis
HF_TOKEN: <your-huggingface-token>
# 1. local mode uses hugging face. Other options
NESIS_RAG_EMBEDDING_MODE: local
NESIS_RAG_EMBEDDING_DIMENSIONS: "384"

# 2. openai - for OpenAI Embeddings
# NESIS_RAG_EMBEDDING_MODE: openai
# NESIS_RAG_EMBEDDING_DIMENSIONS: "1536"

# 3. sagemaker - for Sagemaker
OPENAI_API_KEY: <your-api-key>
# OPENAI_API_BASE: <your-api-base>
networks:
- nesis
depends_on:
- database
memcached:
image: bitnami/memcached:1.6.19
ports:
- "11211:11211"
networks:
- nesis
samba:
image: andyzhangx/samba:win-fix
command: ["-u", "username;password", "-s", "share;/smbshare/;yes;no;no;all;none", "-p"]
ports:
- '2445:445'
networks:
- nesis
volumes:
- 'samba_data2:/smbshare'
environment:
- USERNAME=username
- PASSWORD=password
minio:
image: docker.io/bitnami/minio:2022
ports:
- '59000:9000'
- '59001:9001'
networks:
- nesis
volumes:
- 'minio_data:/data'
environment:
- MINIO_ROOT_USER=your_username
- MINIO_ROOT_PASSWORD=your_password
- MINIO_DEFAULT_BUCKETS=documents
database:
image: "ametnes/postgresql:16-debian-12"
ports:
- "65432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: nesis
volumes:
- database_data:/var/lib/postgresql/data
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- nesis
volumes:
minio_data:
samba_data2:
database_data:

```

## Steps

1. Obtain your **OPENAI_API_KEY** from https://platform.openai.com/api-keys:
- and update the `compose.yml` file entry.

2. Start all services locally with the provided docker compose file.

```commandline
docker-compose -f compose.yml up
```

2. Then connect to your instance via http://localhost:58000 with the following login credentials:
- *email* = `some.email@domain.com`
- *password* = `password`

3. Connect to your minio instance via http://localhost:59001/ with the following login credentials:
- *username* = `YOUR_USERNAME`
- *password* = `YOUR_PASSWORD`


4. Upload some documents into your minio `documents` bucket.

5. Back on your Nesis page, register the minio datasource with
1. Navigate to **Settings** -> **Datasource** -> **Add**
2. Enter the details;

1. Type: **S3 Compatible**
4. Name: **documents**
5. Host: **http://minio:9000/**
6. Username: `YOUR_USERNAME`
7. Password: `YOUR_PASSWORD`
8. Click **Create**
9. Then, run an adhoc ingestion by clicking the **Ingest** button of the datasource.

- *Note*: Replace `YOUR_USERNAME` and `YOUR_PASSWORD` with the correct values of your `username` and `password`.

Loading

0 comments on commit a59d1b3

Please sign in to comment.