2024-07-10 23:20:06 +01:00
|
|
|
|
|
|
|
|
# VERSION=$(shell git describe | sed 's/^v//')
|
2024-09-29 23:50:57 +01:00
|
|
|
VERSION=0.11.3
|
2024-07-10 23:20:06 +01:00
|
|
|
|
2024-08-12 17:39:54 +01:00
|
|
|
DOCKER=podman
|
|
|
|
|
|
2024-07-10 23:20:06 +01:00
|
|
|
all: container
|
|
|
|
|
|
|
|
|
|
CONTAINER=docker.io/trustgraph/trustgraph-flow
|
|
|
|
|
|
|
|
|
|
container:
|
2024-08-12 17:39:54 +01:00
|
|
|
${DOCKER} build -f Containerfile -t ${CONTAINER}:${VERSION} \
|
2024-07-10 23:20:06 +01:00
|
|
|
--format docker
|
|
|
|
|
|
|
|
|
|
push:
|
2024-08-12 17:39:54 +01:00
|
|
|
${DOCKER} push ${CONTAINER}:${VERSION}
|
2024-07-10 23:20:06 +01:00
|
|
|
|
|
|
|
|
start:
|
2024-08-12 17:39:54 +01:00
|
|
|
${DOCKER} run -i -t --name ${NAME} \
|
2024-07-10 23:20:06 +01:00
|
|
|
-i -t \
|
|
|
|
|
-p 8081:8081 \
|
|
|
|
|
-v $$(pwd)/keys:/keys \
|
|
|
|
|
-v $$(pwd)/configs:/configs \
|
|
|
|
|
${CONTAINER}:${VERSION}
|
|
|
|
|
|
|
|
|
|
stop:
|
2024-08-12 17:39:54 +01:00
|
|
|
${DOCKER} rm -f ${NAME}
|
2024-07-10 23:20:06 +01:00
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -rf wheels/
|
|
|
|
|
|
2024-07-15 19:42:16 +01:00
|
|
|
set-version:
|
2024-08-30 17:47:35 +01:00
|
|
|
echo '"${VERSION}"' > templates/values/version.jsonnet
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-09-16 08:18:01 -07:00
|
|
|
TEMPLATES=azure bedrock claude cohere mix llamafile ollama openai vertexai \
|
2024-08-21 16:20:21 +01:00
|
|
|
openai-neo4j storage
|
|
|
|
|
|
2024-08-22 00:19:55 +01:00
|
|
|
DCS=$(foreach template,${TEMPLATES},${template:%=tg-launch-%.yaml})
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-09-16 08:18:01 -07:00
|
|
|
MODELS=azure bedrock claude cohere llamafile ollama openai vertexai
|
2024-08-22 21:20:17 +01:00
|
|
|
GRAPHS=cassandra neo4j
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-08-30 17:47:35 +01:00
|
|
|
# tg-launch-%.yaml: templates/%.jsonnet templates/components/version.jsonnet
|
|
|
|
|
# jsonnet -Jtemplates \
|
|
|
|
|
# -S ${@:tg-launch-%.yaml=templates/%.jsonnet} > $@
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-08-27 23:37:24 +01:00
|
|
|
# VECTORDB=milvus
|
|
|
|
|
VECTORDB=qdrant
|
|
|
|
|
|
2024-08-30 17:47:35 +01:00
|
|
|
JSONNET_FLAGS=-J templates -J .
|
|
|
|
|
|
2024-09-29 18:13:34 +01:00
|
|
|
# Temporarily going back to how templates were built in 0.9 because this
|
|
|
|
|
# is going away in 0.11.
|
2024-09-05 16:40:47 +01:00
|
|
|
|
2024-09-29 18:13:34 +01:00
|
|
|
update-templates: update-dcs
|
|
|
|
|
# update-minikubes
|
2024-09-09 17:16:50 +01:00
|
|
|
|
|
|
|
|
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
|
2024-08-25 23:57:30 +01:00
|
|
|
for graph in ${GRAPHS}; do \
|
2024-08-27 23:37:24 +01:00
|
|
|
cm=$${graph},pulsar,${VECTORDB},grafana; \
|
2024-09-09 17:16:50 +01:00
|
|
|
input=templates/opts-to-docker-compose.jsonnet; \
|
2024-09-29 18:13:34 +01:00
|
|
|
output=tg-storage-$${graph}.yaml; \
|
2024-08-25 23:57:30 +01:00
|
|
|
echo $${graph} '->' $${output}; \
|
2024-08-30 17:47:35 +01:00
|
|
|
jsonnet ${JSONNET_FLAGS} \
|
2024-09-09 17:16:50 +01:00
|
|
|
--ext-str options=$${cm} $${input} | \
|
|
|
|
|
${JSON_TO_YAML} > $${output}; \
|
2024-08-25 23:57:30 +01:00
|
|
|
done
|
2024-08-22 21:20:17 +01:00
|
|
|
for model in ${MODELS}; do \
|
|
|
|
|
for graph in ${GRAPHS}; do \
|
2024-09-03 00:09:15 +01:00
|
|
|
cm=$${graph},pulsar,${VECTORDB},embeddings-hf,graph-rag,grafana,trustgraph,$${model}; \
|
2024-09-09 17:16:50 +01:00
|
|
|
input=templates/opts-to-docker-compose.jsonnet; \
|
2024-09-29 18:13:34 +01:00
|
|
|
output=tg-launch-$${model}-$${graph}.yaml; \
|
2024-08-22 21:20:17 +01:00
|
|
|
echo $${model} + $${graph} '->' $${output}; \
|
2024-08-30 17:47:35 +01:00
|
|
|
jsonnet ${JSONNET_FLAGS} \
|
2024-09-09 17:16:50 +01:00
|
|
|
--ext-str options=$${cm} $${input} | \
|
|
|
|
|
${JSON_TO_YAML} > $${output}; \
|
2024-08-22 21:20:17 +01:00
|
|
|
done; \
|
|
|
|
|
done
|
2024-09-07 18:59:38 +01:00
|
|
|
|
2024-09-09 17:16:50 +01:00
|
|
|
update-minikubes: set-version
|
2024-09-29 18:13:34 +01:00
|
|
|
rm -rf deploy/minikube
|
|
|
|
|
mkdir -p deploy/minikube
|
2024-09-09 17:16:50 +01:00
|
|
|
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
|
2024-09-07 18:59:38 +01:00
|
|
|
|
2024-09-28 11:55:30 +01:00
|
|
|
docker-hub-login:
|
|
|
|
|
cat docker-token.txt | \
|
|
|
|
|
docker login -u trustgraph --password-stdin registry-1.docker.io
|
|
|
|
|
|
2024-09-07 18:59:38 +01:00
|
|
|
FORCE:
|
|
|
|
|
|
2024-09-09 17:16:50 +01:00
|
|
|
IGNOREconfig.yaml: config.json FORCE
|
|
|
|
|
jsonnet -J . -J templates/ templates/config-to-gcp-k8s.jsonnet | \
|
|
|
|
|
python3 -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j))' > $@
|
|
|
|
|
|
|
|
|
|
config.yaml: config.json FORCE
|
|
|
|
|
jsonnet -J . -J templates/ templates/config-to-minikube-k8s.jsonnet | \
|
|
|
|
|
python3 -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j))' > $@
|