test: validate grpc data connections with local docker and opcua cli

This commit is contained in:
Joseph Doherty
2026-11-17 22:01:26 -05:00
parent 1df29a3124
commit 29fec57fac
194 changed files with 23327 additions and 740 deletions
+60 -8
View File
@@ -1,4 +1,4 @@
# P10 standalone infrastructure scaffold. Secrets and TLS files are generated in
# 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}
@@ -7,6 +7,9 @@ x-labels: &labels
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"
@@ -30,8 +33,6 @@ x-common-env: &common-env
LocalDb__Path: /app/data/otopcua-localdb.db
Serilog__MinimumLevel__Override__Microsoft.EntityFrameworkCore: Warning
Serilog__MinimumLevel__Override__Microsoft.AspNetCore: Warning
# P07_TLS_BINDING_PENDING: match the actual P07 listener/client option names
# before enabling data gRPC. Certificate mounts are already isolated below.
x-control-env: &control-env
<<: *common-env
@@ -57,6 +58,15 @@ x-data-env: &data-env
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}
@@ -68,7 +78,7 @@ x-host: &host
migrator: {condition: service_completed_successfully}
x-founder-health: &founder-health
test: ["CMD-SHELL", "bash -c '</dev/tcp/localhost/4053' || exit 1"]
test: ["CMD-SHELL", "bash -c '</dev/tcp/$$HOSTNAME/4053' || exit 1"]
interval: 3s
timeout: 2s
retries: 20
@@ -99,7 +109,10 @@ services:
context: ../../..
dockerfile: scripts/validation/grpc-data/Dockerfile
target: migrator
args: {SOURCE_REVISION: "${SOURCE_REVISION:?current checkout revision required}"}
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]
@@ -113,6 +126,10 @@ services:
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]
@@ -123,13 +140,36 @@ services:
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
args: {SOURCE_REVISION: "${SOURCE_REVISION:?current checkout revision required}"}
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
@@ -141,7 +181,7 @@ services:
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]
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
@@ -158,7 +198,7 @@ services:
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]
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
@@ -172,6 +212,7 @@ services:
Cluster__Roles__0: driver
Cluster__Roles__1: cluster-SOURCE
Cluster__Hostname: source-1
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
@@ -184,9 +225,11 @@ services:
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
@@ -199,6 +242,7 @@ services:
Cluster__Roles__0: driver
Cluster__Roles__1: cluster-SOURCE
Cluster__Hostname: source-2
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
@@ -209,9 +253,11 @@ services:
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
@@ -224,6 +270,7 @@ services:
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
@@ -236,9 +283,11 @@ services:
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
@@ -251,6 +300,7 @@ services:
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
@@ -261,9 +311,11 @@ services:
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: