mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-16 16:51:02 +02:00
Broadly working in k8s on GCP
This commit is contained in:
parent
614ffc0fd3
commit
8b48a12619
22 changed files with 221 additions and 21 deletions
|
|
@ -37,8 +37,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -74,8 +79,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,8 +44,13 @@ local chunker = import "chunker-recursive.jsonnet";
|
|||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -85,8 +90,13 @@ local chunker = import "chunker-recursive.jsonnet";
|
|||
"text-completion-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,13 @@ cassandra + {
|
|||
"stop-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -54,8 +59,13 @@ cassandra + {
|
|||
"query-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"chunker", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -34,8 +34,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -69,8 +74,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -68,8 +73,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"document-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -21,15 +21,20 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"-m",
|
||||
$["embeddings-model"],
|
||||
])
|
||||
.with_limits("1.0", "256M")
|
||||
.with_reservations("0.5", "256M");
|
||||
.with_limits("1.0", "400M")
|
||||
.with_reservations("0.5", "400M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -30,8 +30,13 @@ local url = import "values/url.jsonnet";
|
|||
"embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -27,8 +27,13 @@ local url = import "values/url.jsonnet";
|
|||
"kg-extract-definitions", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -52,8 +57,13 @@ local url = import "values/url.jsonnet";
|
|||
"kg-extract-relationships", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -87,8 +97,13 @@ local url = import "values/url.jsonnet";
|
|||
"graph-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -27,8 +27,13 @@ milvus + {
|
|||
"store-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -54,8 +59,13 @@ milvus + {
|
|||
"query-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -81,8 +91,13 @@ milvus + {
|
|||
"store-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -108,8 +123,13 @@ milvus + {
|
|||
"query-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,13 @@ neo4j + {
|
|||
"store-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -55,8 +60,13 @@ neo4j + {
|
|||
"query-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,13 @@ local prompts = import "prompts/slm.jsonnet";
|
|||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -64,8 +69,13 @@ local prompts = import "prompts/slm.jsonnet";
|
|||
"text-completion-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -74,8 +79,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"prompt", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -61,8 +66,13 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"prompt-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -39,8 +39,13 @@ local default_prompts = import "prompts/default-prompts.jsonnet";
|
|||
"prompt", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -82,8 +87,13 @@ local default_prompts = import "prompts/default-prompts.jsonnet";
|
|||
"prompt-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ local images = import "values/images.jsonnet";
|
|||
.with_command(["bin/pulsar", "standalone"])
|
||||
// .with_command(["/bin/sh", "-c", "sleep 9999999"])
|
||||
.with_environment({
|
||||
"PULSAR_MEM": "-Xms700M -Xmx700M"
|
||||
"PULSAR_MEM": "-Xms600M -Xmx600M"
|
||||
})
|
||||
.with_limits("1.0", "1500M")
|
||||
.with_reservations("0.5", "1500M")
|
||||
.with_limits("2.0", "1500M")
|
||||
.with_reservations("1.0", "1500M")
|
||||
// .with_volume_mount(confVolume, "/pulsar/conf")
|
||||
.with_volume_mount(dataVolume, "/pulsar/data")
|
||||
.with_port(6650, 6650, "bookie")
|
||||
|
|
@ -31,11 +31,10 @@ local images = import "values/images.jsonnet";
|
|||
.with_command([
|
||||
"sh",
|
||||
"-c",
|
||||
"sleep 1000000",
|
||||
// "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response",
|
||||
"while true; do pulsar-admin --admin-url http://pulsar:8080 tenants create tg ; pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow ; pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request ; pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response ; pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response; sleep 20; done",
|
||||
])
|
||||
.with_limits("2", "256M")
|
||||
.with_reservations("0.1", "256M");
|
||||
.with_limits("1", "400M")
|
||||
.with_reservations("0.1", "400M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"pulsar",
|
||||
|
|
|
|||
|
|
@ -27,8 +27,13 @@ qdrant + {
|
|||
"store-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -54,8 +59,13 @@ qdrant + {
|
|||
"query-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -81,8 +91,13 @@ qdrant + {
|
|||
"store-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -108,8 +123,13 @@ qdrant + {
|
|||
"query-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8080, 8080, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,13 @@ local prompt = import "prompt-template.jsonnet";
|
|||
"chunker", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -56,8 +61,13 @@ local prompt = import "prompt-template.jsonnet";
|
|||
"pdf-decoder", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -81,8 +91,13 @@ local prompt = import "prompt-template.jsonnet";
|
|||
"vectorize", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -49,9 +49,14 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
cfgVol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
|
@ -98,12 +103,16 @@ local prompts = import "prompts/mixtral.jsonnet";
|
|||
"text-completion-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
cfgVol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
|
||||
} + prompts
|
||||
|
|
|
|||
|
|
@ -25,9 +25,13 @@ local sc = {
|
|||
metadata: {
|
||||
name: "tg",
|
||||
},
|
||||
provisioner: "k8s.io/minikube-hostpath",
|
||||
provisioner: "pd.csi.storage.gke.io",
|
||||
parameters: {
|
||||
type: "pd-balanced",
|
||||
"csi.storage.k8s.io/fstype": "ext4",
|
||||
},
|
||||
reclaimPolicy: "Delete",
|
||||
volumeBindingMode: "Immediate",
|
||||
volumeBindingMode: "WaitForFirstConsumer",
|
||||
};
|
||||
|
||||
//patterns["pulsar"].create(engine)
|
||||
|
|
@ -46,5 +50,3 @@ local resourceList = {
|
|||
|
||||
resourceList
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -139,6 +139,9 @@
|
|||
|
||||
},
|
||||
|
||||
// Just an alias
|
||||
internalService:: self.service,
|
||||
|
||||
service:: function(containers)
|
||||
{
|
||||
|
||||
|
|
@ -167,7 +170,6 @@
|
|||
namespace: "trustgraph",
|
||||
},
|
||||
spec: {
|
||||
// type: "NodePort",
|
||||
selector: {
|
||||
app: service.name,
|
||||
},
|
||||
|
|
@ -175,7 +177,6 @@
|
|||
{
|
||||
port: port.src,
|
||||
targetPort: port.dest,
|
||||
// nodePort: port.nodeport,
|
||||
name: port.name,
|
||||
}
|
||||
for port in service.ports
|
||||
|
|
@ -196,7 +197,7 @@
|
|||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() [
|
||||
|
||||
/*
|
||||
{
|
||||
|
||||
apiVersion: "v1",
|
||||
|
|
@ -209,16 +210,15 @@
|
|||
},
|
||||
spec: {
|
||||
storageClassName: "tg",
|
||||
volumeMode: "Filesystem",
|
||||
capacity: {
|
||||
storage: volume.size,
|
||||
},
|
||||
accessModes: [ "ReadWriteOnce" ],
|
||||
persistentVolumeReclaimPolicy: "Delete",
|
||||
hostPath: {
|
||||
path: "/data/k8s/" + volume.name,
|
||||
}
|
||||
}
|
||||
},
|
||||
*/
|
||||
{
|
||||
apiVersion: "v1",
|
||||
kind: "PersistentVolumeClaim",
|
||||
|
|
@ -234,7 +234,7 @@
|
|||
storage: volume.size,
|
||||
}
|
||||
},
|
||||
volumeName: volume.name,
|
||||
// volumeName: volume.name,
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue