2024-08-30 17:47:35 +01:00
|
|
|
local base = import "base/base.jsonnet";
|
|
|
|
|
local images = import "values/images.jsonnet";
|
2024-09-30 12:19:22 +01:00
|
|
|
local url = import "values/url.jsonnet";
|
2024-09-05 16:40:47 +01:00
|
|
|
|
2024-08-13 17:30:59 +01:00
|
|
|
{
|
2024-09-05 16:40:47 +01:00
|
|
|
|
|
|
|
|
"pulsar" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
|
|
|
|
|
2024-09-07 18:59:38 +01:00
|
|
|
// local confVolume = engine.volume("pulsar-conf").with_size("2G");
|
2024-09-05 18:17:47 +01:00
|
|
|
local dataVolume = engine.volume("pulsar-data").with_size("20G");
|
|
|
|
|
|
|
|
|
|
local container =
|
|
|
|
|
engine.container("pulsar")
|
|
|
|
|
.with_image(images.pulsar)
|
2024-09-07 18:59:38 +01:00
|
|
|
.with_command(["bin/pulsar", "standalone"])
|
2024-09-05 18:17:47 +01:00
|
|
|
.with_environment({
|
2024-09-07 18:59:38 +01:00
|
|
|
"PULSAR_MEM": "-Xms600M -Xmx600M"
|
2024-09-05 18:17:47 +01:00
|
|
|
})
|
2024-09-07 18:59:38 +01:00
|
|
|
.with_limits("2.0", "1500M")
|
|
|
|
|
.with_reservations("1.0", "1500M")
|
|
|
|
|
// .with_volume_mount(confVolume, "/pulsar/conf")
|
2024-09-05 18:17:47 +01:00
|
|
|
.with_volume_mount(dataVolume, "/pulsar/data")
|
|
|
|
|
.with_port(6650, 6650, "bookie")
|
|
|
|
|
.with_port(8080, 8080, "http");
|
|
|
|
|
|
|
|
|
|
local adminContainer =
|
|
|
|
|
engine.container("init-pulsar")
|
2024-09-30 12:19:22 +01:00
|
|
|
.with_image(images.trustgraph)
|
2024-09-05 18:17:47 +01:00
|
|
|
.with_command([
|
2024-09-30 12:19:22 +01:00
|
|
|
"tg-init-pulsar",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar_admin,
|
2024-09-05 18:17:47 +01:00
|
|
|
])
|
2024-09-30 12:19:22 +01:00
|
|
|
.with_limits("1", "128M")
|
|
|
|
|
.with_reservations("0.1", "128M");
|
2024-09-05 18:17:47 +01:00
|
|
|
|
|
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"pulsar",
|
|
|
|
|
[
|
2024-09-07 18:59:38 +01:00
|
|
|
container
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
local adminContainerSet = engine.containers(
|
|
|
|
|
"init-pulsar",
|
|
|
|
|
[
|
|
|
|
|
adminContainer
|
2024-09-05 18:17:47 +01:00
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
local service =
|
|
|
|
|
engine.service(containerSet)
|
2024-09-07 18:59:38 +01:00
|
|
|
.with_port(6650, 6650, "bookie")
|
|
|
|
|
.with_port(8080, 8080, "http");
|
2024-09-05 18:17:47 +01:00
|
|
|
|
|
|
|
|
engine.resources([
|
2024-09-07 18:59:38 +01:00
|
|
|
// confVolume,
|
2024-09-05 18:17:47 +01:00
|
|
|
dataVolume,
|
|
|
|
|
containerSet,
|
2024-09-07 18:59:38 +01:00
|
|
|
adminContainerSet,
|
2024-09-05 18:17:47 +01:00
|
|
|
service,
|
|
|
|
|
])
|
2024-09-05 16:40:47 +01:00
|
|
|
|
2024-08-13 17:30:59 +01:00
|
|
|
}
|
2024-09-05 16:40:47 +01:00
|
|
|
|
2024-08-13 17:30:59 +01:00
|
|
|
}
|
2024-09-05 16:40:47 +01:00
|
|
|
|