mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16: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,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,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue