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.
159 lines
3.7 KiB
JSON
159 lines
3.7 KiB
JSON
{
|
|
"module": "influxdb",
|
|
"version": "1",
|
|
"provides": [
|
|
{
|
|
"name": "influxdb-api",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"own-secrets": {
|
|
"broker": "${dir:mesh-state}/broker",
|
|
"admin": "${dir:state}/admin.secret",
|
|
"admin-token": "${dir:state}/admin-token.secret"
|
|
},
|
|
"listens": [
|
|
{
|
|
"name": "api",
|
|
"port": 8086,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "queries, writes and the web UI, over http; consumers granted influxdb-api sign in with the mesh's credential, and a name is a route grant"
|
|
}
|
|
],
|
|
"serves": {
|
|
"influxdb-api": {
|
|
"scheme": "http",
|
|
"port": 8086,
|
|
"org": "mesh",
|
|
"bucket": "default"
|
|
}
|
|
},
|
|
"receives": {
|
|
"influxdb-api": "${dir:grants}/mesh.json"
|
|
},
|
|
"grants": {
|
|
"influxdb-api": "${dir:grants}"
|
|
},
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "mesh"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "."
|
|
},
|
|
{
|
|
"id": "data",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "1000:1000"
|
|
},
|
|
{
|
|
"id": "config",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "1000:1000"
|
|
},
|
|
{
|
|
"id": "grants",
|
|
"type": "directory",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "server-env",
|
|
"type": "file",
|
|
"path": "${dir:state}/server.env",
|
|
"mode": "0600",
|
|
"content": "DOCKER_INFLUXDB_INIT_MODE=setup\nDOCKER_INFLUXDB_INIT_USERNAME=admin\nDOCKER_INFLUXDB_INIT_PASSWORD_FILE=/run/secrets/admin\nDOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE=/run/secrets/admin-token\nDOCKER_INFLUXDB_INIT_ORG=mesh\nDOCKER_INFLUXDB_INIT_BUCKET=default\n"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "influxdb",
|
|
"image": "influxdb@sha256:f75e48af0598e8aec7986e991a848d19a119101a7d563a2e5db1dfaac9c45daa",
|
|
"env-file": [
|
|
"${dir:state}/server.env"
|
|
],
|
|
"ports": [
|
|
"8086"
|
|
],
|
|
"volumes": [
|
|
"${dir:data}:/var/lib/influxdb2",
|
|
"${dir:config}:/etc/influxdb2",
|
|
"${dir:state}/admin.secret:/run/secrets/admin:ro",
|
|
"${dir:state}/admin-token.secret:/run/secrets/admin-token:ro"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime-config",
|
|
"type": "file",
|
|
"path": "${dir:mesh-state}/config.json",
|
|
"mode": "0600",
|
|
"content": "{}\n",
|
|
"merge": "json"
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-influxdb",
|
|
"network": "host",
|
|
"volumes": [
|
|
"${dir:mesh-state}/broker:/run/secrets/broker:ro",
|
|
"${dir:mesh-state}/config.json:/run/config/config.json:ro",
|
|
"${dir:state}/admin-token.secret:/run/secrets/admin-token:ro",
|
|
"${dir:grants}:${dir:grants}:ro"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_INFLUXDB_URL": "http://127.0.0.1:${port:8086}",
|
|
"MESH_INFLUXDB_CONFIG_FILE": "/run/config/config.json",
|
|
"MESH_INFLUXDB_TOKEN_FILE": "/run/secrets/admin-token",
|
|
"MESH_RECEIVES": "${dir:grants}/mesh.json"
|
|
},
|
|
"restart-on": [
|
|
"runtime-config"
|
|
],
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"requires": [
|
|
"route"
|
|
],
|
|
"contributes": {
|
|
"route": {
|
|
"label": "influxdb",
|
|
"endpoint": "api"
|
|
}
|
|
},
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
}
|