Files
lmxopcua/scripts/validation/grpc-data/compose.yml
T

336 lines
15 KiB
YAML

# P10 standalone owned local integration rig. Secrets and TLS files are generated in
# a run-owned restricted directory. See README.md before using this file.
name: ${GRPC_DATA_PROJECT:?run-scoped project required}
x-labels: &labels
otopcua.grpc-data.run: ${GRPC_DATA_RUN_ID:?run id required}
otopcua.grpc-data.fixture: "v1"
x-common-env: &common-env
ASPNETCORE_HOSTINGSTARTUPASSEMBLIES: GrpcDataNodeProbe
DOTNET_ADDITIONAL_DEPS: /app/GrpcDataNodeProbe.deps.json
GRPC_DATA_NODE_PROBE_DIR: /grpc-data-probe
Security__Ldap__Enabled: "false"
Security__Auth__DisableLogin: "true"
Security__Acl__Enabled: "true"
Security__ApiKeys__Pepper: ${GRPC_DATA_APIKEY_PEPPER:?generated pepper required}
Security__Jwt__SigningKey: ${GRPC_DATA_JWT_KEY:?generated JWT key required}
Security__Jwt__Issuer: grpc-data-local
Security__Jwt__Audience: grpc-data-local
Security__DeployApiKey: ${GRPC_DATA_DEPLOY_KEY:?generated deploy key required}
Secrets__SqlitePath: /data/otopcua-secrets.db
Secrets__Replication__Enabled: "true"
Secrets__Replication__AnnounceInterval: "00:00:05"
ZB_SECRETS_MASTER_KEY: ${GRPC_DATA_SECRETS_KEK:?generated KEK required}
Cluster__Port: "4053"
ConfigServe__ApiKey: ${GRPC_DATA_CONFIG_KEY:?generated config key required}
Telemetry__Mode: Grpc
Telemetry__GrpcListenPort: "4056"
Telemetry__ApiKey: ${GRPC_DATA_TELEMETRY_KEY:?generated telemetry key required}
MeshTransport__Mode: Grpc
MeshTransport__CentralGrpcEndpoints__0: http://control-1:4055
MeshTransport__CentralGrpcEndpoints__1: http://control-2:4055
LocalDb__Path: /app/data/otopcua-localdb.db
Serilog__MinimumLevel__Override__Microsoft.EntityFrameworkCore: Warning
Serilog__MinimumLevel__Override__Microsoft.AspNetCore: Warning
x-control-env: &control-env
<<: *common-env
OTOPCUA_ROLES: admin,driver,cluster-CONTROL
Cluster__Roles__0: admin
Cluster__Roles__1: driver
Cluster__Roles__2: cluster-CONTROL
ConfigSource__Mode: Direct
ConfigServe__GrpcListenPort: "4055"
ConnectionStrings__ConfigDb: "Server=sql,1433;Database=OtOpcUa;User Id=sa;Password=${GRPC_DATA_SQL_PASSWORD:?generated SQL password required};TrustServerCertificate=True;"
MeshTransport__GrpcPsk: ${GRPC_DATA_MESH_PSK_CONTROL:?generated CONTROL mesh PSK required}
MeshTransport__ClusterPsks__CONTROL: ${GRPC_DATA_MESH_PSK_CONTROL:?generated CONTROL mesh PSK required}
MeshTransport__ClusterPsks__SOURCE: ${GRPC_DATA_MESH_PSK_SOURCE:?generated SOURCE mesh PSK required}
MeshTransport__ClusterPsks__CONSUMER: ${GRPC_DATA_MESH_PSK_CONSUMER:?generated CONSUMER mesh PSK required}
TelemetryDial__Mode: Grpc
TelemetryDial__ApiKey: ${GRPC_DATA_TELEMETRY_KEY:?generated telemetry key required}
x-data-env: &data-env
<<: *common-env
ConfigSource__Mode: FetchAndCache
ConfigSource__CentralFetchEndpoints__0: http://control-1:4055
ConfigSource__CentralFetchEndpoints__1: http://control-2:4055
ConfigSource__ApiKey: ${GRPC_DATA_CONFIG_KEY:?generated config key required}
LocalDb__SyncListenPort: "9001"
LocalDb__Replication__MaxBatchSize: "16"
ASPNETCORE_HOSTINGSTARTUPASSEMBLIES: GrpcDataNodeProbe
DOTNET_ADDITIONAL_DEPS: /app/GrpcDataNodeProbe.deps.json
GRPC_DATA_NODE_PROBE_DIR: /grpc-data-probe
DataConnections__Enabled: "true"
DataConnections__ListenPort: "4057"
DataConnections__CertificatePath: /run/grpc-data/tls/server.pem
DataConnections__CertificateKeyPath: /run/grpc-data/tls/server.key
DataConnections__CredentialBundlePath: /run/grpc-data/credentials/bundle.json
DataConnections__TrustBundlePath: /run/grpc-data/credentials/trust.json
x-host: &host
image: ${GRPC_DATA_IMAGE:?run-scoped current-SHA image required}
labels: *labels
networks: [rig]
restart: unless-stopped
mem_limit: 2g
depends_on:
migrator: {condition: service_completed_successfully}
x-founder-health: &founder-health
test: ["CMD-SHELL", "bash -c '</dev/tcp/$$HOSTNAME/4053' || exit 1"]
interval: 3s
timeout: 2s
retries: 20
start_period: 8s
x-device-origin: device:5020
services:
sql:
image: mcr.microsoft.com/mssql/server:2022-latest
platform: linux/amd64
labels: *labels
networks: [rig]
environment:
ACCEPT_EULA: "Y"
MSSQL_PID: Developer
SA_PASSWORD: ${GRPC_DATA_SQL_PASSWORD:?generated SQL password required}
ports: ["127.0.0.1::1433"]
volumes: [sql-data:/var/opt/mssql]
healthcheck:
test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P \"$$SA_PASSWORD\" -No -Q 'SELECT 1' >/dev/null"]
interval: 10s
timeout: 5s
retries: 20
migrator:
build:
context: ../../..
dockerfile: scripts/validation/grpc-data/Dockerfile
target: migrator
labels:
otopcua.grpc-data.run: ${GRPC_DATA_RUN_ID}
com.docker.compose.project: ${GRPC_DATA_PROJECT}
args: {SOURCE_REVISION: "${SOURCE_REVISION:?current checkout revision required}", SOURCE_TREE_HASH: "${SOURCE_TREE_HASH:?current source content hash required}"}
image: ${GRPC_DATA_MIGRATOR_IMAGE:?run-scoped migrator image required}
labels: *labels
networks: [rig]
depends_on:
sql: {condition: service_healthy}
environment:
OTOPCUA_CONFIG_CONNECTION: "Server=sql,1433;Database=OtOpcUa;User Id=sa;Password=${GRPC_DATA_SQL_PASSWORD:?generated SQL password required};TrustServerCertificate=True;"
restart: "no"
device:
build:
context: ../../..
dockerfile: scripts/validation/grpc-data/device/Dockerfile
args: {DEVICE_TREE_HASH: "${DEVICE_TREE_HASH:?current device fixture hash required}"}
labels:
otopcua.grpc-data.run: ${GRPC_DATA_RUN_ID}
com.docker.compose.project: ${GRPC_DATA_PROJECT}
image: ${GRPC_DATA_DEVICE_IMAGE:?run-scoped device image required}
labels: *labels
networks: [rig]
ports: ["127.0.0.1::5020", "127.0.0.1::8080"]
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/state', timeout=2).read()"]
interval: 3s
timeout: 3s
retries: 20
seeder:
build:
context: ../../..
dockerfile: scripts/validation/grpc-data/Dockerfile
target: seeder
labels:
otopcua.grpc-data.run: ${GRPC_DATA_RUN_ID}
com.docker.compose.project: ${GRPC_DATA_PROJECT}
args: {SOURCE_REVISION: "${SOURCE_REVISION:?current checkout revision required}", SOURCE_TREE_HASH: "${SOURCE_TREE_HASH:?current source content hash required}"}
image: ${GRPC_DATA_SEED_IMAGE:?run-scoped seeder image required}
user: "${GRPC_DATA_UID:-0}:${GRPC_DATA_GID:-0}"
profiles: [tools]
labels: *labels
networks: [rig]
environment:
OTOPCUA_CONFIG_CONNECTION: "Server=sql,1433;Database=OtOpcUa;User Id=sa;Password=${GRPC_DATA_SQL_PASSWORD};TrustServerCertificate=True;"
GRPC_DATA_PEPPER: ${GRPC_DATA_APIKEY_PEPPER}
GRPC_DATA_OUTPUT: /output
volumes: ["${GRPC_DATA_OUTPUT_DIR:?restricted seeder directory required}:/output"]
control-1:
<<: *host
build:
context: ../../..
dockerfile: scripts/validation/grpc-data/Dockerfile
target: runtime
labels:
otopcua.grpc-data.run: ${GRPC_DATA_RUN_ID}
com.docker.compose.project: ${GRPC_DATA_PROJECT}
args: {SOURCE_REVISION: "${SOURCE_REVISION:?current checkout revision required}", SOURCE_TREE_HASH: "${SOURCE_TREE_HASH:?current source content hash required}"}
environment:
<<: *control-env
Cluster__Hostname: control-1
Cluster__PublicHostname: control-1
Cluster__SeedNodes__0: akka.tcp://otopcua@control-1:4053
Cluster__SeedNodes__1: akka.tcp://otopcua@control-2:4053
OpcUa__ApplicationUri: urn:OtOpcUa:grpc-data:control-1
OpcUa__PeerApplicationUris__0: urn:OtOpcUa:grpc-data:control-2
ASPNETCORE_URLS: http://control-1:9000
healthcheck: *founder-health
ports: ["127.0.0.1::4840", "127.0.0.1::9000"]
volumes: [control-1-data:/app/data, control-1-data:/data, "${GRPC_DATA_PROBE_DIR:?restricted probe directory required}/control-1:/grpc-data-probe"]
control-2:
<<: *host
depends_on:
migrator: {condition: service_completed_successfully}
control-1: {condition: service_healthy}
environment:
<<: *control-env
Cluster__Hostname: control-2
Cluster__PublicHostname: control-2
Cluster__SeedNodes__0: akka.tcp://otopcua@control-2:4053
Cluster__SeedNodes__1: akka.tcp://otopcua@control-1:4053
OpcUa__ApplicationUri: urn:OtOpcUa:grpc-data:control-2
OpcUa__PeerApplicationUris__0: urn:OtOpcUa:grpc-data:control-1
ASPNETCORE_URLS: http://control-2:9000
ports: ["127.0.0.1::4840", "127.0.0.1::9000"]
volumes: [control-2-data:/app/data, control-2-data:/data, "${GRPC_DATA_PROBE_DIR:?restricted probe directory required}/control-2:/grpc-data-probe"]
source-1:
<<: *host
depends_on:
migrator: {condition: service_completed_successfully}
control-1: {condition: service_healthy}
device: {condition: service_healthy}
environment:
<<: *data-env
OTOPCUA_ROLES: driver,cluster-SOURCE
Cluster__Roles__0: driver
Cluster__Roles__1: cluster-SOURCE
Cluster__Hostname: source-1
# Rig-only dev literal (A2/A3 condition_key, plan §5.2): >= 32 bytes, identical on both source pair members.
DataConnections__ConditionKeySecret: "grpc-data-rig-dev-condition-key-secret-0001"
DataConnections__AllowedHosts__0: source-1
Cluster__PublicHostname: source-1
Cluster__SeedNodes__0: akka.tcp://otopcua@source-1:4053
Cluster__SeedNodes__1: akka.tcp://otopcua@source-2:4053
OpcUa__ApplicationUri: urn:OtOpcUa:grpc-data:source-1
OpcUa__PeerApplicationUris__0: urn:OtOpcUa:grpc-data:source-2
ASPNETCORE_URLS: http://source-1:9000
MeshTransport__GrpcPsk: ${GRPC_DATA_MESH_PSK_SOURCE:?generated SOURCE mesh PSK required}
LocalDb__Replication__PeerAddress: http://source-2:9001
LocalDb__Replication__ApiKey: ${GRPC_DATA_SYNC_KEY_SOURCE:?generated SOURCE sync key required}
healthcheck: *founder-health
ports: ["127.0.0.1::4840", "127.0.0.1::9000", "127.0.0.1::4057"]
volumes:
- ${GRPC_DATA_PROBE_DIR:?restricted probe directory required}/source-1:/grpc-data-probe
- source-1-data:/app/data
- source-1-data:/data
- ${GRPC_DATA_CERT_DIR:?restricted generated certificate directory required}/source-1:/run/grpc-data/tls:ro
- ${GRPC_DATA_CREDENTIAL_DIR:?restricted generated credential directory required}/source-1:/run/grpc-data/credentials:ro
source-2:
<<: *host
depends_on:
migrator: {condition: service_completed_successfully}
source-1: {condition: service_healthy}
environment:
<<: *data-env
OTOPCUA_ROLES: driver,cluster-SOURCE
Cluster__Roles__0: driver
Cluster__Roles__1: cluster-SOURCE
Cluster__Hostname: source-2
# Rig-only dev literal (A2/A3 condition_key, plan §5.2): >= 32 bytes, identical on both source pair members.
DataConnections__ConditionKeySecret: "grpc-data-rig-dev-condition-key-secret-0001"
DataConnections__AllowedHosts__0: source-2
Cluster__PublicHostname: source-2
Cluster__SeedNodes__0: akka.tcp://otopcua@source-2:4053
Cluster__SeedNodes__1: akka.tcp://otopcua@source-1:4053
OpcUa__ApplicationUri: urn:OtOpcUa:grpc-data:source-2
OpcUa__PeerApplicationUris__0: urn:OtOpcUa:grpc-data:source-1
ASPNETCORE_URLS: http://source-2:9000
MeshTransport__GrpcPsk: ${GRPC_DATA_MESH_PSK_SOURCE:?generated SOURCE mesh PSK required}
LocalDb__Replication__ApiKey: ${GRPC_DATA_SYNC_KEY_SOURCE:?generated SOURCE sync key required}
ports: ["127.0.0.1::4840", "127.0.0.1::9000", "127.0.0.1::4057"]
volumes:
- ${GRPC_DATA_PROBE_DIR:?restricted probe directory required}/source-2:/grpc-data-probe
- source-2-data:/app/data
- source-2-data:/data
- ${GRPC_DATA_CERT_DIR:?restricted generated certificate directory required}/source-2:/run/grpc-data/tls:ro
- ${GRPC_DATA_CREDENTIAL_DIR:?restricted generated credential directory required}/source-2:/run/grpc-data/credentials:ro
consumer-1:
<<: *host
depends_on:
migrator: {condition: service_completed_successfully}
control-1: {condition: service_healthy}
environment:
<<: *data-env
OTOPCUA_ROLES: driver,cluster-CONSUMER
Cluster__Roles__0: driver
Cluster__Roles__1: cluster-CONSUMER
Cluster__Hostname: consumer-1
DataConnections__AllowedHosts__0: consumer-1
Cluster__PublicHostname: consumer-1
Cluster__SeedNodes__0: akka.tcp://otopcua@consumer-1:4053
Cluster__SeedNodes__1: akka.tcp://otopcua@consumer-2:4053
OpcUa__ApplicationUri: urn:OtOpcUa:grpc-data:consumer-1
OpcUa__PeerApplicationUris__0: urn:OtOpcUa:grpc-data:consumer-2
ASPNETCORE_URLS: http://consumer-1:9000
MeshTransport__GrpcPsk: ${GRPC_DATA_MESH_PSK_CONSUMER:?generated CONSUMER mesh PSK required}
LocalDb__Replication__PeerAddress: http://consumer-2:9001
LocalDb__Replication__ApiKey: ${GRPC_DATA_SYNC_KEY_CONSUMER:?generated CONSUMER sync key required}
healthcheck: *founder-health
ports: ["127.0.0.1::4840", "127.0.0.1::9000", "127.0.0.1::4057"]
volumes:
- ${GRPC_DATA_PROBE_DIR:?restricted probe directory required}/consumer-1:/grpc-data-probe
- consumer-1-data:/app/data
- consumer-1-data:/data
- ${GRPC_DATA_CERT_DIR:?restricted generated certificate directory required}/consumer-1:/run/grpc-data/tls:ro
- ${GRPC_DATA_CREDENTIAL_DIR:?restricted generated credential directory required}/consumer-1:/run/grpc-data/credentials:ro
consumer-2:
<<: *host
depends_on:
migrator: {condition: service_completed_successfully}
consumer-1: {condition: service_healthy}
environment:
<<: *data-env
OTOPCUA_ROLES: driver,cluster-CONSUMER
Cluster__Roles__0: driver
Cluster__Roles__1: cluster-CONSUMER
Cluster__Hostname: consumer-2
DataConnections__AllowedHosts__0: consumer-2
Cluster__PublicHostname: consumer-2
Cluster__SeedNodes__0: akka.tcp://otopcua@consumer-2:4053
Cluster__SeedNodes__1: akka.tcp://otopcua@consumer-1:4053
OpcUa__ApplicationUri: urn:OtOpcUa:grpc-data:consumer-2
OpcUa__PeerApplicationUris__0: urn:OtOpcUa:grpc-data:consumer-1
ASPNETCORE_URLS: http://consumer-2:9000
MeshTransport__GrpcPsk: ${GRPC_DATA_MESH_PSK_CONSUMER:?generated CONSUMER mesh PSK required}
LocalDb__Replication__ApiKey: ${GRPC_DATA_SYNC_KEY_CONSUMER:?generated CONSUMER sync key required}
ports: ["127.0.0.1::4840", "127.0.0.1::9000", "127.0.0.1::4057"]
volumes:
- ${GRPC_DATA_PROBE_DIR:?restricted probe directory required}/consumer-2:/grpc-data-probe
- consumer-2-data:/app/data
- consumer-2-data:/data
- ${GRPC_DATA_CERT_DIR:?restricted generated certificate directory required}/consumer-2:/run/grpc-data/tls:ro
- ${GRPC_DATA_CREDENTIAL_DIR:?restricted generated credential directory required}/consumer-2:/run/grpc-data/credentials:ro
networks:
rig:
labels: *labels
volumes:
sql-data: {labels: *labels}
control-1-data: {labels: *labels}
control-2-data: {labels: *labels}
source-1-data: {labels: *labels}
source-2-data: {labels: *labels}
consumer-1-data: {labels: *labels}
consumer-2-data: {labels: *labels}