Provisioning

This commit is contained in:
Cyber MacGeddon 2024-07-18 16:02:53 +01:00
parent 9216e47da2
commit 890cf37ff4
10 changed files with 426 additions and 42 deletions

View file

@ -1,6 +1,6 @@
# VERSION=$(shell git describe | sed 's/^v//')
VERSION=0.3.3
VERSION=0.4.0
all: container

View file

@ -91,7 +91,7 @@ services:
restart: on-failure:100
pdf-decoder:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "pdf-decoder"
- "-p"
@ -99,7 +99,7 @@ services:
restart: on-failure:100
chunker:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "chunker-recursive"
- "-p"
@ -107,7 +107,7 @@ services:
restart: on-failure:100
vectorize:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "embeddings-vectorize"
- "-p"
@ -115,7 +115,7 @@ services:
restart: on-failure:100
embeddings:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "embeddings-hf"
- "-p"
@ -123,7 +123,7 @@ services:
restart: on-failure:100
kg-extract-definitions:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "kg-extract-definitions"
- "-p"
@ -131,7 +131,7 @@ services:
restart: on-failure:100
kg-extract-relationships:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "kg-extract-relationships"
- "-p"
@ -139,7 +139,7 @@ services:
restart: on-failure:100
vector-write:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "vector-write-milvus"
- "-p"
@ -149,7 +149,7 @@ services:
restart: on-failure:100
graph-write:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "graph-write-cassandra"
- "-p"
@ -159,7 +159,7 @@ services:
restart: on-failure:100
llm:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "llm-azure-text"
- "-p"
@ -171,7 +171,7 @@ services:
restart: on-failure:100
graph-rag:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "graph-rag"
- "-p"

View file

@ -91,7 +91,7 @@ services:
restart: on-failure:100
pdf-decoder:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "pdf-decoder"
- "-p"
@ -99,7 +99,7 @@ services:
restart: on-failure:100
chunker:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "chunker-recursive"
- "-p"
@ -107,7 +107,7 @@ services:
restart: on-failure:100
vectorize:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "embeddings-vectorize"
- "-p"
@ -115,7 +115,7 @@ services:
restart: on-failure:100
embeddings:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "embeddings-hf"
- "-p"
@ -123,7 +123,7 @@ services:
restart: on-failure:100
kg-extract-definitions:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "kg-extract-definitions"
- "-p"
@ -131,7 +131,7 @@ services:
restart: on-failure:100
kg-extract-relationships:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "kg-extract-relationships"
- "-p"
@ -139,7 +139,7 @@ services:
restart: on-failure:100
vector-write:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "vector-write-milvus"
- "-p"
@ -149,7 +149,7 @@ services:
restart: on-failure:100
graph-write:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "graph-write-cassandra"
- "-p"
@ -159,7 +159,7 @@ services:
restart: on-failure:100
llm:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "llm-claude-text"
- "-p"
@ -169,7 +169,7 @@ services:
restart: on-failure:100
graph-rag:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "graph-rag"
- "-p"

View file

@ -6,6 +6,8 @@ volumes:
etcd:
minio-data:
milvus:
prometheus-data:
grafana-storage:
services:
@ -90,8 +92,33 @@ services:
- "milvus:/var/lib/milvus"
restart: on-failure:100
prometheus:
image: docker.io/prom/prometheus:v2.53.1
ports:
- "9090:9090"
volumes:
- "./prometheus:/etc/prometheus"
- "prometheus-data:/prometheus"
restart: on-failure:100
grafana:
image: docker.io/grafana/grafana:10.0.0
ports:
- "3000:3000"
volumes:
- "grafana-storage:/var/lib/grafana"
- "./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml"
- "./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml"
- "./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json"
environment:
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
GF_AUTH_ANONYMOUS_ENABLED: true
GF_ORG_NAME: trustgraph.ai
# GF_SERVER_ROOT_URL: https://example.com
restart: on-failure:100
pdf-decoder:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "pdf-decoder"
- "-p"
@ -99,7 +126,7 @@ services:
restart: on-failure:100
chunker:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "chunker-recursive"
- "-p"
@ -107,7 +134,7 @@ services:
restart: on-failure:100
vectorize:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "embeddings-vectorize"
- "-p"
@ -115,7 +142,7 @@ services:
restart: on-failure:100
embeddings:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "embeddings-hf"
- "-p"
@ -125,7 +152,7 @@ services:
restart: on-failure:100
kg-extract-definitions:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "kg-extract-definitions"
- "-p"
@ -133,7 +160,7 @@ services:
restart: on-failure:100
kg-extract-relationships:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "kg-extract-relationships"
- "-p"
@ -141,7 +168,7 @@ services:
restart: on-failure:100
vector-write:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "vector-write-milvus"
- "-p"
@ -151,7 +178,7 @@ services:
restart: on-failure:100
graph-write:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "graph-write-cassandra"
- "-p"
@ -161,7 +188,7 @@ services:
restart: on-failure:100
llm:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "llm-ollama-text"
- "-p"
@ -171,7 +198,7 @@ services:
restart: on-failure:100
graph-rag:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "graph-rag"
- "-p"

