diff --git a/templates/components/trustgraph.jsonnet b/templates/components/trustgraph.jsonnet index c7615ed4..b387f0d3 100644 --- a/templates/components/trustgraph.jsonnet +++ b/templates/components/trustgraph.jsonnet @@ -102,5 +102,35 @@ local prompt = import "prompt-template.jsonnet"; }, + "metering" +: { + + create:: function(engine) + + local container = + engine.container("metering") + .with_image(images.trustgraph) + .with_command([ + "metering", + "-p", + url.pulsar, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "metering", [ container ] + ); + + local service = + engine.internalService(containerSet) + .with_port(8000, 8000, "metrics"); + + engine.resources([ + containerSet, + service, + ]) + + }, + } + prompt diff --git a/tg-launch-azure-cassandra.yaml b/tg-launch-azure-cassandra.yaml index a2ec9637..3969cf0d 100644 --- a/tg-launch-azure-cassandra.yaml +++ b/tg-launch-azure-cassandra.yaml @@ -162,6 +162,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-azure-neo4j.yaml b/tg-launch-azure-neo4j.yaml index 9ac54244..76206719 100644 --- a/tg-launch-azure-neo4j.yaml +++ b/tg-launch-azure-neo4j.yaml @@ -145,6 +145,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-bedrock-cassandra.yaml b/tg-launch-bedrock-cassandra.yaml index 27386ed7..bf9fcac6 100644 --- a/tg-launch-bedrock-cassandra.yaml +++ b/tg-launch-bedrock-cassandra.yaml @@ -162,6 +162,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-bedrock-neo4j.yaml b/tg-launch-bedrock-neo4j.yaml index 3f47c6aa..01381794 100644 --- a/tg-launch-bedrock-neo4j.yaml +++ b/tg-launch-bedrock-neo4j.yaml @@ -145,6 +145,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-claude-cassandra.yaml b/tg-launch-claude-cassandra.yaml index b852f04d..1ba47dff 100644 --- a/tg-launch-claude-cassandra.yaml +++ b/tg-launch-claude-cassandra.yaml @@ -162,6 +162,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-claude-neo4j.yaml b/tg-launch-claude-neo4j.yaml index 818bb3b5..173f7ec8 100644 --- a/tg-launch-claude-neo4j.yaml +++ b/tg-launch-claude-neo4j.yaml @@ -145,6 +145,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-cohere-cassandra.yaml b/tg-launch-cohere-cassandra.yaml index 88e360b4..feba0d82 100644 --- a/tg-launch-cohere-cassandra.yaml +++ b/tg-launch-cohere-cassandra.yaml @@ -162,6 +162,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-cohere-neo4j.yaml b/tg-launch-cohere-neo4j.yaml index d7caa9bf..e82fb8d1 100644 --- a/tg-launch-cohere-neo4j.yaml +++ b/tg-launch-cohere-neo4j.yaml @@ -145,6 +145,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-llamafile-cassandra.yaml b/tg-launch-llamafile-cassandra.yaml index 647d7fb4..69c4b9c9 100644 --- a/tg-launch-llamafile-cassandra.yaml +++ b/tg-launch-llamafile-cassandra.yaml @@ -162,6 +162,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-llamafile-neo4j.yaml b/tg-launch-llamafile-neo4j.yaml index 8c7fd2a1..65175d86 100644 --- a/tg-launch-llamafile-neo4j.yaml +++ b/tg-launch-llamafile-neo4j.yaml @@ -145,6 +145,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-ollama-cassandra.yaml b/tg-launch-ollama-cassandra.yaml index 82a45d73..2446a273 100644 --- a/tg-launch-ollama-cassandra.yaml +++ b/tg-launch-ollama-cassandra.yaml @@ -162,6 +162,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-ollama-neo4j.yaml b/tg-launch-ollama-neo4j.yaml index 6beaab8d..b97ad5e5 100644 --- a/tg-launch-ollama-neo4j.yaml +++ b/tg-launch-ollama-neo4j.yaml @@ -145,6 +145,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-openai-cassandra.yaml b/tg-launch-openai-cassandra.yaml index aacf2ba6..81b98003 100644 --- a/tg-launch-openai-cassandra.yaml +++ b/tg-launch-openai-cassandra.yaml @@ -162,6 +162,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-openai-neo4j.yaml b/tg-launch-openai-neo4j.yaml index f5216178..8193fc0b 100644 --- a/tg-launch-openai-neo4j.yaml +++ b/tg-launch-openai-neo4j.yaml @@ -145,6 +145,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-vertexai-cassandra.yaml b/tg-launch-vertexai-cassandra.yaml index 79560eeb..e4cbfe70 100644 --- a/tg-launch-vertexai-cassandra.yaml +++ b/tg-launch-vertexai-cassandra.yaml @@ -162,6 +162,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-vertexai-neo4j.yaml b/tg-launch-vertexai-neo4j.yaml index 5f8bf5fa..b3fac0cb 100644 --- a/tg-launch-vertexai-neo4j.yaml +++ b/tg-launch-vertexai-neo4j.yaml @@ -145,6 +145,21 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering: + command: + - metering + - -p + - pulsar://pulsar:6650 + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: