Refactor templates (#52)

* Switching from docker compose to abstract form - should be easier to k8s later
* Text loader util
* Recreate templates
This commit is contained in:
cybermaggedon 2024-09-05 16:40:47 +01:00 committed by GitHub
parent af5508ff68
commit 65d7f6d261
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 1659 additions and 1277 deletions

View file

@ -5,54 +5,62 @@ local neo4j = import "stores/neo4j.jsonnet";
neo4j + {
services +: {
"neo4j-url":: "bolt://neo4j:7687",
"query-triples": base + {
image: images.trustgraph,
command: [
"triples-query-neo4j",
"-p",
url.pulsar,
"-g",
"bolt://neo4j:7687",
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
"store-triples" +: {
create:: function(engine)
"store-triples": base + {
image: images.trustgraph,
command: [
"triples-write-neo4j",
"-p",
url.pulsar,
"-g",
"bolt://neo4j:7687",
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
}
local container =
engine.container("store-triples")
.with_image(images.trustgraph)
.with_command([
"triples-write-neo4j",
"-p",
url.pulsar,
"-g",
$["neo4j-url"],
])
.with_limits("0.5", "128M")
.with_reservations("0.1", "128M");
local containerSet = engine.containers(
"store-triples", [ container ]
);
engine.resources([
containerSet,
])
},
"query-triples" +: {
create:: function(engine)
local container =
engine.container("query-triples")
.with_image(images.trustgraph)
.with_command([
"triples-query-neo4j",
"-p",
url.pulsar,
"-g",
$["neo4j-url"],
])
.with_limits("0.5", "128M")
.with_reservations("0.1", "128M");
local containerSet = engine.containers(
"query-triples", [ container ]
);
engine.resources([
containerSet,
])
}
}