View file

@ -91,7 +91,7 @@ services:
restart: on-failure:100
pdf-decoder:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "pdf-decoder"
- "-p"
@ -99,7 +99,7 @@ services:
restart: on-failure:100
chunker:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "chunker-recursive"
- "-p"
@ -107,7 +107,7 @@ services:
restart: on-failure:100
vectorize:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "embeddings-vectorize"
- "-p"
@ -115,7 +115,7 @@ services:
restart: on-failure:100
embeddings:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "embeddings-hf"
- "-p"
@ -123,7 +123,7 @@ services:
restart: on-failure:100
kg-extract-definitions:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "kg-extract-definitions"
- "-p"
@ -131,7 +131,7 @@ services:
restart: on-failure:100
kg-extract-relationships:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "kg-extract-relationships"
- "-p"
@ -139,7 +139,7 @@ services:
restart: on-failure:100
vector-write:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "vector-write-milvus"
- "-p"
@ -149,7 +149,7 @@ services:
restart: on-failure:100
graph-write:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "graph-write-cassandra"
- "-p"
@ -159,7 +159,7 @@ services:
restart: on-failure:100
llm:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "llm-vertexai-text"
- "-p"
@ -173,7 +173,7 @@ services:
restart: on-failure:100
graph-rag:
image: docker.io/trustgraph/trustgraph-flow:0.3.3
image: docker.io/trustgraph/trustgraph-flow:0.4.0
command:
- "graph-rag"
- "-p"

298
grafana/dashboard.json Normal file
View file

@ -0,0 +1,298 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "b7a520e5-9efe-4e0b-961b-9d1d3854800d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 4,
"options": {
"bucketOffset": 0,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "b7a520e5-9efe-4e0b-961b-9d1d3854800d"
},
"editorMode": "builder",
"expr": "avg(rate(request_latency_bucket{instance=\"llm:8000\"}[5m]))",
"instant": false,
"range": true,
"refId": "A"
}
],
"title": "LLM latency",
"type": "histogram"
},
{
"datasource": {
"type": "prometheus",
"uid": "b7a520e5-9efe-4e0b-961b-9d1d3854800d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-RdYlGr"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 39,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "percent"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "b7a520e5-9efe-4e0b-961b-9d1d3854800d"
},
"editorMode": "builder",
"expr": "sum by(status) (rate(processing_count_total[5m]))",
"format": "time_series",
"instant": false,
"interval": "",
"range": true,
"refId": "A"
}
],
"title": "Error rate",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "b7a520e5-9efe-4e0b-961b-9d1d3854800d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 11,
"w": 12,
"x": 0,
"y": 8
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "b7a520e5-9efe-4e0b-961b-9d1d3854800d"
},
"editorMode": "builder",
"expr": "rate(request_latency_count[1m])",
"instant": false,
"range": true,
"refId": "A"
}
],
"title": "Request count",
"type": "timeseries"
}
],
"refresh": "10s",
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Trustgraph",
"uid": "b5c8abf8-fe79-496b-b028-10bde917d1f0",
"version": 7,
"weekStart": ""
}

13
grafana/dashboard.yml Normal file
View file

@ -0,0 +1,13 @@
apiVersion: 1
providers:
- name: 'Trustgraph'
type: file
disableDeletion: false
editable: true
updateIntervalSeconds: 30
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards

11
grafana/datasource.yml Normal file
View file

@ -0,0 +1,11 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
basicAuth: false
isDefault: true
readOnly: false

35
prometheus/prometheus.yml Normal file
View file

@ -0,0 +1,35 @@
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'trustgraph'
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries
# scraped from this config.
- job_name: 'trustgraph'
# Override the global default and scrape targets from this job every
# 5 seconds.
scrape_interval: 5s
static_configs:
- targets:
- 'pdf-decoder:8000'
- 'chunker:8000'
- 'vectorize:8000'
- 'embeddings:8000'
- 'kg-extract-definitions:8000'
- 'kg-extract-relationships:8000'
- 'vector-write:8000'
- 'graph-write:8000'
- 'llm:8000'
- 'graph-rag:8000'

View file

@ -4,7 +4,7 @@ import os
with open("README.md", "r") as fh:
long_description = fh.read()
version = "0.3.3"
version = "0.4.0"
setuptools.setup(
name="trustgraph",