mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-27 17:36:23 +02:00
Refactor templates (#52)
* Switching from docker compose to abstract form - should be easier to k8s later * Text loader util * Recreate templates
This commit is contained in:
parent
af5508ff68
commit
65d7f6d261
47 changed files with 1659 additions and 1277 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue