Fix API gateway integration, added to templates (#165)

This commit is contained in:
cybermaggedon 2024-11-20 20:56:23 +00:00 committed by GitHub
parent 92b84441eb
commit ba6d6c13af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 81 additions and 24 deletions

View file

@ -5,9 +5,51 @@ local prompt = import "prompt-template.jsonnet";
{
"api-gateway-port":: 8088,
"api-gateway-timeout":: 600,
"chunk-size":: 250,
"chunk-overlap":: 15,
"api-gateway" +: {
create:: function(engine)
local port = $["api-gateway-port"];
local container =
engine.container("api-gateway")
.with_image(images.trustgraph)
.with_command([
"api-gateway",
"-p",
url.pulsar,
"--timeout",
std.toString($["api-gateway-timeout"]),
"--port",
std.toString(port),
])
.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([
containerSet,
service,
])
},
"chunker" +: {
create:: function(engine)