2024-09-03 00:09:15 +01:00
|
|
|
local base = import "base/base.jsonnet";
|
|
|
|
|
local images = import "values/images.jsonnet";
|
|
|
|
|
local url = import "values/url.jsonnet";
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"embeddings-model":: "mxbai-embed-large",
|
|
|
|
|
"ollama-url":: "${OLLAMA_HOST}",
|
|
|
|
|
|
2024-09-05 18:17:47 +01:00
|
|
|
embeddings +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
|
|
|
|
|
|
|
|
|
local container =
|
|
|
|
|
engine.container("embeddings")
|
|
|
|
|
.with_image(images.trustgraph)
|
|
|
|
|
.with_command([
|
|
|
|
|
"embeddings-ollama",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
"-m",
|
|
|
|
|
$["embeddings-model"],
|
|
|
|
|
"-r",
|
|
|
|
|
$["ollama-url"],
|
|
|
|
|
])
|
|
|
|
|
.with_limits("0.5", "128M")
|
|
|
|
|
.with_reservations("0.1", "128M");
|
|
|
|
|
|
|
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"embeddings", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
2024-09-07 18:59:38 +01:00
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8000, 8000, "metrics");
|
|
|
|
|
|
2024-09-05 18:17:47 +01:00
|
|
|
engine.resources([
|
|
|
|
|
containerSet,
|
2024-09-07 18:59:38 +01:00
|
|
|
service,
|
2024-09-05 18:17:47 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
2024-09-03 00:09:15 +01:00
|
|
|
|