48 definitions stop naming /var/lib/mesh/<module>: the directory says `place: "mesh"`, the two
subdirectories beneath it (gitea's runtime state, anthropic-manager's output) state their path
beneath it, and every credential, binding, merged file and mount names it as ${dir:mesh-state}.
Resolved on the default root, every definition names exactly the paths it named before —
TestPlacedDirectoriesKeepTheirPaths in mesh-controller, run over both checkouts. Needs the
controller that knows the word (mesh-controller, same branch) one release ahead.
148 lines
3.0 KiB
JSON
148 lines
3.0 KiB
JSON
{
|
|
"module": "redis",
|
|
"version": "1",
|
|
"provides": [
|
|
{
|
|
"name": "redis-cache",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"requires": [
|
|
"secret"
|
|
],
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"cache.provisioned",
|
|
"cache.deprovisioned"
|
|
],
|
|
"consumes": [
|
|
"redis.cache.provisioned",
|
|
"redis.cache.deprovisioned"
|
|
],
|
|
"serves": {
|
|
"redis-cache": {
|
|
"port": 6379
|
|
}
|
|
},
|
|
"receives": {
|
|
"redis-cache": "${dir:grants}/mesh.json"
|
|
},
|
|
"grants": {
|
|
"redis-cache": "${dir:grants}"
|
|
},
|
|
"secrets": {
|
|
"secret": "${dir:state}/default.secret"
|
|
},
|
|
"own-secrets": {
|
|
"broker": "${dir:mesh-state}/broker"
|
|
},
|
|
"listens": [
|
|
{
|
|
"name": "cache",
|
|
"port": 6379,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "modules on any machine that were granted a cache"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "mesh"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "."
|
|
},
|
|
{
|
|
"id": "grants",
|
|
"type": "directory",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "data",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "999:1000"
|
|
},
|
|
{
|
|
"id": "server-conf",
|
|
"type": "file",
|
|
"path": "${dir:state}/redis.conf",
|
|
"mode": "0600",
|
|
"content": "requirepass ${secret:secret}\nappendonly yes\ndir /data\n",
|
|
"owner": "999:1000"
|
|
},
|
|
{
|
|
"id": "net",
|
|
"type": "network",
|
|
"name": "redis"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "redis",
|
|
"image": "redis@sha256:520775a41a63e77e06c73e35d2fd9cc15921a609516818796b4ecbb813078bc7",
|
|
"network": "redis",
|
|
"ports": [
|
|
"6379"
|
|
],
|
|
"volumes": [
|
|
"${dir:data}:/data",
|
|
"${dir:state}/redis.conf:/etc/redis/redis.conf:ro"
|
|
],
|
|
"args": [
|
|
"/etc/redis/redis.conf"
|
|
],
|
|
"restart-on": [
|
|
"server-conf"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-redis",
|
|
"network": "redis",
|
|
"volumes": [
|
|
"${dir:mesh-state}/broker:/run/secrets/broker:ro",
|
|
"${dir:grants}:/var/lib/redis-module/grants:ro",
|
|
"${dir:state}/default.secret:/run/secrets/default:ro"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_RECEIVES": "/var/lib/redis-module/grants/mesh.json",
|
|
"MESH_PROVISION_REDIS": "redis:6379",
|
|
"MESH_PROVISION_PASSWORD_FILE": "/run/secrets/default"
|
|
},
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"build": {
|
|
"on": [
|
|
{
|
|
"arg": "BUILD_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "build"
|
|
},
|
|
{
|
|
"arg": "RUNTIME_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"artifacts": [
|
|
{
|
|
"name": "runtime",
|
|
"kind": "image",
|
|
"from": "Dockerfile"
|
|
}
|
|
]
|
|
}
|
|
}
|