2024-08-30 17:47:35 +01:00
|
|
|
local base = import "base/base.jsonnet";
|
|
|
|
|
local images = import "values/images.jsonnet";
|
|
|
|
|
local url = import "values/url.jsonnet";
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-08-30 17:47:35 +01:00
|
|
|
{
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-11-20 20:56:23 +00:00
|
|
|
"api-gateway-port":: 8088,
|
|
|
|
|
"api-gateway-timeout":: 600,
|
|
|
|
|
|
2024-08-30 17:47:35 +01:00
|
|
|
"chunk-size":: 250,
|
|
|
|
|
"chunk-overlap":: 15,
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-11-20 20:56:23 +00:00
|
|
|
"api-gateway" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
|
|
|
|
|
2024-12-02 19:57:21 +00:00
|
|
|
local envSecrets = engine.envSecrets("gateway-secret")
|
|
|
|
|
.with_env_var("GATEWAY_SECRET", "gateway-secret");
|
|
|
|
|
|
2024-11-20 20:56:23 +00:00
|
|
|
local port = $["api-gateway-port"];
|
|
|
|
|
|
|
|
|
|
local container =
|
|
|
|
|
engine.container("api-gateway")
|
2025-01-28 19:36:05 +00:00
|
|
|
.with_image(images.trustgraph_flow)
|
2024-11-20 20:56:23 +00:00
|
|
|
.with_command([
|
|
|
|
|
"api-gateway",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
"--timeout",
|
|
|
|
|
std.toString($["api-gateway-timeout"]),
|
|
|
|
|
"--port",
|
|
|
|
|
std.toString(port),
|
|
|
|
|
])
|
2024-12-02 19:57:21 +00:00
|
|
|
.with_env_var_secrets(envSecrets)
|
2024-11-20 20:56:23 +00:00
|
|
|
.with_limits("0.5", "256M")
|
|
|
|
|
.with_reservations("0.1", "256M")
|
|
|
|
|
.with_port(8000, 8000, "metrics")
|
|
|
|
|
.with_port(port, port, "api");
|
|
|
|
|
|
|
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"api-gateway", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8000, 8000, "metrics")
|
|
|
|
|
.with_port(port, port, "api");
|
|
|
|
|
|
|
|
|
|
engine.resources([
|
2024-12-02 19:57:21 +00:00
|
|
|
envSecrets,
|
2024-11-20 20:56:23 +00:00
|
|
|
containerSet,
|
|
|
|
|
service,
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
"chunker" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
2024-08-30 17:47:35 +01:00
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
local container =
|
|
|
|
|
engine.container("chunker")
|
2025-01-28 19:36:05 +00:00
|
|
|
.with_image(images.trustgraph_flow)
|
2024-09-05 16:40:47 +01:00
|
|
|
.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");
|
2024-08-30 17:47:35 +01:00
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"chunker", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
2024-09-07 18:59:38 +01:00
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8000, 8000, "metrics");
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
engine.resources([
|
|
|
|
|
containerSet,
|
2024-09-07 18:59:38 +01:00
|
|
|
service,
|
2024-09-05 16:40:47 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
"pdf-decoder" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
|
|
|
|
|
|
|
|
|
local container =
|
|
|
|
|
engine.container("pdf-decoder")
|
2025-01-28 19:36:05 +00:00
|
|
|
.with_image(images.trustgraph_flow)
|
2024-09-05 16:40:47 +01:00
|
|
|
.with_command([
|
|
|
|
|
"pdf-decoder",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
])
|
|
|
|
|
.with_limits("0.5", "128M")
|
|
|
|
|
.with_reservations("0.1", "128M");
|
|
|
|
|
|
|
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"pdf-decoder", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
2024-09-07 18:59:38 +01:00
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8000, 8000, "metrics");
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
engine.resources([
|
|
|
|
|
containerSet,
|
2024-09-07 18:59:38 +01:00
|
|
|
service,
|
2024-09-05 16:40:47 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2024-09-29 19:48:35 +01:00
|
|
|
"metering" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
|
|
|
|
|
|
|
|
|
local container =
|
|
|
|
|
engine.container("metering")
|
2025-01-28 19:36:05 +00:00
|
|
|
.with_image(images.trustgraph_flow)
|
2024-09-29 19:48:35 +01:00
|
|
|
.with_command([
|
|
|
|
|
"metering",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
])
|
|
|
|
|
.with_limits("0.5", "128M")
|
|
|
|
|
.with_reservations("0.1", "128M");
|
|
|
|
|
|
|
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"metering", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8000, 8000, "metrics");
|
|
|
|
|
|
|
|
|
|
engine.resources([
|
|
|
|
|
containerSet,
|
|
|
|
|
service,
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2024-09-29 20:15:03 +01:00
|
|
|
"metering-rag" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
|
|
|
|
|
|
|
|
|
local container =
|
|
|
|
|
engine.container("metering-rag")
|
2025-01-28 19:36:05 +00:00
|
|
|
.with_image(images.trustgraph_flow)
|
2024-09-29 20:15:03 +01:00
|
|
|
.with_command([
|
|
|
|
|
"metering",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
"-i",
|
2024-12-02 17:41:30 +00:00
|
|
|
"non-persistent://tg/response/text-completion-rag",
|
2024-09-29 20:15:03 +01:00
|
|
|
])
|
|
|
|
|
.with_limits("0.5", "128M")
|
|
|
|
|
.with_reservations("0.1", "128M");
|
|
|
|
|
|
|
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"metering-rag", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8000, 8000, "metrics");
|
|
|
|
|
|
|
|
|
|
engine.resources([
|
|
|
|
|
containerSet,
|
|
|
|
|
service,
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2025-01-11 11:40:42 +00:00
|
|
|
}
|
2024-08-13 17:30:59 +01:00
|
|
|
|