diff --git a/docker-dev/seed/seed-clusters.sql b/docker-dev/seed/seed-clusters.sql index a4ce9d7e..0e12f0a8 100644 --- a/docker-dev/seed/seed-clusters.sql +++ b/docker-dev/seed/seed-clusters.sql @@ -101,97 +101,22 @@ IF NOT EXISTS (SELECT 1 FROM dbo.ClusterNode WHERE NodeId = 'site-b-2:4053') VALUES ('site-b-2:4053', 'SITE-B', 'site-b-2', 4840, 8081, 'urn:OtOpcUa:site-b-2', 150, 1, 'docker-dev-seed'); ------------------------------------------------------------------------------ --- Galaxy MxAccess gateway — MAIN cluster +-- Galaxy MxAccess gateway — INTENTIONALLY NOT SEEDED (retired 2026-06-15) -- --- Namespace.Kind=SystemPlatform is required for Galaxy/MXAccess data per --- decision #107; raw equipment drivers use Equipment. DriverInstance points --- at the external mxaccessgw process. The driver code lives in this repo --- (.NET 10, cross-platform); only the gateway worker needs Windows. +-- This block used to seed a Namespace with Kind='SystemPlatform' + a +-- 'GalaxyMxGateway' DriverInstance + 3 mirror tags. That is now BROKEN: the +-- 'SystemPlatform' NamespaceKind member was removed when Galaxy became a +-- standard Equipment-kind driver (migration 20260613022355 +-- CleanupSystemPlatformNamespaces). cluster-seed runs AFTER the migrator, so +-- re-inserting a 'SystemPlatform' row re-introduced a Kind the current code +-- cannot EF-materialize — which 500s the /deployments page AND fails every +-- publish (ConfigComposer reads db.Namespaces). See the cleanup migration. -- --- ApiKeySecretRef = env:GALAXY_MXGW_API_KEY → resolved at runtime by --- GalaxyDriver.ResolveApiKey. The env var is set on every driver-role --- container in docker-compose.yml. +-- If a Galaxy fixture is needed on a fresh rig, author an EQUIPMENT-kind Galaxy +-- driver via the UNS UI (the 'MAIN-galaxy-eq' pattern) — do NOT re-add a +-- SystemPlatform namespace here. ------------------------------------------------------------------------------ -IF NOT EXISTS (SELECT 1 FROM dbo.Namespace WHERE NamespaceId = 'MAIN-galaxy') - INSERT INTO dbo.Namespace - (NamespaceRowId, NamespaceId, ClusterId, Kind, NamespaceUri, Enabled, Notes) - VALUES - (NEWID(), 'MAIN-galaxy', 'MAIN', 'SystemPlatform', - 'urn:zb:docker-dev:galaxy', 1, - 'docker-dev seed — Galaxy / MXAccess namespace served by the MAIN cluster.'); - -IF NOT EXISTS (SELECT 1 FROM dbo.DriverInstance WHERE DriverInstanceId = 'MAIN-galaxy-mxgw') - INSERT INTO dbo.DriverInstance - (DriverInstanceRowId, DriverInstanceId, ClusterId, NamespaceId, Name, DriverType, Enabled, DriverConfig) - VALUES - (NEWID(), 'MAIN-galaxy-mxgw', 'MAIN', 'MAIN-galaxy', - 'MxAccess gateway (10.100.0.48:5120)', 'GalaxyMxGateway', 1, - N'{ - "Gateway": { - "Endpoint": "http://10.100.0.48:5120", - "ApiKeySecretRef": "env:GALAXY_MXGW_API_KEY", - "UseTls": false, - "ConnectTimeoutSeconds": 10, - "DefaultCallTimeoutSeconds": 30 - }, - "MxAccess": { - "ClientName": "OtOpcUa-MAIN-docker-dev", - "PublishingIntervalMs": 1000 - }, - "Repository": { - "DiscoverPageSize": 5000, - "WatchDeployEvents": true - }, - "Reconnect": { - "InitialBackoffMs": 500, - "MaxBackoffMs": 30000, - "ReplayOnSessionLost": true - } -}'); - ------------------------------------------------------------------------------- --- Galaxy test tags — TestMachine_001.TestAlarm001..003 --- --- SystemPlatform-namespace tags have EquipmentId=NULL and use FolderPath + --- Name to address the MXAccess item. The Galaxy driver subscribes via the --- "FolderPath.Name" MXAccess reference form; OPC UA browse path is the --- equivalent "FolderPath/Name" under the SystemPlatform namespace. --- --- Idempotency: each insert is guarded on the UX_Tag_FolderPath key --- (DriverInstanceId, FolderPath, Name WHERE EquipmentId IS NULL), NOT TagId. --- The Galaxy driver auto-materialises these same folder-path tags at runtime --- under its own generated TagIds, so a TagId-only guard would pass on a re-run --- and then collide on UX_Tag_FolderPath, making cluster-seed exit 1. ------------------------------------------------------------------------------- - -IF NOT EXISTS (SELECT 1 FROM dbo.Tag - WHERE DriverInstanceId = 'MAIN-galaxy-mxgw' AND FolderPath = 'TestMachine_001' - AND Name = 'TestAlarm001' AND EquipmentId IS NULL) - INSERT INTO dbo.Tag - (TagRowId, TagId, DriverInstanceId, DeviceId, EquipmentId, Name, FolderPath, DataType, AccessLevel, WriteIdempotent, PollGroupId, TagConfig) - VALUES - (NEWID(), 'MAIN-galaxy-TestMachine_001-TestAlarm001', 'MAIN-galaxy-mxgw', NULL, NULL, - 'TestAlarm001', 'TestMachine_001', 'Boolean', 0, 0, NULL, N'{}'); - -IF NOT EXISTS (SELECT 1 FROM dbo.Tag - WHERE DriverInstanceId = 'MAIN-galaxy-mxgw' AND FolderPath = 'TestMachine_001' - AND Name = 'TestAlarm002' AND EquipmentId IS NULL) - INSERT INTO dbo.Tag - (TagRowId, TagId, DriverInstanceId, DeviceId, EquipmentId, Name, FolderPath, DataType, AccessLevel, WriteIdempotent, PollGroupId, TagConfig) - VALUES - (NEWID(), 'MAIN-galaxy-TestMachine_001-TestAlarm002', 'MAIN-galaxy-mxgw', NULL, NULL, - 'TestAlarm002', 'TestMachine_001', 'Boolean', 0, 0, NULL, N'{}'); - -IF NOT EXISTS (SELECT 1 FROM dbo.Tag - WHERE DriverInstanceId = 'MAIN-galaxy-mxgw' AND FolderPath = 'TestMachine_001' - AND Name = 'TestAlarm003' AND EquipmentId IS NULL) - INSERT INTO dbo.Tag - (TagRowId, TagId, DriverInstanceId, DeviceId, EquipmentId, Name, FolderPath, DataType, AccessLevel, WriteIdempotent, PollGroupId, TagConfig) - VALUES - (NEWID(), 'MAIN-galaxy-TestMachine_001-TestAlarm003', 'MAIN-galaxy-mxgw', NULL, NULL, - 'TestAlarm003', 'TestMachine_001', 'Boolean', 0, 0, NULL, N'{}'); - COMMIT TRANSACTION; ------------------------------------------------------------------------------