mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-17 09:11:03 +02:00
Finish template mods for k8s
This commit is contained in:
parent
d0db893a95
commit
9479f4401d
4 changed files with 57 additions and 8 deletions
|
|
@ -8,6 +8,7 @@ local images = import "values/images.jsonnet";
|
|||
create:: function(engine)
|
||||
|
||||
local vol = engine.volume("prometheus-data").with_size("20G");
|
||||
|
||||
local cfgVol = engine.configVolume(
|
||||
"prometheus-cfg", "./prometheus",
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
|
||||
create:: function(engine)
|
||||
|
||||
local cfgVol = engine.configVolume(
|
||||
local cfgVol = engine.secretVolume(
|
||||
"vertexai-creds",
|
||||
"./vertexai",
|
||||
{
|
||||
|
|
@ -60,7 +60,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
|
||||
create:: function(engine)
|
||||
|
||||
local cfgVol = engine.configVolume("./vertexai");
|
||||
local cfgVol = engine.secretVolume(
|
||||
"vertexai-creds",
|
||||
"./vertexai",
|
||||
{
|
||||
"private.json": importstr "vertexai/private.json",
|
||||
}
|
||||
);
|
||||
|
||||
local container =
|
||||
engine.container("text-completion-rag")
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
function(vol, mnt)
|
||||
self + {
|
||||
volumes: super.volumes + [{
|
||||
volume: vol.name, mount: mnt
|
||||
volume: vol, mount: mnt
|
||||
}]
|
||||
},
|
||||
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
(if std.length(container.volumes) > 0 then
|
||||
{
|
||||
volumes: [
|
||||
"%s:%s" % [vol.volume, vol.mount]
|
||||
"%s:%s" % [vol.volume.name, vol.mount]
|
||||
for vol in container.volumes
|
||||
]
|
||||
}
|
||||
|
|
@ -112,13 +112,26 @@
|
|||
|
||||
},
|
||||
|
||||
// FIXME: For K8s
|
||||
configVolume:: function(name)
|
||||
configVolume:: function(name, dir, parts)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: name,
|
||||
name: dir,
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
secretVolume:: function(name, dir, parts)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: dir,
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
|
|
|
|||
|
|
@ -202,7 +202,6 @@
|
|||
|
||||
},
|
||||
|
||||
// FIXME: For K8s
|
||||
configVolume:: function(name, dir, parts)
|
||||
{
|
||||
|
||||
|
|
@ -233,6 +232,36 @@
|
|||
|
||||
},
|
||||
|
||||
secretVolume:: function(name, dir, parts)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: name,
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() {
|
||||
resources +: {
|
||||
[volume.name + "-cm"]: {
|
||||
apiVersion: "v1",
|
||||
kind: "Secret",
|
||||
metadata: {
|
||||
name: volume.name,
|
||||
namespace: "trustgraph",
|
||||
},
|
||||
data: parts
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
volRef:: function() {
|
||||
name: volume.name,
|
||||
secret: { secretName: volume.name + "-cm" },
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
containers:: function(name, containers)
|
||||
{
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue