diff --git a/Makefile b/Makefile index cb4c6891..8a5078f9 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,7 @@ VECTORDB=qdrant JSONNET_FLAGS=-J templates -J . + update-templates: set-version for graph in ${GRAPHS}; do \ cm=$${graph},pulsar,${VECTORDB},grafana; \ diff --git a/scripts/load-text b/scripts/load-text new file mode 100755 index 00000000..3a0e19c3 --- /dev/null +++ b/scripts/load-text @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 + +""" +Loads a text document into TrustGraph processing. +""" + +import pulsar +from pulsar.schema import JsonSchema +from trustgraph.schema import TextDocument, Source, text_ingest_queue +import base64 +import hashlib +import argparse +import os +import time + +from trustgraph.log_level import LogLevel + +class Loader: + + def __init__( + self, + pulsar_host, + output_queue, + log_level, + file, + ): + + self.client = pulsar.Client( + pulsar_host, + logger=pulsar.ConsoleLogger(log_level.to_pulsar()) + ) + + self.producer = self.client.create_producer( + topic=output_queue, + schema=JsonSchema(TextDocument), + chunking_enabled=True, + ) + + self.file = file + + def run(self): + + try: + + path = self.file + data = open(path, "rb").read() + + id = hashlib.sha256(path.encode("utf-8")).hexdigest()[0:8] + + r = TextDocument( + source=Source( + source=path, + title=path, + id=id, + ), + text=data, + ) + + self.producer.send(r) + + except Exception as e: + print(e, flush=True) + + def __del__(self): + self.client.close() + +def main(): + + parser = argparse.ArgumentParser( + prog='loader', + description=__doc__, + ) + + default_pulsar_host = os.getenv("PULSAR_HOST", 'pulsar://localhost:6650') + default_output_queue = text_ingest_queue + + parser.add_argument( + '-p', '--pulsar-host', + default=default_pulsar_host, + help=f'Pulsar host (default: {default_pulsar_host})', + ) + + parser.add_argument( + '-o', '--output-queue', + default=default_output_queue, + help=f'Output queue (default: {default_output_queue})' + ) + + parser.add_argument( + '-l', '--log-level', + type=LogLevel, + default=LogLevel.ERROR, + choices=list(LogLevel), + help=f'Output queue (default: info)' + ) + + parser.add_argument( + '-f', '--file', + required=True, + help=f'File to load' + ) + + args = parser.parse_args() + + while True: + + try: + p = Loader( + pulsar_host=args.pulsar_host, + output_queue=args.output_queue, + log_level=args.log_level, + file=args.file, + ) + + p.run() + + print("File loaded.") + break + + except Exception as e: + + print("Exception:", e, flush=True) + print("Will retry...", flush=True) + + time.sleep(10) + +main() + diff --git a/scripts/loader b/scripts/loader index 9520b004..0c2aac46 100755 --- a/scripts/loader +++ b/scripts/loader @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """ -Loads a PDF documented into TrustGraph processing. +Loads a PDF document into TrustGraph processing. """ import pulsar diff --git a/templates/config-loader.jsonnet b/templates/components.jsonnet similarity index 71% rename from templates/config-loader.jsonnet rename to templates/components.jsonnet index 79fe1f91..a3414324 100644 --- a/templates/config-loader.jsonnet +++ b/templates/components.jsonnet @@ -1,4 +1,4 @@ -local components = { +{ "azure": import "components/azure.jsonnet", "bedrock": import "components/bedrock.jsonnet", "claude": import "components/claude.jsonnet", @@ -24,32 +24,12 @@ local components = { "vector-store-milvus": import "components/milvus.jsonnet", "vector-store-qdrant": import "components/qdrant.jsonnet", "vertexai": import "components/vertexai.jsonnet", - "null": {} -}; + "null": {}, -local config = function(p) - (components[p.name] + { - - with:: function(k, v) self + { - [k]:: v - }, - - with_params:: function(pars) - self + std.foldl( - function(obj, par) obj.with(par.key, par.value), - std.objectKeysValues(pars), - self - ), - - }).with_params(p.parameters); - -local options = import "config.json"; - -local add = function(state, p) state + config(p); - -local output = std.foldl(add, options, {}); - -//std.manifestYamlDoc(config) - -output + // FIXME: Dupes + "cassandra": import "components/cassandra.jsonnet", + "neo4j": import "components/neo4j.jsonnet", + "qdrant": import "components/qdrant.jsonnet", + "trustgraph": import "components/trustgraph.jsonnet", +} diff --git a/templates/components/azure.jsonnet b/templates/components/azure.jsonnet index fa7c4ee9..f10803eb 100644 --- a/templates/components/azure.jsonnet +++ b/templates/components/azure.jsonnet @@ -2,6 +2,7 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; local prompts = import "prompts/mixtral.jsonnet"; + { "azure-token":: "${AZURE_TOKEN}", @@ -9,70 +10,76 @@ local prompts = import "prompts/mixtral.jsonnet"; "azure-max-output-tokens":: 4096, "azure-temperature":: 0.0, - services +: { + "text-completion" +: { + + create:: function(engine) - "text-completion": base + { - image: images.trustgraph, - command: [ - "text-completion-azure", - "-p", - url.pulsar, - "-k", - $["azure-token"], - "-e", - $["azure-endpoint"], - "-x", - std.toString($["azure-max-output-tokens"]), - "-t", - std.toString($["azure-temperature"]), - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("text-completion") + .with_image(images.trustgraph) + .with_command([ + "text-completion-azure", + "-p", + url.pulsar, + "-k", + $["azure-token"], + "-e", + $["azure-endpoint"], + "-x", + std.toString($["azure-max-output-tokens"]), + "-t", + std.toString($["azure-temperature"]), + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion", [ container ] + ); + + engine.resources([ + containerSet, + ]) - "text-completion-rag": base + { - image: images.trustgraph, - command: [ - "text-completion-azure", - "-p", - url.pulsar, - "-k", - $["azure-token"], - "-e", - $["azure-endpoint"], - "-i", - "-x", - std.toString($["azure-max-output-tokens"]), - "-t", - std.toString($["azure-temperature"]), - "non-persistent://tg/request/text-completion-rag", - "-o", - "non-persistent://tg/response/text-completion-rag-response", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, - }, + + "text-completion-rag" +: { + + create:: function(engine) + + local container = + engine.container("text-completion-rag") + .with_image(images.trustgraph) + .with_command([ + "text-completion-azure", + "-p", + url.pulsar, + "-k", + $["azure-token"], + "-e", + $["azure-endpoint"], + "-x", + std.toString($["azure-max-output-tokens"]), + "-t", + std.toString($["azure-temperature"]), + "-i", + "non-persistent://tg/request/text-completion-rag", + "-o", + "non-persistent://tg/response/text-completion-rag-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion-rag", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + + } + } + prompts diff --git a/templates/components/bedrock.jsonnet b/templates/components/bedrock.jsonnet index b6b3bb2c..666d6bf5 100644 --- a/templates/components/bedrock.jsonnet +++ b/templates/components/bedrock.jsonnet @@ -3,7 +3,9 @@ local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; local prompts = import "prompts/mixtral.jsonnet"; local chunker = import "chunker-recursive.jsonnet"; + { + "aws-id-key":: "${AWS_ID_KEY}", "aws-secret-key":: "${AWS_SECRET_KEY}", "aws-region":: "us-west-2", @@ -11,78 +13,84 @@ local chunker = import "chunker-recursive.jsonnet"; "bedrock-temperature":: 0.0, "bedrock-model":: "mistral.mixtral-8x7b-instruct-v0:1", - services +: { + "text-completion" +: { + + create:: function(engine) - "text-completion": base + { - image: images.trustgraph, - command: [ - "text-completion-bedrock", - "-p", - url.pulsar, - "-z", - $["aws-id-key"], - "-k", - $["aws-secret-key"], - "-r", - $["aws-region"], - "-x", - std.toString($["bedrock-max-output-tokens"]), - "-t", - std.toString($["bedrock-temperature"]), - "-m", - $["bedrock-model"], - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("text-completion") + .with_image(images.trustgraph) + .with_command([ + "text-completion-bedrock", + "-p", + url.pulsar, + "-z", + $["aws-id-key"], + "-k", + $["aws-secret-key"], + "-r", + $["aws-region"], + "-x", + std.toString($["bedrock-max-output-tokens"]), + "-t", + std.toString($["bedrock-temperature"]), + "-m", + $["bedrock-model"], + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion", [ container ] + ); + + engine.resources([ + containerSet, + ]) - "text-completion-rag": base + { - image: images.trustgraph, - command: [ - "text-completion-bedrock", - "-p", - url.pulsar, - "-z", - $["aws-id-key"], - "-k", - $["aws-secret-key"], - "-r", - $["aws-region"], - "-x", - std.toString($["bedrock-max-output-tokens"]), - "-t", - std.toString($["bedrock-temperature"]), - "-m", - $["bedrock-model"], - "-i", - "non-persistent://tg/request/text-completion-rag", - "-o", - "non-persistent://tg/response/text-completion-rag-response", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, - }, + + "text-completion-rag" +: { + + create:: function(engine) + + local container = + engine.container("text-completion-rag") + .with_image(images.trustgraph) + .with_command([ + "text-completion-bedrock", + "-p", + url.pulsar, + "-z", + $["aws-id-key"], + "-k", + $["aws-secret-key"], + "-r", + $["aws-region"], + "-x", + std.toString($["bedrock-max-output-tokens"]), + "-t", + std.toString($["bedrock-temperature"]), + "-m", + $["bedrock-model"], + "-i", + "non-persistent://tg/request/text-completion-rag", + "-o", + "non-persistent://tg/response/text-completion-rag-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion-rag", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + + } + } + prompts + chunker diff --git a/templates/components/cassandra.jsonnet b/templates/components/cassandra.jsonnet index 98c3b32a..4e08e72e 100644 --- a/templates/components/cassandra.jsonnet +++ b/templates/components/cassandra.jsonnet @@ -6,53 +6,59 @@ local cassandra = import "stores/cassandra.jsonnet"; cassandra + { - services +: { + "store-triples" +: { + + create:: function(engine) - "store-triples": base + { - image: images.trustgraph, - command: [ - "triples-write-cassandra", - "-p", - url.pulsar, - "-g", - cassandra_hosts, - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("store-triples") + .with_image(images.trustgraph) + .with_command([ + "triples-write-cassandra", + "-p", + url.pulsar, + "-g", + cassandra_hosts, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); - "query-triples": base + { - image: images.trustgraph, - command: [ - "triples-query-cassandra", - "-p", - url.pulsar, - "-g", - cassandra_hosts, - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '512M' - }, - reservations: { - cpus: '0.1', - memory: '512M' - } - } - }, - }, + local containerSet = engine.containers( + "stop-triples", [ container ] + ); + + engine.resources([ + containerSet, + ]) }, + + "query-triples" +: { + + create:: function(engine) + + local container = + engine.container("query-triples") + .with_image(images.trustgraph) + .with_command([ + "triples-query-cassandra", + "-p", + url.pulsar, + "-g", + cassandra_hosts, + ]) + .with_limits("0.5", "512M") + .with_reservations("0.1", "512M"); + + local containerSet = engine.containers( + "query-triples", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + } + } + diff --git a/templates/components/chunker-recursive.jsonnet b/templates/components/chunker-recursive.jsonnet index 792cc67d..58bcba46 100644 --- a/templates/components/chunker-recursive.jsonnet +++ b/templates/components/chunker-recursive.jsonnet @@ -2,38 +2,40 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; local prompts = import "prompts/mixtral.jsonnet"; + { "chunk-size":: 2000, "chunk-overlap":: 100, - services +: { + "chunker" +: { + + create:: function(engine) + + local container = + engine.container("chunker") + .with_image(images.trustgraph) + .with_command([ + "chunker-recursive", + "-p", + url.pulsar, + "--chunk-size", + std.toString($["chunk-size"]), + "--chunk-overlap", + std.toString($["chunk-overlap"]), + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "chunker", [ container ] + ); + + engine.resources([ + containerSet, + ]) - chunker: base + { - image: images.trustgraph, - command: [ - "chunker-recursive", - "-p", - url.pulsar, - "--chunk-size", - std.toString($["chunk-size"]), - "--chunk-overlap", - std.toString($["chunk-overlap"]), - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, - }, -} + prompts + +} diff --git a/templates/components/claude.jsonnet b/templates/components/claude.jsonnet index ac87d8fb..d4f3df15 100644 --- a/templates/components/claude.jsonnet +++ b/templates/components/claude.jsonnet @@ -2,71 +2,79 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; local prompts = import "prompts/mixtral.jsonnet"; + { "claude-key":: "${CLAUDE_KEY}", "claude-max-output-tokens":: 4096, "claude-temperature":: 0.0, - services +: { + "text-completion" +: { + + create:: function(engine) - "text-completion": base + { - image: images.trustgraph, - command: [ - "text-completion-claude", - "-p", - url.pulsar, - "-k", - $["claude-key"], - "-x", - std.toString($["claude-max-output-tokens"]), - "-t", - std.toString($["claude-temperature"]), - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("text-completion") + .with_image(images.trustgraph) + .with_command([ + "text-completion-claude", + "-p", + url.pulsar, + "-k", + $["claude-key"], + "-x", + std.toString($["claude-max-output-tokens"]), + "-t", + std.toString($["claude-temperature"]), + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion", [ container ] + ); + + engine.resources([ + containerSet, + ]) - "text-completion-rag": base + { - image: images.trustgraph, - command: [ - "text-completion-claude", - "-p", - url.pulsar, - "-k", - $["claude-key"], - "-x", - std.toString($["claude-max-output-tokens"]), - "-t", - std.toString($["claude-temperature"]), - "-i", - "non-persistent://tg/request/text-completion-rag", - "-o", - "non-persistent://tg/response/text-completion-rag-response", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, - }, + + "text-completion-rag" +: { + + create:: function(engine) + + local container = + engine.container("text-completion-rag") + .with_image(images.trustgraph) + .with_command([ + "text-completion-claude", + "-p", + url.pulsar, + "-k", + $["claude-key"], + "-x", + std.toString($["claude-max-output-tokens"]), + "-t", + std.toString($["claude-temperature"]), + "-i", + "non-persistent://tg/request/text-completion-rag", + "-o", + "non-persistent://tg/response/text-completion-rag-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion-rag", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + + } + } + prompts + diff --git a/templates/components/cohere.jsonnet b/templates/components/cohere.jsonnet index 0abce83a..64e77bcf 100644 --- a/templates/components/cohere.jsonnet +++ b/templates/components/cohere.jsonnet @@ -1,7 +1,8 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; -local prompts = import "prompts/cohere.jsonnet"; +local prompts = import "prompts/mixtral.jsonnet"; + { // Override chunking @@ -11,61 +12,68 @@ local prompts = import "prompts/cohere.jsonnet"; "cohere-key":: "${COHERE_KEY}", "cohere-temperature":: 0.0, - services +: { + "text-completion" +: { + + create:: function(engine) - "text-completion": base + { - image: images.trustgraph, - command: [ - "text-completion-cohere", - "-p", - url.pulsar, - "-k", - $["cohere-key"], - "-t", - $["cohere-temperature"], - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("text-completion") + .with_image(images.trustgraph) + .with_command([ + "text-completion-cohere", + "-p", + url.pulsar, + "-k", + $["cohere-key"], + "-t", + $["cohere-temperature"], + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); - "text-completion-rag": base + { - image: images.trustgraph, - command: [ - "text-completion-cohere", - "-p", - url.pulsar, - "-k", - $["cohere-key"], - "-t", - $["cohere-temperature"], - "-i", - "non-persistent://tg/request/text-completion-rag", - "-o", - "non-persistent://tg/response/text-completion-rag-response", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local containerSet = engine.containers( + "text-completion", [ container ] + ); + + engine.resources([ + containerSet, + ]) }, + + "text-completion-rag" +: { + + create:: function(engine) + + local container = + engine.container("text-completion-rag") + .with_image(images.trustgraph) + .with_command([ + "text-completion-cohere", + "-p", + url.pulsar, + "-k", + $["cohere-key"], + "-t", + $["cohere-temperature"], + "-i", + "non-persistent://tg/request/text-completion-rag", + "-o", + "non-persistent://tg/response/text-completion-rag-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion-rag", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + + } + } + prompts + diff --git a/templates/components/document-rag.jsonnet b/templates/components/document-rag.jsonnet index 5939733a..92cc5acb 100644 --- a/templates/components/document-rag.jsonnet +++ b/templates/components/document-rag.jsonnet @@ -1,38 +1,38 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; -local prompts = import "prompt-template.jsonnet"; +local prompts = import "prompts/mixtral.jsonnet"; { - services +: { + "document-rag" +: { + + create:: function(engine) - "document-rag": base + { - image: images.trustgraph, - command: [ - "document-rag", - "-p", - url.pulsar, - "--prompt-request-queue", - "non-persistent://tg/request/prompt-rag", - "--prompt-response-queue", - "non-persistent://tg/response/prompt-rag-response", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("document-rag"") + .with_image(images.trustgraph) + .with_command([ + "document-rag", + "-p", + url.pulsar, + "--prompt-request-queue", + "non-persistent://tg/request/prompt-rag", + "--prompt-response-queue", + "non-persistent://tg/response/prompt-rag-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); - } + local containerSet = engine.containers( + "document-rag"", [ container ] + ); -} + prompts + engine.resources([ + containerSet, + ]) + + }, + +} diff --git a/templates/components/embeddings-hf.jsonnet b/templates/components/embeddings-hf.jsonnet index a90b0655..3e53d32c 100644 --- a/templates/components/embeddings-hf.jsonnet +++ b/templates/components/embeddings-hf.jsonnet @@ -1,40 +1,38 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; -local prompts = import "prompt-template.jsonnet"; +local prompts = import "prompts/mixtral.jsonnet"; { "embeddings-model":: "all-MiniLM-L6-v2", - services +: { + embeddings +: { + + create:: function(engine) - embeddings: base + { - image: images.trustgraph, - command: [ - "embeddings-hf", - "-p", - url.pulsar, - "-m", - $["embeddings-model"], - ], - deploy: { - resources: { - limits: { - cpus: '1.0', - memory: '256M' - }, - reservations: { - cpus: '0.5', - memory: '256M' - } - } - }, - }, + local container = + engine.container("embeddings") + .with_image(images.trustgraph) + .with_command([ + "embeddings-hf", + "-p", + url.pulsar, + "-m", + $["embeddings-model"], + ]) + .with_limits("1.0", "256M") + .with_reservations("0.5", "256M"); - } + local containerSet = engine.containers( + "embeddings", [ container ] + ); -} + prompts + engine.resources([ + containerSet, + ]) + }, +} diff --git a/templates/components/grafana.jsonnet b/templates/components/grafana.jsonnet index 4d812ffd..ccc92d4b 100644 --- a/templates/components/grafana.jsonnet +++ b/templates/components/grafana.jsonnet @@ -1,65 +1,80 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; + { - volumes +: { - "prometheus-data": {}, - "grafana-storage": {}, + + "prometheus" +: { + + create:: function(engine) + + local vol = engine.volume("prometheus-data").with_size("20G"); + local cfgVol = engine.configVolume("./prometheus") + .with_size("20G"); + + local container = + engine.container("prometheus") + .with_image(images.prometheus) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M") + .with_port(9090, 9090, "http") + .with_volume_mount(cfgVol, "/etc/prometheus") + .with_volume_mount(vol, "/prometheus"); + + local containerSet = engine.containers( + "prometheus", [ container ] + ); + + engine.resources([ + cfgVol, + vol, + containerSet, + ]) + }, - services +: { - prometheus: base + { - image: images.prometheus, - ports: [ - "9090:9090", - ], - volumes: [ - "./prometheus:/etc/prometheus", - "prometheus-data:/prometheus", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, - grafana: base + { - image: images.grafana, - 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_ROLE: "Admin", - GF_ORG_NAME: "trustgraph.ai", - // GF_SERVER_ROOT_URL: "https://example.com", - }, - deploy: { - resources: { - limits: { - cpus: '1.0', - memory: '256M' - }, - reservations: { - cpus: '0.5', - memory: '256M' - } - } - }, - }, + + "grafana" +: { + + create:: function(engine) + + local vol = engine.volume("grafana-storage").with_size("20G"); + local cv1 = engine.configVolume("./grafana/dashboard.yml") + .with_size("20G"); + local cv2 = engine.configVolume("./grafana/datasource.yml") + .with_size("20G"); + local cv3 = engine.configVolume("./grafana/dashboard.json") + .with_size("20G"); + + local container = + engine.container("grafana") + .with_image(images.grafana) + .with_environment({ + // GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin", + // GF_AUTH_ANONYMOUS_ENABLED: "true", + // GF_ORG_ROLE: "Admin", + GF_ORG_NAME: "trustgraph.ai", + // GF_SERVER_ROOT_URL: "https://example.com", + }) + .with_limits("1.0", "256M") + .with_reservations("0.5", "256M") + .with_port(3000, 3000, "cassandra") + .with_volume_mount(vol, "/var/lib/grafana") + .with_volume_mount(cv1, "/etc/grafana/provisioning/dashboards/dashboard.yml") + .with_volume_mount(cv2, "/etc/grafana/provisioning/datasources/datasource.yml") + .with_volume_mount(cv3, "/var/lib/grafana/dashboards/dashboard.json"); + + local containerSet = engine.containers( + "grafana", [ container ] + ); + + engine.resources([ + vol, + cv1, + cv2, + cv3, + containerSet, + ]) + }, + } - diff --git a/templates/components/graph-rag.jsonnet b/templates/components/graph-rag.jsonnet index 148fa71d..ad5ae6f4 100644 --- a/templates/components/graph-rag.jsonnet +++ b/templates/components/graph-rag.jsonnet @@ -1,7 +1,6 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; -local prompts = import "prompt-template.jsonnet"; { @@ -9,84 +8,90 @@ local prompts = import "prompt-template.jsonnet"; "graph-rag-triple-limit":: 30, "graph-rag-max-subgraph-size":: 3000, - services +: { + "kg-extract-definitions" +: { + + create:: function(engine) - "kg-extract-definitions": base + { - image: images.trustgraph, - command: [ - "kg-extract-definitions", - "-p", - url.pulsar, - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("kg-extract-definitions") + .with_image(images.trustgraph) + .with_command([ + "kg-extract-definitions", + "-p", + url.pulsar, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); - "kg-extract-relationships": base + { - image: images.trustgraph, - command: [ - "kg-extract-relationships", - "-p", - url.pulsar, - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local containerSet = engine.containers( + "kg-extract-definitions", [ container ] + ); - "graph-rag": base + { - image: images.trustgraph, - command: [ - "graph-rag", - "-p", - url.pulsar, - "--prompt-request-queue", - "non-persistent://tg/request/prompt-rag", - "--prompt-response-queue", - "non-persistent://tg/response/prompt-rag-response", - "--entity-limit", - std.toString($["graph-rag-entity-limit"]), - "--triple-limit", - std.toString($["graph-rag-triple-limit"]), - "--max-subgraph-size", - std.toString($["graph-rag-max-subgraph-size"]), - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + engine.resources([ + containerSet, + ]) - } + }, -} + prompts + "kg-extract-relationships" +: { + + create:: function(engine) + local container = + engine.container("kg-extract-relationships") + .with_image(images.trustgraph) + .with_command([ + "kg-extract-relationships", + "-p", + url.pulsar, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + local containerSet = engine.containers( + "kg-extract-relationships", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + }, + + "graph-rag" +: { + + create:: function(engine) + + local container = + engine.container("graph-rag") + .with_image(images.trustgraph) + .with_command([ + "graph-rag", + "-p", + url.pulsar, + "--prompt-request-queue", + "non-persistent://tg/request/prompt-rag", + "--prompt-response-queue", + "non-persistent://tg/response/prompt-rag-response", + "--entity-limit", + std.toString($["graph-rag-entity-limit"]), + "--triple-limit", + std.toString($["graph-rag-triple-limit"]), + "--max-subgraph-size", + std.toString($["graph-rag-max-subgraph-size"]), + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "graph-rag", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + }, + +} diff --git a/templates/components/neo4j.jsonnet b/templates/components/neo4j.jsonnet index 5e63b5d5..2e808ff0 100644 --- a/templates/components/neo4j.jsonnet +++ b/templates/components/neo4j.jsonnet @@ -5,54 +5,62 @@ local neo4j = import "stores/neo4j.jsonnet"; neo4j + { - services +: { + "neo4j-url":: "bolt://neo4j:7687", - "query-triples": base + { - image: images.trustgraph, - command: [ - "triples-query-neo4j", - "-p", - url.pulsar, - "-g", - "bolt://neo4j:7687", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + "store-triples" +: { + + create:: function(engine) - "store-triples": base + { - image: images.trustgraph, - command: [ - "triples-write-neo4j", - "-p", - url.pulsar, - "-g", - "bolt://neo4j:7687", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - } + local container = + engine.container("store-triples") + .with_image(images.trustgraph) + .with_command([ + "triples-write-neo4j", + "-p", + url.pulsar, + "-g", + $["neo4j-url"], + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "store-triples", [ container ] + ); + + engine.resources([ + containerSet, + ]) }, + "query-triples" +: { + + create:: function(engine) + + local container = + engine.container("query-triples") + .with_image(images.trustgraph) + .with_command([ + "triples-query-neo4j", + "-p", + url.pulsar, + "-g", + $["neo4j-url"], + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "query-triples", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + + } + } + diff --git a/templates/components/ollama.jsonnet b/templates/components/ollama.jsonnet index e175fe1a..e6b8e895 100644 --- a/templates/components/ollama.jsonnet +++ b/templates/components/ollama.jsonnet @@ -2,66 +2,74 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; local prompts = import "prompts/slm.jsonnet"; + { "ollama-model":: "gemma2:9b", "ollama-url":: "${OLLAMA_HOST}", - services +: { + "text-completion" +: { + + create:: function(engine) - "text-completion": base + { - image: images.trustgraph, - command: [ - "text-completion-ollama", - "-p", - url.pulsar, - "-m", - $["ollama-model"], - "-r", - $["ollama-url"], - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("text-completion") + .with_image(images.trustgraph) + .with_command([ + "text-completion-ollama", + "-p", + url.pulsar, + "-m", + $["ollama-model"], + "-r", + $["ollama-url"], + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion", [ container ] + ); + + engine.resources([ + containerSet, + ]) - "text-completion-rag": base + { - image: images.trustgraph, - command: [ - "text-completion-ollama", - "-p", - url.pulsar, - "-m", - $["ollama-model"], - "-r", - $["ollama-url"], - "-i", - "non-persistent://tg/request/text-completion-rag", - "-o", - "non-persistent://tg/response/text-completion-rag-response", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, - }, + + "text-completion-rag" +: { + + create:: function(engine) + + local container = + engine.container("text-completion-rag") + .with_image(images.trustgraph) + .with_command([ + "text-completion-ollama", + "-p", + url.pulsar, + "-m", + $["ollama-model"], + "-r", + $["ollama-url"], + "-i", + "non-persistent://tg/request/text-completion-rag", + "-o", + "non-persistent://tg/response/text-completion-rag-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion-rag", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + + } + } + prompts + diff --git a/templates/components/openai.jsonnet b/templates/components/openai.jsonnet index 8bcdf557..63917376 100644 --- a/templates/components/openai.jsonnet +++ b/templates/components/openai.jsonnet @@ -1,7 +1,8 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; -local prompts = import "prompts/openai.jsonnet"; +local prompts = import "prompts/mixtral.jsonnet"; + { "openai-key":: "${OPENAI_KEY}", @@ -9,69 +10,76 @@ local prompts = import "prompts/openai.jsonnet"; "openai-temperature":: 0.0, "openai-model":: "GPT-3.5-Turbo", - services +: { + "text-completion" +: { + + create:: function(engine) - "text-completion": base + { - image: images.trustgraph, - command: [ - "text-completion-openai", - "-p", - url.pulsar, - "-k", - $["openai-key"], - "-x", - std.toString($["openai-max-output-tokens"]), - "-t", - std.toString($["openai-temperature"]), - "-m", - $["openai-model"], - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("text-completion") + .with_image(images.trustgraph) + .with_command([ + "text-completion-openai", + "-p", + url.pulsar, + "-k", + $["openai-key"], + "-x", + std.toString($["openai-max-output-tokens"]), + "-t", + std.toString($["openai-temperature"]), + "-m", + $["openai-model"], + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion", [ container ] + ); + + engine.resources([ + containerSet, + ]) - "text-completion-rag": base + { - image: images.trustgraph, - command: [ - "text-completion-openai", - "-p", - url.pulsar, - "-k", - $["openai-key"], - "-x", - std.toString($["openai-max-output-tokens"]), - "-t", - std.toString($["openai-temperature"]), - "-m", - $["openai-model"], - "-i", - "non-persistent://tg/request/text-completion-rag", - "-o", - "non-persistent://tg/response/text-completion-rag-response", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, - }, + + "text-completion-rag" +: { + + create:: function(engine) + + local container = + engine.container("text-completion-rag") + .with_image(images.trustgraph) + .with_command([ + "text-completion-openai", + "-p", + url.pulsar, + "-k", + $["openai-key"], + "-x", + std.toString($["openai-max-output-tokens"]), + "-t", + std.toString($["openai-temperature"]), + "-m", + $["openai-model"], + "-i", + "non-persistent://tg/request/text-completion-rag", + "-o", + "non-persistent://tg/response/text-completion-rag-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "text-completion-rag", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + + } + } + prompts + diff --git a/templates/components/prompt-generic.jsonnet b/templates/components/prompt-generic.jsonnet index d461cdfb..aa19fb74 100644 --- a/templates/components/prompt-generic.jsonnet +++ b/templates/components/prompt-generic.jsonnet @@ -1,67 +1,71 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; +local prompts = import "prompts/mixtral.jsonnet"; { - services +: { + "prompt" +: { + + create:: function(engine) - "prompt": base + { - image: images.trustgraph, - command: [ - "prompt-generic", - "-p", - url.pulsar, - "--text-completion-request-queue", - "non-persistent://tg/request/text-completion", - "--text-completion-response-queue", - "non-persistent://tg/response/text-completion-response", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("prompt") + .with_image(images.trustgraph) + .with_command([ + "prompt-generic", + "-p", + url.pulsar, + "--text-completion-request-queue", + "non-persistent://tg/request/text-completion", + "--text-completion-response-queue", + "non-persistent://tg/response/text-completion-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); - "prompt-rag": base + { - image: images.trustgraph, - command: [ - "prompt-generic", - "-p", - url.pulsar, - "-i", - "non-persistent://tg/request/prompt-rag", - "-o", - "non-persistent://tg/response/prompt-rag-response", - "--text-completion-request-queue", - "non-persistent://tg/request/text-completion-rag", - "--text-completion-response-queue", - "non-persistent://tg/response/text-completion-rag-response", - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - - }, - }, + local containerSet = engine.containers( + "prompt", [ container ] + ); - } + engine.resources([ + containerSet, + ]) + + }, + + "prompt-rag" +: { + + create:: function(engine) + + local container = + engine.container("prompt-rag") + .with_image(images.trustgraph) + .with_command([ + "prompt-generic", + "-p", + url.pulsar, + "-i", + "non-persistent://tg/request/prompt-rag", + "-o", + "non-persistent://tg/response/prompt-rag-response", + "--text-completion-request-queue", + "non-persistent://tg/request/text-completion-rag", + "--text-completion-response-queue", + "non-persistent://tg/response/text-completion-rag-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "prompt-rag", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + }, } diff --git a/templates/components/prompt-template.jsonnet b/templates/components/prompt-template.jsonnet index 4fe6ff54..e64a18e8 100644 --- a/templates/components/prompt-template.jsonnet +++ b/templates/components/prompt-template.jsonnet @@ -1,89 +1,92 @@ - -// For VertexAI Gemini - local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; +local prompts = import "prompts/mixtral.jsonnet"; local default_prompts = import "prompts/default-prompts.jsonnet"; -default_prompts + { +{ - services +: { + "prompt" +: { + + create:: function(engine) - "prompt": base + { - image: images.trustgraph, - command: [ - "prompt-template", - "-p", - url.pulsar, - "--text-completion-request-queue", - "non-persistent://tg/request/text-completion", - "--text-completion-response-queue", - "non-persistent://tg/response/text-completion-response", - "--definition-template", - $["prompt-definition-template"], - "--relationship-template", - $["prompt-relationship-template"], - "--knowledge-query-template", - $["prompt-knowledge-query-template"], - "--document-query-template", - $["prompt-document-query-template"], - "--rows-template", - $["prompt-rows-template"], - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("prompt") + .with_image(images.trustgraph) + .with_command([ + "prompt-template", + "-p", + url.pulsar, + "--text-completion-request-queue", + "non-persistent://tg/request/text-completion", + "--text-completion-response-queue", + "non-persistent://tg/response/text-completion-response", + "--definition-template", + $["prompt-definition-template"], + "--relationship-template", + $["prompt-relationship-template"], + "--knowledge-query-template", + $["prompt-knowledge-query-template"], + "--document-query-template", + $["prompt-document-query-template"], + "--rows-template", + $["prompt-rows-template"], + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); - "prompt-rag": base + { - image: images.trustgraph, - command: [ - "prompt-template", - "-p", - url.pulsar, - "-i", - "non-persistent://tg/request/prompt-rag", - "-o", - "non-persistent://tg/response/prompt-rag-response", - "--text-completion-request-queue", - "non-persistent://tg/request/text-completion-rag", - "--text-completion-response-queue", - "non-persistent://tg/response/text-completion-rag-response", - "--definition-template", - $["prompt-definition-template"], - "--relationship-template", - $["prompt-relationship-template"], - "--knowledge-query-template", - $["prompt-knowledge-query-template"], - "--document-query-template", - $["prompt-document-query-template"], - "--rows-template", - $["prompt-rows-template"], - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local containerSet = engine.containers( + "prompt", [ container ] + ); + + engine.resources([ + containerSet, + ]) }, -} + "prompt-rag" +: { + + create:: function(engine) + + local container = + engine.container("prompt-rag") + .with_image(images.trustgraph) + .with_command([ + "prompt-template", + "-p", + url.pulsar, + "-i", + "non-persistent://tg/request/prompt-rag", + "-o", + "non-persistent://tg/response/prompt-rag-response", + "--text-completion-request-queue", + "non-persistent://tg/request/text-completion-rag", + "--text-completion-response-queue", + "non-persistent://tg/response/text-completion-rag-response", + "--definition-template", + $["prompt-definition-template"], + "--relationship-template", + $["prompt-relationship-template"], + "--knowledge-query-template", + $["prompt-knowledge-query-template"], + "--document-query-template", + $["prompt-document-query-template"], + "--rows-template", + $["prompt-rows-template"], + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "prompt-rag", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + }, + +} + default_prompts + diff --git a/templates/components/pulsar.jsonnet b/templates/components/pulsar.jsonnet index ee64b859..fe254031 100644 --- a/templates/components/pulsar.jsonnet +++ b/templates/components/pulsar.jsonnet @@ -1,62 +1,62 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; + { - volumes +: { - "pulsar-conf": {}, - "pulsar-data": {}, - }, - services +: { - pulsar: base + { - image: images.pulsar, - command: "bin/pulsar standalone", - ports: [ - "6650:6650", - "8080:8080", - ], - environment: { - "PULSAR_MEM": "-Xms700M -Xmx700M" - }, - volumes: [ - "pulsar-conf:/pulsar/conf", - "pulsar-data:/pulsar/data", - ], - deploy: { - resources: { - limits: { - cpus: '1.0', - memory: '900M' - }, - reservations: { - cpus: '0.5', - memory: '900M' - } - } - }, - }, - "init-pulsar": base + { - image: images.pulsar, - command: [ - "sh", - "-c", - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response", - ], - depends_on: { - pulsar: { - condition: "service_started", - } - }, - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + + "pulsar" +: { + + create:: function(engine) + + local confVolume = engine.volume("pulsar-conf").with_size("2G"); + local dataVolume = engine.volume("pulsar-data").with_size("20G"); + + local container = + engine.container("pulsar") + .with_image(images.pulsar) + .with_command("bin/pulsar standalone") + .with_environment({ + "PULSAR_MEM": "-Xms700M -Xmx700M" + }) + .with_limits("1.0", "900M") + .with_reservations("0.5", "900M") + .with_volume_mount(confVolume, "/pulsar/conf") + .with_volume_mount(dataVolume, "/pulsar/data") + .with_port(6650, 6650, "bookie") + .with_port(8080, 8080, "http"); + + local adminContainer = + engine.container("init-pulsar") + .with_image(images.pulsar) + .with_command([ + "sh", + "-c", + "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "pulsar", + [ + container, adminContainer + ] + ); + + local service = + engine.service(containerSet) + .with_port(6650, 6650) + .with_port(8080, 8080); + + engine.resources([ + confVolume, + dataVolume, + containerSet, + service, + ]) + } + } + + + diff --git a/templates/components/qdrant.jsonnet b/templates/components/qdrant.jsonnet index b0070e8c..ac6eadf9 100644 --- a/templates/components/qdrant.jsonnet +++ b/templates/components/qdrant.jsonnet @@ -1,105 +1,117 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; +local cassandra_hosts = "cassandra"; local qdrant = import "stores/qdrant.jsonnet"; qdrant + { - services +: { + "store-graph-embeddings" +: { + + create:: function(engine) - "store-graph-embeddings": base + { - image: images.trustgraph, - command: [ - "ge-write-qdrant", - "-p", - url.pulsar, - "-t", - url.qdrant, - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("store-graph-embeddings") + .with_image(images.trustgraph) + .with_command([ + "ge-write-qdrant", + "-p", + url.pulsar, + "-t", + url.qdrant, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); - "query-graph-embeddings": base + { - image: images.trustgraph, - command: [ - "ge-query-qdrant", - "-p", - url.pulsar, - "-t", - url.qdrant, - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local containerSet = engine.containers( + "store-graph-embeddings", [ container ] + ); - // Document embeddings writer & query service. + engine.resources([ + containerSet, + ]) - "store-doc-embeddings": base + { - image: images.trustgraph, - command: [ - "de-write-qdrant", - "-p", - url.pulsar, - "-t", - url.qdrant, - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + }, + + "query-graph-embeddings" +: { + + create:: function(engine) + + local container = + engine.container("query-graph-embeddings") + .with_image(images.trustgraph) + .with_command([ + "ge-query-qdrant", + "-p", + url.pulsar, + "-t", + url.qdrant, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "query-graph-embeddings", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + }, + + "store-doc-embeddings" +: { + + create:: function(engine) + + local container = + engine.container("store-doc-embeddings") + .with_image(images.trustgraph) + .with_command([ + "de-write-qdrant", + "-p", + url.pulsar, + "-t", + url.qdrant, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "store-doc-embeddings", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + }, + + "query-doc-embeddings" +: { + + create:: function(engine) + + local container = + engine.container("query-doc-embeddings") + .with_image(images.trustgraph) + .with_command([ + "de-query-qdrant", + "-p", + url.pulsar, + "-t", + url.qdrant, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "query-doc-embeddings", [ container ] + ); + + engine.resources([ + containerSet, + ]) - "query-doc-embeddings": base + { - image: images.trustgraph, - command: [ - "de-query-qdrant", - "-p", - url.pulsar, - "-t", - url.qdrant, - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, } diff --git a/templates/components/trustgraph.jsonnet b/templates/components/trustgraph.jsonnet index d0815983..787f1a0c 100644 --- a/templates/components/trustgraph.jsonnet +++ b/templates/components/trustgraph.jsonnet @@ -1,85 +1,91 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; -local prompts = import "prompt-template.jsonnet"; +local prompt = import "prompt-template.jsonnet"; { "chunk-size":: 250, "chunk-overlap":: 15, - services +: { + "chunker" +: { + + create:: function(engine) - "pdf-decoder": base + { - image: images.trustgraph, - command: [ - "pdf-decoder", - "-p", - url.pulsar, - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("chunker") + .with_image(images.trustgraph) + .with_command([ + "chunker-token", + "-p", + url.pulsar, + "--chunk-size", + std.toString($["chunk-size"]), + "--chunk-overlap", + std.toString($["chunk-overlap"]), + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); - chunker: base + { - image: images.trustgraph, - command: [ - "chunker-token", - "-p", - url.pulsar, - "--chunk-size", - std.toString($["chunk-size"]), - "--chunk-overlap", - std.toString($["chunk-overlap"]), - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local containerSet = engine.containers( + "chunker", [ container ] + ); - vectorize: base + { - image: images.trustgraph, - command: [ - "embeddings-vectorize", - "-p", - url.pulsar, - ], - deploy: { - resources: { - limits: { - cpus: '1.0', - memory: '512M' - }, - reservations: { - cpus: '0.5', - memory: '512M' - } - } - }, - }, + engine.resources([ + containerSet, + ]) - } + }, -} + prompts + "pdf-decoder" +: { + + create:: function(engine) + local container = + engine.container("pdf-decoder") + .with_image(images.trustgraph) + .with_command([ + "pdf-decoder", + "-p", + url.pulsar, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + local containerSet = engine.containers( + "pdf-decoder", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + }, + + "vectorize" +: { + + create:: function(engine) + + local container = + engine.container("vectorize") + .with_image(images.trustgraph) + .with_command([ + "embeddings-vectorize", + "-p", + url.pulsar, + ]) + .with_limits("1.0", "512M") + .with_reservations("0.5", "512M"); + + local containerSet = engine.containers( + "vectorize", [ container ] + ); + + engine.resources([ + containerSet, + ]) + + }, + +} + prompt diff --git a/templates/components/vertexai.jsonnet b/templates/components/vertexai.jsonnet index ab1e8d54..f2fd3d86 100644 --- a/templates/components/vertexai.jsonnet +++ b/templates/components/vertexai.jsonnet @@ -1,7 +1,8 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; local url = import "values/url.jsonnet"; -local prompts = import "prompts/gemini.jsonnet"; +local prompts = import "prompts/mixtral.jsonnet"; + { "vertexai-model":: "gemini-1.0-pro-001", @@ -10,80 +11,88 @@ local prompts = import "prompts/gemini.jsonnet"; "vertexai-max-output-tokens":: 4096, "vertexai-temperature":: 0.0, - services +: { + "text-completion" +: { + + create:: function(engine) - "text-completion": base + { - image: images.trustgraph, - command: [ - "text-completion-vertexai", - "-p", - url.pulsar, - "-k", - $["vertexai-private-key"], - "-r", - $["vertexai-region"], - "-x", - std.toString($["vertexai-max-output-tokens"]), - "-t", - std.toString($["vertexai-temperature"]), - "-m", - $["vertexai-model"], - ], - volumes: [ - "./vertexai:/vertexai" - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local cfgVol = engine.configVolume("./vertexai"); - "text-completion-rag": base + { - image: images.trustgraph, - command: [ - "text-completion-vertexai", - "-p", - url.pulsar, - "-k", - $["vertexai-private-key"], - "-r", - $["vertexai-region"], - "-x", - std.toString($["vertexai-max-output-tokens"]), - "-t", - std.toString($["vertexai-temperature"]), - "-m", - $["vertexai-model"], - "-i", - "non-persistent://tg/request/text-completion-rag", - "-o", - "non-persistent://tg/response/text-completion-rag-response", - ], - volumes: [ - "./vertexai:/vertexai" - ], - deploy: { - resources: { - limits: { - cpus: '0.5', - memory: '128M' - }, - reservations: { - cpus: '0.1', - memory: '128M' - } - } - }, - }, + local container = + engine.container("text-completion") + .with_image(images.trustgraph) + .with_command([ + "text-completion-vertexai", + "-p", + url.pulsar, + "-k", + $["vertexai-private-key"], + "-r", + $["vertexai-region"], + "-x", + std.toString($["vertexai-max-output-tokens"]), + "-t", + std.toString($["vertexai-temperature"]), + "-m", + $["vertexai-model"], + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M") + .with_volume_mount(cfgVol, "/vertexai"); + + local containerSet = engine.containers( + "text-completion", [ container ] + ); + + engine.resources([ + cfgVol, + containerSet, + ]) }, + + "text-completion-rag" +: { + + create:: function(engine) + + local cfgVol = engine.configVolume("./vertexai"); + + local container = + engine.container("text-completion-rag") + .with_image(images.trustgraph) + .with_command([ + "text-completion-vertexai", + "-p", + url.pulsar, + "-k", + $["vertexai-private-key"], + "-r", + $["vertexai-region"], + "-x", + std.toString($["vertexai-max-output-tokens"]), + "-t", + std.toString($["vertexai-temperature"]), + "-m", + $["vertexai-model"], + "-i", + "non-persistent://tg/request/text-completion-rag", + "-o", + "non-persistent://tg/response/text-completion-rag-response", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M") + .with_volume_mount(cfgVol, "/vertexai"); + + local containerSet = engine.containers( + "text-completion-rag", [ container ] + ); + + engine.resources([ + cfgVol, + containerSet, + ]) + + + } + } + prompts diff --git a/templates/config-to-docker-compose.jsonnet b/templates/config-to-docker-compose.jsonnet new file mode 100644 index 00000000..71346abc --- /dev/null +++ b/templates/config-to-docker-compose.jsonnet @@ -0,0 +1,20 @@ + +local engine = import "docker-compose.jsonnet"; +local decode = import "decode-config.jsonnet"; +local components = import "components.jsonnet"; + +// Import config +local config = import "config.json"; + +// Produce patterns from config +local patterns = decode(config); + +// Extract resources usnig the engine +local resources = std.foldl( + function(state, p) state + p.create(engine), + std.objectValues(patterns), + {} +); + +resources + diff --git a/templates/decode-config.jsonnet b/templates/decode-config.jsonnet new file mode 100644 index 00000000..a1bd146e --- /dev/null +++ b/templates/decode-config.jsonnet @@ -0,0 +1,29 @@ + +local components = import "components.jsonnet"; + +local apply = function(p, components) + + local component = components[p.name]; + + (component + { + + with:: function(k, v) self + { + [k]:: v + }, + + with_params:: function(pars) + self + std.foldl( + function(obj, par) obj.with(par.key, par.value), + std.objectKeysValues(pars), + self + ), + + }).with_params(p.parameters); + +local decode = function(config) + local add = function(state, c) state + apply(c, components); + local patterns = std.foldl(add, config, {}); + patterns; + +decode + diff --git a/templates/docker-compose.jsonnet b/templates/docker-compose.jsonnet new file mode 100644 index 00000000..32697c66 --- /dev/null +++ b/templates/docker-compose.jsonnet @@ -0,0 +1,154 @@ +{ + + container:: function(name) + { + + local container = self, + + name: name, + limits: {}, + reservations: {}, + ports: [], + volumes: [], + + with_image:: function(x) self + { image: x }, + + with_command:: function(x) self + { command: x }, + + with_environment:: function(x) self + { environment: x }, + + with_limits:: function(c, m) self + { limits: { cpus: c, memory: m } }, + + with_reservations:: + function(c, m) self + { reservations: { cpus: c, memory: m } }, + + with_volume_mount:: + function(vol, mnt) + self + { + volumes: super.volumes + [{ + volume: vol.name, mount: mnt + }] + }, + + with_port:: + function(src, dest, name) self + { + ports: super.ports + [ + { src: src, dest: dest, name : name } + ] + }, + + add:: function() { + services +: { + [container.name]: { + image: container.image, + deploy: { + resources: { + limits: container.limits, + reservations: container.reservations, + } + }, + restart: "on-failure:100", + } + + + (if std.objectHas(container, "command") then + { command: container.command } + else {}) + + + (if std.objectHas(container, "environment") then + { environment: container.environment } + else {}) + + + (if std.length(container.ports) > 0 then + { + ports: [ + "%d:%d" % [port.src, port.dest] + for port in container.ports + ] + } + else {}) + + + (if std.length(container.volumes) > 0 then + { + volumes: [ + "%s:%s" % [vol.volume, vol.mount] + for vol in container.volumes + ] + } + else {}) + + } + } + + }, + + service:: function(containers) + { + + local service = self, + + name: containers.name, + + with_port:: function(src, dest) self + { port: [src, dest] }, + + add:: function() { + } + + }, + + volume:: function(name) + { + + local volume = self, + + name: name, + + with_size:: function(size) self + { size: size }, + + add:: function() { + volumes +: { + [volume.name]: {} + } + } + + }, + + // FIXME: For K8s + configVolume:: function(name) + { + + local volume = self, + + name: name, + + with_size:: function(size) self + { size: size }, + + add:: function() { + } + + }, + + containers:: function(name, containers) + { + + local cont = self, + + name: name, + containers: containers, + + add:: function() std.foldl( + function(state, c) state + c.add(), + cont.containers, + {} + ), + + }, + + resources:: function(res) + std.foldl( + function(state, c) state + c.add(), + res, + {} + ), + +} + diff --git a/templates/main.jsonnet b/templates/main.jsonnet index 3e0cbc88..06a93949 100644 --- a/templates/main.jsonnet +++ b/templates/main.jsonnet @@ -1,30 +1,24 @@ -local components = { - neo4j: import "components/neo4j.jsonnet", - cassandra: import "components/cassandra.jsonnet", - pulsar: import "components/pulsar.jsonnet", - milvus: import "components/milvus.jsonnet", - qdrant: import "components/qdrant.jsonnet", - grafana: import "components/grafana.jsonnet", - trustgraph: import "components/trustgraph.jsonnet", - azure: import "components/azure.jsonnet", - bedrock: import "components/bedrock.jsonnet", - cohere: import "components/cohere.jsonnet", - claude: import "components/claude.jsonnet", - ollama: import "components/ollama.jsonnet", - openai: import "components/openai.jsonnet", - mix: import "components/mix.jsonnet", - vertexai: import "components/vertexai.jsonnet", - "embeddings-hf": import "components/embeddings-hf.jsonnet", - "embeddings-ollama": import "components/embeddings-ollama.jsonnet", - "graph-rag": import "components/graph-rag.jsonnet", - "document-rag": import "components/document-rag.jsonnet", -}; +local engine = import "docker-compose.jsonnet"; +local decode = import "decode-config.jsonnet"; +local components = import "components.jsonnet"; + +// Options local options = std.split(std.extVar("options"), ","); -local add = function(state, name) state + components[name]; +// Produce patterns from config +local patterns = std.foldl( + function(state, p) state + components[p], + options, + {} +); -local config = std.foldl(add, options, {}); +// Extract resources usnig the engine +local resources = std.foldl( + function(state, p) state + p.create(engine), + std.objectValues(patterns), + {} +); -std.manifestYamlDoc(config) +std.manifestYamlDoc(resources) diff --git a/templates/stores/cassandra.jsonnet b/templates/stores/cassandra.jsonnet index 93d8a510..2d2c556b 100644 --- a/templates/stores/cassandra.jsonnet +++ b/templates/stores/cassandra.jsonnet @@ -1,35 +1,35 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; + { - volumes +: { - cassandra: {}, - }, - services +: { - cassandra: base + { - image: images.cassandra, - ports: [ - "9042:9042" - ], - environment: { - JVM_OPTS: "-Xms256M -Xmx256M", - }, - volumes: [ - "cassandra:/var/lib/cassandra" - ], - deploy: { - resources: { - limits: { - cpus: '1.0', - memory: '800M' - }, - reservations: { - cpus: '0.5', - memory: '800M' - } - } - }, - }, + "cassandra" +: { + + create:: function(engine) + + local vol = engine.volume("cassandra").with_size("20G"); + + local container = + engine.container("cassandra") + .with_image(images.cassandra) + .with_environment({ + JVM_OPTS: "-Xms256M -Xmx256M", + }) + .with_limits("1.0", "800M") + .with_reservations("0.5", "800M") + .with_port(9042, 9042, "cassandra") + .with_volume_mount(vol, "/var/lib/cassandra"); + + local containerSet = engine.containers( + "cassandra", [ container ] + ); + + engine.resources([ + vol, + containerSet, + ]) }, + } + diff --git a/templates/stores/milvus.jsonnet b/templates/stores/milvus.jsonnet index 19779ce0..1be6993b 100644 --- a/templates/stores/milvus.jsonnet +++ b/templates/stores/milvus.jsonnet @@ -28,7 +28,11 @@ local images = import "values/images.jsonnet"; ETCD_SNAPSHOT_COUNT: "50000" }, ports: [ - "2379:2379", + { + src: 2379, + dest: 2379, + name: "api", + } ], volumes: [ "etcd:/etcd" @@ -61,7 +65,11 @@ local images = import "values/images.jsonnet"; MINIO_ROOT_PASSWORD: "minioadmin", }, ports: [ - "9001:9001", + { + src: 9001, + dest: 9001, + name: "api", + } ], volumes: [ "minio-data:/minio_data", @@ -90,8 +98,16 @@ local images = import "values/images.jsonnet"; MINIO_ADDRESS: "minio:9000", }, ports: [ - "9091:9091", - "19530:19530", + { + src: 9091, + dest: 9091, + name: "api", + }, + { + src: 19530, + dest: 19530, + name: "api2", + } ], volumes: [ "milvus:/var/lib/milvus" diff --git a/templates/stores/neo4j.jsonnet b/templates/stores/neo4j.jsonnet index 20a7c60b..4d74d73d 100644 --- a/templates/stores/neo4j.jsonnet +++ b/templates/stores/neo4j.jsonnet @@ -1,42 +1,39 @@ local base = import "base/base.jsonnet"; local images = import "values/images.jsonnet"; + { - volumes +: { - neo4j: {}, - }, + "neo4j" +: { + + create:: function(engine) - services +: { + local vol = engine.volume("neo4j").with_size("20G"); - neo4j: base + { - image: images.neo4j, - ports: [ - "7474:7474", - "7687:7687", - ], - environment: { - NEO4J_AUTH: "neo4j/password", -// NEO4J_server_bolt_listen__address: "0.0.0.0:7687", -// NEO4J_server_default__listen__address: "0.0.0.0", -// NEO4J_server_http_listen__address: "0.0.0.0:7474", - }, - volumes: [ - "neo4j:/data" - ], - deploy: { - resources: { - limits: { - cpus: '1.0', - memory: '768M' - }, - reservations: { - cpus: '0.5', - memory: '768M' - } - } - }, - }, + local container = + engine.container("neo4j") + .with_image(images.neo4j) + .with_environment({ + NEO4J_AUTH: "neo4j/password", + // NEO4J_server_bolt_listen__address: "0.0.0.0:7687", + // NEO4J_server_default__listen__address: "0.0.0.0", + // NEO4J_server_http_listen__address: "0.0.0.0:7474", + }) + .with_limits("1.0", "768M") + .with_reservations("0.5", "768M") + .with_port(7474, 7474, "api") + .with_port(7687, 7687, "api2") + .with_volume_mount(vol, "/data"); + + local containerSet = engine.containers( + "neo4j", [ container ] + ); + + engine.resources([ + vol, + containerSet, + ]) }, } + diff --git a/templates/stores/qdrant.jsonnet b/templates/stores/qdrant.jsonnet index 54f2a9e7..4e2ce40a 100644 --- a/templates/stores/qdrant.jsonnet +++ b/templates/stores/qdrant.jsonnet @@ -3,35 +3,31 @@ local images = import "values/images.jsonnet"; { - volumes +: { - qdrant: {}, - }, + "qdrant" +: { + + create:: function(engine) - services +: { + local vol = engine.volume("qdrant").with_size("20G"); - qdrant: base + { - image: images.qdrant, - ports: [ - "6333:6333", - "6334:6334", - ], - volumes: [ - "qdrant:/qdrant/storage" - ], - deploy: { - resources: { - limits: { - cpus: '1.0', - memory: '256M' - }, - reservations: { - cpus: '0.5', - memory: '256M' - } - } - }, - }, + local container = + engine.container("qdrant") + .with_image(images.qdrant) + .with_limits("1.0", "256M") + .with_reservations("0.5", "256M") + .with_port(6333, 6333, "api") + .with_port(6334, 6334, "api2") + .with_volume_mount(vol, "/qdrant/storage"); + + local containerSet = engine.containers( + "qdrant", [ container ] + ); + + engine.resources([ + vol, + containerSet, + ]) }, } + diff --git a/tg-launch-azure-cassandra.yaml b/tg-launch-azure-cassandra.yaml index 11ddebea..c4663fdd 100644 --- a/tg-launch-azure-cassandra.yaml +++ b/tg-launch-azure-cassandra.yaml @@ -102,9 +102,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": @@ -436,11 +433,11 @@ - "${AZURE_TOKEN}" - "-e" - "${AZURE_ENDPOINT}" - - "-i" - "-x" - "4096" - "-t" - "0" + - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" diff --git a/tg-launch-azure-neo4j.yaml b/tg-launch-azure-neo4j.yaml index 585af5db..9fbce529 100644 --- a/tg-launch-azure-neo4j.yaml +++ b/tg-launch-azure-neo4j.yaml @@ -85,9 +85,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": @@ -437,11 +434,11 @@ - "${AZURE_TOKEN}" - "-e" - "${AZURE_ENDPOINT}" - - "-i" - "-x" - "4096" - "-t" - "0" + - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" diff --git a/tg-launch-bedrock-cassandra.yaml b/tg-launch-bedrock-cassandra.yaml index 4671179a..f118d1ac 100644 --- a/tg-launch-bedrock-cassandra.yaml +++ b/tg-launch-bedrock-cassandra.yaml @@ -102,9 +102,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-bedrock-neo4j.yaml b/tg-launch-bedrock-neo4j.yaml index 111927ee..5128c1da 100644 --- a/tg-launch-bedrock-neo4j.yaml +++ b/tg-launch-bedrock-neo4j.yaml @@ -85,9 +85,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-claude-cassandra.yaml b/tg-launch-claude-cassandra.yaml index 4df753a9..f8bf31e3 100644 --- a/tg-launch-claude-cassandra.yaml +++ b/tg-launch-claude-cassandra.yaml @@ -102,9 +102,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-claude-neo4j.yaml b/tg-launch-claude-neo4j.yaml index 787b7403..d6b50365 100644 --- a/tg-launch-claude-neo4j.yaml +++ b/tg-launch-claude-neo4j.yaml @@ -85,9 +85,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-cohere-cassandra.yaml b/tg-launch-cohere-cassandra.yaml index e993b810..3e46d87f 100644 --- a/tg-launch-cohere-cassandra.yaml +++ b/tg-launch-cohere-cassandra.yaml @@ -102,9 +102,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-cohere-neo4j.yaml b/tg-launch-cohere-neo4j.yaml index 213616bb..122dcc40 100644 --- a/tg-launch-cohere-neo4j.yaml +++ b/tg-launch-cohere-neo4j.yaml @@ -85,9 +85,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-ollama-cassandra.yaml b/tg-launch-ollama-cassandra.yaml index 3ee7ea33..efef8170 100644 --- a/tg-launch-ollama-cassandra.yaml +++ b/tg-launch-ollama-cassandra.yaml @@ -102,9 +102,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-ollama-neo4j.yaml b/tg-launch-ollama-neo4j.yaml index 66f79248..fbc6210e 100644 --- a/tg-launch-ollama-neo4j.yaml +++ b/tg-launch-ollama-neo4j.yaml @@ -85,9 +85,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-openai-cassandra.yaml b/tg-launch-openai-cassandra.yaml index 750ef1e6..4fd9f36c 100644 --- a/tg-launch-openai-cassandra.yaml +++ b/tg-launch-openai-cassandra.yaml @@ -102,9 +102,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-openai-neo4j.yaml b/tg-launch-openai-neo4j.yaml index 3a4ffade..bd870011 100644 --- a/tg-launch-openai-neo4j.yaml +++ b/tg-launch-openai-neo4j.yaml @@ -85,9 +85,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-vertexai-cassandra.yaml b/tg-launch-vertexai-cassandra.yaml index 6b7c6748..ee52e39a 100644 --- a/tg-launch-vertexai-cassandra.yaml +++ b/tg-launch-vertexai-cassandra.yaml @@ -102,9 +102,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-launch-vertexai-neo4j.yaml b/tg-launch-vertexai-neo4j.yaml index ebf1310a..f812c7d2 100644 --- a/tg-launch-vertexai-neo4j.yaml +++ b/tg-launch-vertexai-neo4j.yaml @@ -85,9 +85,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-storage-cassandra.yaml b/tg-storage-cassandra.yaml index 5428d42f..9f55ac57 100644 --- a/tg-storage-cassandra.yaml +++ b/tg-storage-cassandra.yaml @@ -41,9 +41,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits": diff --git a/tg-storage-neo4j.yaml b/tg-storage-neo4j.yaml index 7190dcbb..1f2fcfa7 100644 --- a/tg-storage-neo4j.yaml +++ b/tg-storage-neo4j.yaml @@ -24,9 +24,6 @@ - "sh" - "-c" - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" - "depends_on": - "pulsar": - "condition": "service_started" "deploy": "resources": "limits":