Reworked templater to produce docker compose and minikube output

This commit is contained in:
Cyber MacGeddon 2024-09-08 21:55:37 +01:00
parent 19625d1cde
commit 713d903293
59 changed files with 37925 additions and 7034 deletions

View file

@ -1,6 +1,6 @@
# VERSION=$(shell git describe | sed 's/^v//')
VERSION=0.9.3
VERSION=0.10.0
DOCKER=podman
@ -50,23 +50,45 @@ VECTORDB=qdrant
JSONNET_FLAGS=-J templates -J .
update-templates: set-version
update-templates: update-dcs update-minikubes
JSON_TO_YAML=python3 -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j))'
# JSON_TO_YAML=cat
update-dcs: set-version
rm -rf deploy
mkdir -p deploy/docker-compose deploy/minikube
for graph in ${GRAPHS}; do \
cm=$${graph},pulsar,${VECTORDB},grafana; \
input=templates/main.jsonnet; \
output=tg-storage-$${graph}.yaml; \
input=templates/opts-to-docker-compose.jsonnet; \
output=deploy/docker-compose/tg-storage-$${graph}.yaml; \
echo $${graph} '->' $${output}; \
jsonnet ${JSONNET_FLAGS} \
--ext-str options=$${cm} -S $${input} > $${output}; \
--ext-str options=$${cm} $${input} | \
${JSON_TO_YAML} > $${output}; \
done
for model in ${MODELS}; do \
for graph in ${GRAPHS}; do \
cm=$${graph},pulsar,${VECTORDB},embeddings-hf,graph-rag,grafana,trustgraph,$${model}; \
input=templates/main.jsonnet; \
output=tg-launch-$${model}-$${graph}.yaml; \
input=templates/opts-to-docker-compose.jsonnet; \
output=deploy/docker-compose/tg-launch-$${model}-$${graph}.yaml; \
echo $${model} + $${graph} '->' $${output}; \
jsonnet ${JSONNET_FLAGS} \
--ext-str options=$${cm} -S $${input} > $${output}; \
--ext-str options=$${cm} $${input} | \
${JSON_TO_YAML} > $${output}; \
done; \
done
update-minikubes: set-version
for model in ${MODELS}; do \
for graph in ${GRAPHS}; do \
cm=$${graph},pulsar,${VECTORDB},embeddings-hf,graph-rag,grafana,trustgraph,$${model}; \
input=templates/opts-to-minikube-k8s.jsonnet; \
output=deploy/minikube/tg-launch-$${model}-$${graph}.yaml; \
echo $${model} + $${graph} '->' $${output}; \
jsonnet ${JSONNET_FLAGS} \
--ext-str options=$${cm} $${input} | \
${JSON_TO_YAML} > $${output}; \
done; \
done