diff --git a/.env b/.env index c8120a270..728df0ad1 100644 --- a/.env +++ b/.env @@ -46,4 +46,11 @@ SPARKD__SIM_FIX_PORT=8002 SPARKD__SHM_SIZE=4gb SPARKD__PYTHON_REQUIREMENTS=requirements.txt +### PubSubServer ### +PUBSUB__CONFIG_DIR=src/DataStreamSuite/PubSubServer/Configurations/Development +PUBSUB__SOURCE_DIR=build/Release/bin/net8.0/linux-x64/publish + +### MdPublisher ### +MD_PUBLISHER__CONFIG_DIR=src/DataStreamSuite/DataStreamPublisher/Configurations/ReplayMarketData +MD_PUBLISHER__SOURCE_DIR=build/Release/bin/net8.0/linux-x64/publish # TODO: add config for other services (pubsub, md-publisher, webapp, api-server, etc.) diff --git a/.vscode/launch.json b/.vscode/launch.json index 45f1d81ae..6e286d27a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -26,11 +26,10 @@ "windows": { "program": "DataStreamPublisher.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/DataStreamPublisher/Configurations/${input:dataStreamPublisherConfig}.json" - ], "cwd": "build/Debug/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}", + }, "stopAtEntry": false, "console": "integratedTerminal" }, @@ -45,11 +44,10 @@ "windows": { "program": "DataStreamPublisher.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/DataStreamPublisher/Configurations/${input:dataStreamPublisherConfig}.json" - ], "cwd": "${workspaceFolder}/build/Debug/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}", + }, "stopAtEntry": false, "console": "integratedTerminal" }, @@ -282,6 +280,16 @@ ], "default": "MarketDataPublisher", }, + { + "id": "dataStreamPublisherEnvironment", + "type": "pickString", + "description": "DataStreamPublisher Configuration", + "options": [ + "Local", + "ReplayMarketData", + ], + "default": "Local", + }, { "id": "pubSubServerConfig", "type": "pickString", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 23f56f6f4..8e9de2a28 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -422,12 +422,11 @@ "windows": { "command": "DataStreamPublisher.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/DataStreamPublisher/Configurations/${input:dataStreamPublisherConfig}.json", - ], "options": { - "cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0" + "cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}", + }, }, "icon": { "id": "run", @@ -445,12 +444,11 @@ "windows": { "command": "DataStreamPublisher.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/DataStreamPublisher/Configurations/${input:dataStreamPublisherConfig}.json", - ], "options": { - "cwd": "${workspaceFolder}/build/Debug/bin/net8.0" + "cwd": "${workspaceFolder}/build/Debug/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}", + }, }, "icon": { "id": "run", @@ -468,12 +466,11 @@ "windows": { "command": "DataStreamPublisher.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/DataStreamPublisher/Configurations/${input:dataStreamPublisherConfig}.json", - ], "options": { - "cwd": "${workspaceFolder}/build/Release/bin/net8.0" + "cwd": "${workspaceFolder}/build/Release/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}", + }, }, "icon": { "id": "run", @@ -491,12 +488,11 @@ "windows": { "command": "PubSubServer.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json", - ], "options": { - "cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0" + "cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}", + }, }, "icon": { "id": "run", @@ -514,12 +510,11 @@ "windows": { "command": "PubSubServer.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json", - ], "options": { - "cwd": "${workspaceFolder}/build/Debug/bin/net8.0" + "cwd": "${workspaceFolder}/build/Debug/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}", + }, }, "icon": { "id": "run", @@ -536,12 +531,11 @@ "windows": { "command": "PubSubServer.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json", - ], "options": { - "cwd": "${workspaceFolder}/build/Debug/bin/net8.0" + "cwd": "${workspaceFolder}/build/Debug/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}", + }, }, "icon": { "id": "run", @@ -559,12 +553,11 @@ "windows": { "command": "PubSubServer.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json", - ], "options": { - "cwd": "${workspaceFolder}/build/Release/bin/net8.0" + "cwd": "${workspaceFolder}/build/Release/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}", + }, }, "icon": { "id": "run", @@ -581,12 +574,11 @@ "windows": { "command": "PubSubServer.exe", }, - "args": [ - "--config", - "${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json", - ], "options": { - "cwd": "${workspaceFolder}/build/Release/bin/net8.0" + "cwd": "${workspaceFolder}/build/Release/bin/net8.0", + "env": { + "DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}", + }, }, "icon": { "id": "run", @@ -885,26 +877,30 @@ "default": "sparkd-debug-clang", }, { - "id": "dataStreamPublisherConfig", + "id": "dataStreamPublisherEnvironment", "type": "pickString", "description": "Publisher Configuration", "options": [ - "MarketDataPublisher", - "SimpleEchoClient", - "SimpleTestDataPublisher", - "TestDataPublisher", + "Development", + "MarketData", + "Production", + "ProductionAws", + "Staging", ], "default": "MarketDataPublisher", }, { - "id": "pubSubServerConfig", + "id": "pubSubServerEnvironment", "type": "pickString", "description": "PubSub Configuration", "options": [ - "PubSubServer", - "SimpleEchoClient", + "Development", + "EchoServer", + "Production", + "ProductionAws", + "Staging", ], - "default": "PubSubServer", + "default": "Development", }, { "id": "sparkConfigQuery", diff --git a/Spark.Api.Server.sln b/Spark.Api.Server.sln index dda751756..6a4d59cb0 100644 --- a/Spark.Api.Server.sln +++ b/Spark.Api.Server.sln @@ -1,4 +1,5 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32922.545 MinimumVisualStudioVersion = 15.0.26124.0 @@ -42,168 +43,484 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.ColumnExpressions", "sr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStream", "src\DataStreamSuite\DataStream\DataStream.csproj", "{39AEA075-6457-46C0-8821-1158BE6EFA57}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Extensions.Hosting", "src\DataStreamSuite\Bts.Extensions.Hosting\Bts.Extensions.Hosting.csproj", "{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 MinSizeRel|x64 = MinSizeRel|x64 + MinSizeRel|Any CPU = MinSizeRel|Any CPU + MinSizeRel|x86 = MinSizeRel|x86 Release|x64 = Release|x64 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 RelWithDebInfo|x64 = RelWithDebInfo|x64 + RelWithDebInfo|Any CPU = RelWithDebInfo|Any CPU + RelWithDebInfo|x86 = RelWithDebInfo|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x64.ActiveCfg = Debug|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x64.Build.0 = Debug|x64 + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x86.ActiveCfg = Debug|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x86.Build.0 = Debug|Any CPU {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x64.ActiveCfg = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x64.Build.0 = Release|x64 + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x64.ActiveCfg = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x64.Build.0 = Release|x64 + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|Any CPU.Build.0 = Release|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x86.ActiveCfg = Release|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x86.Build.0 = Release|Any CPU {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.Build.0 = Release|x64 + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x64.ActiveCfg = Debug|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x64.Build.0 = Debug|x64 + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x86.ActiveCfg = Debug|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x86.Build.0 = Debug|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x64.ActiveCfg = Release|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x64.Build.0 = Release|x64 + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x64.ActiveCfg = Release|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x64.Build.0 = Release|x64 + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|Any CPU.Build.0 = Release|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x86.ActiveCfg = Release|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x86.Build.0 = Release|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x64.Build.0 = Release|x64 + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.ActiveCfg = Debug|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.Build.0 = Debug|x64 + {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x86.ActiveCfg = Debug|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x86.Build.0 = Debug|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.ActiveCfg = Debug|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.Build.0 = Debug|x64 + {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.ActiveCfg = Release|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.Build.0 = Release|x64 + {3201359D-C071-4089-9EDE-B04D759F1508}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.Release|Any CPU.Build.0 = Release|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.Release|x86.ActiveCfg = Release|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.Release|x86.Build.0 = Release|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.Build.0 = Release|x64 + {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.ActiveCfg = Debug|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.Build.0 = Debug|x64 + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x86.ActiveCfg = Debug|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x86.Build.0 = Debug|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.ActiveCfg = Debug|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.Build.0 = Debug|x64 + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.ActiveCfg = Release|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.Build.0 = Release|x64 + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|Any CPU.Build.0 = Release|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x86.ActiveCfg = Release|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x86.Build.0 = Release|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.Build.0 = Release|x64 + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x64.ActiveCfg = Debug|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x64.Build.0 = Debug|x64 + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x86.ActiveCfg = Debug|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x86.Build.0 = Debug|Any CPU {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x64.ActiveCfg = Debug|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x64.Build.0 = Debug|x64 + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x64.ActiveCfg = Release|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x64.Build.0 = Release|x64 + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|Any CPU.Build.0 = Release|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x86.ActiveCfg = Release|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x86.Build.0 = Release|Any CPU {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x64.ActiveCfg = Debug|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x64.Build.0 = Debug|x64 + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x64.ActiveCfg = Debug|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x64.Build.0 = Debug|x64 + {89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x86.ActiveCfg = Debug|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x86.Build.0 = Debug|Any CPU {89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x64.ActiveCfg = Debug|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x64.Build.0 = Debug|x64 + {89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x64.ActiveCfg = Release|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x64.Build.0 = Release|x64 + {89D666E6-B500-498F-B026-4D167F68ADFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.Release|Any CPU.Build.0 = Release|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x86.ActiveCfg = Release|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x86.Build.0 = Release|Any CPU {89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x64.ActiveCfg = Debug|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x64.Build.0 = Debug|x64 + {89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x64.ActiveCfg = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x64.Build.0 = Debug|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x86.ActiveCfg = Debug|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x86.Build.0 = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x64.ActiveCfg = Release|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x64.Build.0 = Release|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|Any CPU.Build.0 = Release|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x86.ActiveCfg = Release|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x86.Build.0 = Release|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x64.ActiveCfg = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x64.Build.0 = Debug|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x86.ActiveCfg = Debug|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x86.Build.0 = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x64.ActiveCfg = Release|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x64.Build.0 = Release|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|Any CPU.Build.0 = Release|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x86.ActiveCfg = Release|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x86.Build.0 = Release|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {14140310-2233-430A-821B-F3058A25234B}.Debug|x64.ActiveCfg = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.Debug|x64.Build.0 = Debug|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.Debug|x86.ActiveCfg = Debug|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.Debug|x86.Build.0 = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {14140310-2233-430A-821B-F3058A25234B}.Release|x64.ActiveCfg = Release|Any CPU {14140310-2233-430A-821B-F3058A25234B}.Release|x64.Build.0 = Release|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.Release|Any CPU.Build.0 = Release|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.Release|x86.ActiveCfg = Release|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.Release|x86.Build.0 = Release|Any CPU {14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x64.ActiveCfg = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x64.Build.0 = Debug|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x86.ActiveCfg = Debug|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x86.Build.0 = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x64.ActiveCfg = Release|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x64.Build.0 = Release|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|Any CPU.Build.0 = Release|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x86.ActiveCfg = Release|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x86.Build.0 = Release|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x64.ActiveCfg = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x64.Build.0 = Debug|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x86.ActiveCfg = Debug|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x86.Build.0 = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x64.ActiveCfg = Release|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x64.Build.0 = Release|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|Any CPU.Build.0 = Release|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x86.ActiveCfg = Release|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x86.Build.0 = Release|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x64.ActiveCfg = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x64.Build.0 = Debug|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x86.ActiveCfg = Debug|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x86.Build.0 = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x64.ActiveCfg = Release|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x64.Build.0 = Release|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|Any CPU.Build.0 = Release|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x86.ActiveCfg = Release|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x86.Build.0 = Release|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x64.ActiveCfg = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x64.Build.0 = Debug|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x86.ActiveCfg = Debug|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x86.Build.0 = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x64.ActiveCfg = Release|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x64.Build.0 = Release|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|Any CPU.Build.0 = Release|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x86.ActiveCfg = Release|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x86.Build.0 = Release|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x64.ActiveCfg = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x64.Build.0 = Debug|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x86.ActiveCfg = Debug|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x86.Build.0 = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x64.ActiveCfg = Release|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x64.Build.0 = Release|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|Any CPU.Build.0 = Release|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x86.ActiveCfg = Release|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x86.Build.0 = Release|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x64.ActiveCfg = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x64.Build.0 = Debug|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x86.ActiveCfg = Debug|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x86.Build.0 = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x64.ActiveCfg = Release|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x64.Build.0 = Release|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.Release|Any CPU.Build.0 = Release|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x86.ActiveCfg = Release|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x86.Build.0 = Release|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU - {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x64.ActiveCfg = Debug|Any CPU - {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x64.Build.0 = Debug|Any CPU - {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU - {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x64.Build.0 = Debug|Any CPU - {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x64.ActiveCfg = Release|Any CPU - {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x64.Build.0 = Release|Any CPU - {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU - {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x64.ActiveCfg = Debug|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x64.Build.0 = Debug|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x86.ActiveCfg = Debug|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x86.Build.0 = Debug|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x64.ActiveCfg = Release|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x64.Build.0 = Release|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|Any CPU.Build.0 = Release|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x86.ActiveCfg = Release|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x86.Build.0 = Release|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x64.ActiveCfg = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x64.Build.0 = Debug|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x86.ActiveCfg = Debug|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x86.Build.0 = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x64.ActiveCfg = Release|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x64.Build.0 = Release|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|Any CPU.Build.0 = Release|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x86.ActiveCfg = Release|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x86.Build.0 = Release|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x64.ActiveCfg = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x64.Build.0 = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x86.ActiveCfg = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x86.Build.0 = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x64.ActiveCfg = Release|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x64.Build.0 = Release|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|Any CPU.Build.0 = Release|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x86.ActiveCfg = Release|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x86.Build.0 = Release|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU + {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|x64.ActiveCfg = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|x64.Build.0 = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|x86.ActiveCfg = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|x86.Build.0 = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|x64.ActiveCfg = Release|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|x64.Build.0 = Release|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|Any CPU.Build.0 = Release|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|x86.ActiveCfg = Release|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|x86.Build.0 = Release|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {422D1620-0166-4C26-9A81-CA8A2EB1AB58} - EndGlobalSection - GlobalSection(Performance) = preSolution - HasPerformanceSessions = true - EndGlobalSection GlobalSection(NestedProjects) = preSolution {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} = {267F81EF-A8AB-49FD-9F56-D7EC3C1F7C7C} {EF26A475-6101-4C9C-A717-D60BB92A2302} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} @@ -215,8 +532,15 @@ Global {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {B945A183-2174-4ACB-B289-8A5C546656FE} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} - {39AEA075-6457-46C0-8821-1158BE6EFA57} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {9F6D7DE8-185B-4C1D-B809-3314D092DF28} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} + {39AEA075-6457-46C0-8821-1158BE6EFA57} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} + {F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {422D1620-0166-4C26-9A81-CA8A2EB1AB58} + EndGlobalSection + GlobalSection(Performance) = preSolution + HasPerformanceSessions = true EndGlobalSection EndGlobal diff --git a/compose.yaml b/compose.yaml index d19a9b463..2e91c7da7 100644 --- a/compose.yaml +++ b/compose.yaml @@ -109,6 +109,77 @@ services: RUN apt-get update && apt-get -y install iputils-ping command: [ "ping", "sparkd" ] + pubsub: + volumes: + - ${PUBSUB__DATA_DIR:-pubsub_data}:/home/bts/sparkdata/data + build: + dockerfile: src/DataStreamSuite/PubSubServer/Dockerfile + args: + - SOURCE_DIR=${PUBSUB__SOURCE_DIR} + - CONFIG_DIR=${PUBSUB__CONFIG_DIR} + ports: + - 22019:22019 + command: > + sh -c " + echo bts | sudo -S chown -R bts:bts /home/bts/sparkdata/data + if [ -e "/home/bts/sparkdata/data/logging.PubSubServer/log" ]; then + mv "/home/bts/sparkdata/data/logging.PubSubServer/log" "/home/bts/sparkdata/data/logging.PubSubServer/log_$(date '+%Y%m%d-%H%M')" + fi + if [ -e "/home/bts/sparkdata/conf/.env" ]; then + echo 'Sourcing /home/bts/sparkdata/conf/.env' + set -a + . /home/bts/sparkdata/conf/.env + set +a + fi + if [ -e "/home/bts/sparkdata/conf/.env.local" ]; then + echo 'Sourcing /home/bts/sparkdata/conf/.env.local' + set -a + . /home/bts/sparkdata/conf/.env.local + set +a + fi + ./PubSubServer" + env_file: + - .env + - ${PUBSUB__CONFIG_DIR}/.env + + md-publisher: + volumes: + - ${MD_PUBLISHER__DATA_DIR:-md_publisher_data}:/home/bts/sparkdata/data + - historic_md:/home/bts/sparkdata/data/databento + build: + dockerfile: src/DataStreamSuite/DataStreamPublisher/Dockerfile + args: + - SOURCE_DIR=${MD_PUBLISHER__SOURCE_DIR} + - CONFIG_DIR=${MD_PUBLISHER__CONFIG_DIR} + command: > + sh -c " + echo bts | sudo -S chown -R bts:bts /home/bts/sparkdata/data + if [ -e "/home/bts/sparkdata/data/logging.DataStreamPublisher/log" ]; then + mv "/home/bts/sparkdata/data/logging.DataStreamPublisher/log" "/home/bts/sparkdata/data/logging.DataStreamPublisher/log_$(date '+%Y%m%d-%H%M')" + fi + if [ -e "/home/bts/sparkdata/conf/.env" ]; then + echo 'Sourcing /home/bts/sparkdata/conf/.env' + set -a + . /home/bts/sparkdata/conf/.env + set +a + fi + if [ -e "/home/bts/sparkdata/conf/.env.local" ]; then + echo 'Sourcing /home/bts/sparkdata/conf/.env.local' + set -a + . /home/bts/sparkdata/conf/.env.local + set +a + fi + dockerize -wait tcp://pubsub:22019 -timeout 10s ./DataStreamPublisher" + env_file: + - .env + - ${MD_PUBLISHER__CONFIG_DIR}/.env + volumes: sparkd_data: name: "sparkd_${SPARKD__CONFIG_PORT:-8000}" + pubsub_data: + name: "pubsub_22019" + md_publisher_data: + name: "md_publisher_22019" + historic_md: + name: "historic_md" diff --git a/src/DataStreamSuite/Bts.Extensions.Hosting/Bts.Extensions.Hosting.csproj b/src/DataStreamSuite/Bts.Extensions.Hosting/Bts.Extensions.Hosting.csproj new file mode 100644 index 000000000..6f62aa13d --- /dev/null +++ b/src/DataStreamSuite/Bts.Extensions.Hosting/Bts.Extensions.Hosting.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/src/DataStreamSuite/Bts.Extensions.Hosting/HostBuilderExtensions.cs b/src/DataStreamSuite/Bts.Extensions.Hosting/HostBuilderExtensions.cs new file mode 100644 index 000000000..db1d11748 --- /dev/null +++ b/src/DataStreamSuite/Bts.Extensions.Hosting/HostBuilderExtensions.cs @@ -0,0 +1,71 @@ +namespace Bts.Extensions.Hosting; + +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +using System.Diagnostics; + +public static class HostBuilderExtensions { + public static IHostBuilder CreateBtsBuilder(string[] args) { + // Obtain calling assembly name here, rather than in the lambda where it is actually needed, + // because want the name of the assembly that called this function, not the assembly that will + // eventually invoke the lambda...that will be the Microsoft.Extensions.Hosting assembly. Get + // the name of the assembly that called this function. That will act as the "appsettings" json + // file prefix. + var exeName = GetCallingAssemblyName(); + return Host.CreateDefaultBuilder(args) + .ConfigureAppConfiguration((context, configBuilder) => + ConfigureApp(configBuilder, context.HostingEnvironment.EnvironmentName, exeName)); + } + + public static void ConfigureApp(IConfigurationBuilder configBuilder, string? environment = null, string? prefix = null) { + var baseFileName = prefix is null ? "appsettings" : $"{prefix}.appsettings"; + AddJsonFile($"{baseFileName}.json"); + if (environment is not null) { + AddJsonFile($"{baseFileName}.{environment}.json"); + } + + var cfg = configBuilder.Build().GetSection("config")?.Value; + if (!SetBasePath(cfg)) { + AddJsonFile(cfg); + } + + bool SetBasePath(string? path) { + if (!Directory.Exists(path)) { + return false; + } + configBuilder.SetBasePath(path); + return true; + } + + bool AddJsonFile(string? path) { + if (!File.Exists(path)) { + return false; + } + configBuilder.AddJsonFile(path); + return true; + } + } + + public static void ConfigureLogging(ILoggingBuilder loggingBuilder, ILoggerProvider loggerProvider) => + loggingBuilder.AddFilter("Microsoft", LogLevel.Warning) + .AddFilter("System", LogLevel.Warning) + .AddFilter("NToastNotify", LogLevel.Warning) + .AddProvider(loggerProvider) + .AddSimpleConsole(opts => { + opts.SingleLine = true; + opts.TimestampFormat = "yyyy-MM-dd HH:mm:ss.ffffff|"; + }) + .AddDebug(); + + public static string GetCallingAssemblyName() => + new StackTrace() + .GetFrame(2) + ?.GetMethod() + ?.Module + ?.Assembly + ?.GetName() + ?.Name + ?? throw new InvalidOperationException("Failed to determine name of calling assembly (calling method is null)"); +} diff --git a/src/DataStreamSuite/DataStream/Offloading/RemoteQueryManager.cs b/src/DataStreamSuite/DataStream/Offloading/RemoteQueryManager.cs index d3714466c..223a7b4f9 100644 --- a/src/DataStreamSuite/DataStream/Offloading/RemoteQueryManager.cs +++ b/src/DataStreamSuite/DataStream/Offloading/RemoteQueryManager.cs @@ -6,6 +6,8 @@ using System.Runtime.InteropServices; using Bts.DataStreamExpressions; using BCG.Utilities.General; using bts; +using Bts.PubSub; +using Bts.DataStreamCore; namespace BCG { // listens to the requests posted on "cloud_streams" request table, and @@ -42,13 +44,15 @@ namespace BCG { private IDictionary _stream_pub_map = new Dictionary(); private ViewStream _stream = new TableStream("cloud_streams"); - private PubTableBroker _broker = new PubTableBroker(); - private ManagedSubscriber _sub = ManagedSubscriber.instance; + readonly IPubTableBroker _broker; + readonly IManagedSubscriber _sub; - public RemoteQueryManager() { + public RemoteQueryManager(IManagedSubscriber managedSubscriber, IPubTableBroker pubTableBroker) { + _sub = managedSubscriber; + _broker = pubTableBroker; _stream.onChange += _on_str; - _sub.subscribe("RemoteRequest", (string tag, byte[] data) => { + _sub.Subscribe("RemoteRequest", (string tag, byte[] data) => { RemoteRequest req = RemoteRequest.construct_from_bytes(data); _spawn_remote_stream(req.published_table_name, req.stream_expression, false); }); diff --git a/src/DataStreamSuite/DataStream/Primitives/Misc/PubsubEchoTestStream.cs b/src/DataStreamSuite/DataStream/Primitives/Misc/PubsubEchoTestStream.cs index b37570af9..dc1c3f1a0 100644 --- a/src/DataStreamSuite/DataStream/Primitives/Misc/PubsubEchoTestStream.cs +++ b/src/DataStreamSuite/DataStream/Primitives/Misc/PubsubEchoTestStream.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Runtime.CompilerServices; using bts.api; +using Bts.PubSub.Routing; namespace bts { @@ -95,10 +96,11 @@ namespace bts }; IOState _state = IOState.SEND; - public PubsubEchoTestStream(string server_url, TimeSpan publish_period, int payload_size, string tag_name, ViewStreamDatabase vsd) - { - var route = new PubSubRoute(server_url, ".*"); - _router = new PubSubRouter(route); + public PubsubEchoTestStream(string server_url, TimeSpan publish_period, int payload_size, string tag_name, ViewStreamDatabase vsd) { + _router = new PubSubRouter(new PubSubRouterConfig() { + PublisherRoutes = new() { new(server_url, ".*") }, + SubscriberRoutes = new() { new(server_url, ".*") }, + }); _vsd = vsd; _payload_sz = payload_size; var schema = BlueDataUtility.form_schema("PubSubTest", @@ -220,4 +222,4 @@ namespace bts } } -} \ No newline at end of file +} diff --git a/src/DataStreamSuite/DataStream/Primitives/Misc/TestStream.cs b/src/DataStreamSuite/DataStream/Primitives/Misc/TestStream.cs index b6c6d6628..f3b5efeed 100644 --- a/src/DataStreamSuite/DataStream/Primitives/Misc/TestStream.cs +++ b/src/DataStreamSuite/DataStream/Primitives/Misc/TestStream.cs @@ -617,6 +617,7 @@ namespace BCG { private static TestResult _run_single_tag_data_test_clean() { + // var tagHandlerFactory // create message var test_name = MethodBase.GetCurrentMethod()?.Name; var schema = create_schema_with_all_types(); @@ -624,7 +625,7 @@ namespace BCG { BlueTable table = new BlueTable(schema); IStreamIOMsgSerializer serializer = new StreamIOSerializationController(); IStreamMsgDeserilizer deser = new StreamIODeserializationController(); - bts.SingleTagData st_data = new bts.SingleTagData(tag, DSTagManager.DataStreamTagType); + bts.SingleTagData st_data = new bts.SingleTagData(tag, DSTagManager.DataStreamTagType, new PubsubServerStreamTagHandler()); // create with 100 rows int n_rows = 100; bool is_succ = true; diff --git a/src/DataStreamSuite/DataStream/Publish/CircularPublisher.cs b/src/DataStreamSuite/DataStream/Publish/CircularPublisher.cs index 464e30dcc..9f7964ba6 100644 --- a/src/DataStreamSuite/DataStream/Publish/CircularPublisher.cs +++ b/src/DataStreamSuite/DataStream/Publish/CircularPublisher.cs @@ -1,3 +1,5 @@ +using Bts.DataStreamCore; + using System; namespace BCG { @@ -7,14 +9,15 @@ namespace BCG { /// public class CircularPublisher { private CircularRowCollection myBuffer; - private PubTableBroker myBroker; + private readonly IPubTableBroker myBroker; private int myBufferSize; - public CircularPublisher(int bufferSize) { + public CircularPublisher(int bufferSize, IPubTableBroker broker) { myBufferSize = bufferSize; + myBroker = broker; } - public CircularPublisher(int bufferSize, IBlueRowCollection rows) - : this(bufferSize) { + public CircularPublisher(int bufferSize, IPubTableBroker broker, IBlueRowCollection rows) + : this(bufferSize, broker) { publishRows(rows); } @@ -23,7 +26,6 @@ namespace BCG { myBuffer = new CircularRowCollection( new BlueTableSchema(nr.schema.tableName, nr.schema.columnInfo), myBufferSize); - myBroker = new PubTableBroker(); myBroker.create_table(myBuffer); } IBlueRow br = myBuffer.addRowWithReturn(nr); @@ -38,7 +40,6 @@ namespace BCG { new BlueTableSchema(BlueDataUtility.extractRow(nrs, 0).schema.tableName, BlueDataUtility.extractRow(nrs, 0).schema.columnInfo), myBufferSize); - myBroker = new PubTableBroker(); myBroker.create_table(myBuffer); } BlueTable deletes = new BlueTable(myBuffer.schema); diff --git a/src/DataStreamSuite/DataStream/Publish/ViewPublisher.cs b/src/DataStreamSuite/DataStream/Publish/ViewPublisher.cs index d9a923497..6828256bf 100644 --- a/src/DataStreamSuite/DataStream/Publish/ViewPublisher.cs +++ b/src/DataStreamSuite/DataStream/Publish/ViewPublisher.cs @@ -4,10 +4,12 @@ using System.Data; using BCG.Utilities; +using Bts.DataStreamCore; + namespace BCG { public class ViewPublisher : IDisposable { protected ViewPublisher() { } - private readonly PubTableBroker _broker; + private readonly IPubTableBroker _broker; protected readonly ViewStream _stream; private int _n_updates = 0; @@ -15,7 +17,7 @@ namespace BCG { /// in the schema (be careful with that because this /// could lead to double publishes if the schema name /// is not uniquely chosen) - public ViewPublisher(string name, PubTableBroker broker, ViewStream vs) { + public ViewPublisher(string name, IPubTableBroker broker, ViewStream vs) { _stream = String.IsNullOrEmpty(name) ? vs : new ChangeTableNameStream(vs, name); _broker = broker; _stream.onChange += new DataStream.ChangeDelegate(_handle_update); diff --git a/src/DataStreamSuite/DataStream/Services/DataStreamServices.cs b/src/DataStreamSuite/DataStream/Services/DataStreamServices.cs new file mode 100644 index 000000000..d35f836da --- /dev/null +++ b/src/DataStreamSuite/DataStream/Services/DataStreamServices.cs @@ -0,0 +1,11 @@ +namespace Bts.DataStream.Services; + +using BCG; +using BCG.Utilities.General; + +using Microsoft.Extensions.DependencyInjection; + +public static class DataStreamServices { + public static IServiceCollection AddRemoteQueryManager(this IServiceCollection services) => + services.AddSingleton(); +} diff --git a/src/DataStreamSuite/DataStreamCore/Messaging/Publish/IPubTableBroker.cs b/src/DataStreamSuite/DataStreamCore/Messaging/Publish/IPubTableBroker.cs new file mode 100644 index 000000000..591b9df20 --- /dev/null +++ b/src/DataStreamSuite/DataStreamCore/Messaging/Publish/IPubTableBroker.cs @@ -0,0 +1,8 @@ +namespace Bts.DataStreamCore; + +using BCG; + +public interface IPubTableBroker { + void create_table(IBlueRowCollection table); + void make_batch_changes(IBlueRowCollection new_rows, IBlueRowCollection del_rows, IBlueRowCollection added_rows); +} diff --git a/src/DataStreamSuite/DataStreamCore/Messaging/Publish/PubTableBroker.cs b/src/DataStreamSuite/DataStreamCore/Messaging/Publish/PubTableBroker.cs index 3119202ba..848a087d4 100644 --- a/src/DataStreamSuite/DataStreamCore/Messaging/Publish/PubTableBroker.cs +++ b/src/DataStreamSuite/DataStreamCore/Messaging/Publish/PubTableBroker.cs @@ -8,12 +8,14 @@ using BCG.Utilities; using bts; +using Bts.DataStreamCore; + namespace BCG { /// /// This class will be used by the clients to publish tabular data to the pubsub /// - public class PubTableBroker { - protected PublisherCore _publisher_core; + public class PubTableBroker : IPubTableBroker { + protected IPublisherCore _publisher_core; protected IDictionary _publisher_map = new Dictionary(); @@ -22,7 +24,7 @@ namespace BCG { public PubTableBroker() : this(new PublisherCore()) { } - public PubTableBroker(PublisherCore publisher) { + public PubTableBroker(IPublisherCore publisher) { _publisher_core = publisher; Log.Gen.info("PubTableBroker constructed"); } diff --git a/src/DataStreamSuite/DataStreamCore/Messaging/Publish/SinglePubTableBroker.cs b/src/DataStreamSuite/DataStreamCore/Messaging/Publish/SinglePubTableBroker.cs index 52741c9dc..dfb6c0330 100644 --- a/src/DataStreamSuite/DataStreamCore/Messaging/Publish/SinglePubTableBroker.cs +++ b/src/DataStreamSuite/DataStreamCore/Messaging/Publish/SinglePubTableBroker.cs @@ -14,9 +14,9 @@ namespace BCG { public class SinglePubTableBroker { private readonly string _tag; protected IStreamIOMsgSerializer _serializer; - protected PublisherCore _publisher_core; + protected IPublisherCore _publisher_core; - public SinglePubTableBroker(string tag, PublisherCore publisher_core) { + public SinglePubTableBroker(string tag, IPublisherCore publisher_core) { bts.Log.Gen.info($"SinglePubTableBroker.cons created for tag: {tag}"); _tag = tag; _publisher_core = publisher_core; @@ -51,4 +51,4 @@ namespace BCG { } } -} \ No newline at end of file +} diff --git a/src/DataStreamSuite/DataStreamCore/Services/DataStreamCoreServices.cs b/src/DataStreamSuite/DataStreamCore/Services/DataStreamCoreServices.cs new file mode 100644 index 000000000..8648d4af0 --- /dev/null +++ b/src/DataStreamSuite/DataStreamCore/Services/DataStreamCoreServices.cs @@ -0,0 +1,19 @@ +namespace Bts.DataStreamCore.Services; + +using BCG; +using BCG.Utilities.General; + +using Bts.PubSub; + +using Microsoft.Extensions.DependencyInjection; + +public static class DataStreamCoreServices { + public static IServiceCollection AddPubTableBroker(this IServiceCollection services) => + services.AddSingleton(); + + public static IServiceCollection AddViewStreamDatabase(this IServiceCollection services) => + services.AddSingleton(sp => { + ViewStreamDatabase.SetGlobalInstance(new ViewStreamDatabase(sp.GetRequiredService())); + return ViewStreamDatabase.instance; + }); +} diff --git a/src/DataStreamSuite/DataStreamCore/ViewStreamDatabase.cs b/src/DataStreamSuite/DataStreamCore/ViewStreamDatabase.cs index b691c107a..400f15322 100644 --- a/src/DataStreamSuite/DataStreamCore/ViewStreamDatabase.cs +++ b/src/DataStreamSuite/DataStreamCore/ViewStreamDatabase.cs @@ -1,16 +1,12 @@ -using System; -using System.Collections; -using System.IO; -using BCG.Utilities; using BCG.Utilities.General; -//using BCG.Utilities.BlueConfiguration; -using System.Collections.Generic; -using System.Threading; -using mbts; -using System.Linq; -using System.Diagnostics; + using Bts.PubSub; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; + namespace BCG { public class ViewStreamDatabase : IWorker, IWorkScheduler, IDisposable { internal delegate void TagFireDelegate(string tag); @@ -38,11 +34,14 @@ namespace BCG { private static readonly object myInstanceLockObject = new object(); private readonly object myStateLock = new object(); - public ViewStreamDatabase() - : this(new SubscriberCore()) { - } + public ViewStreamDatabase(ISubscriberCoreFactory subscriberCoreFactory) + : this(subscriberCoreFactory.Create()) { } - public ViewStreamDatabase(ISubscriberCore subscriberCore) { + // This ctr is private to ensure the ISubscriberCore is created by ISubscriberCoreFactory + // (we'll temporarily continue to use it internally to create ViewStreamDatabase.instance, + // but new code should use the factory). The factory itself is created via dependency + // injection so it has the correct runtime config (for pubsub routing, etc.). + ViewStreamDatabase(ISubscriberCore subscriberCore) { mySubscriberCore = subscriberCore; // if (DataStreamLoadFileConfig.instance.profileStreams) // new DataStreamPerfRecorder(this); @@ -66,7 +65,7 @@ namespace BCG { if (mySelf == null || mySelf.myIsDisposed) lock (myInstanceLockObject) { if (mySelf == null || mySelf.myIsDisposed) { - mySelf = new ViewStreamDatabase(); + mySelf = new ViewStreamDatabase(new SubscriberCore()); instance_hashcode = mySelf.GetHashCode(); } } @@ -235,6 +234,11 @@ namespace BCG { } } + internal static void SetGlobalInstance(ViewStreamDatabase vsd) { + Log.isnull(mySelf); + mySelf = vsd; + } + private List _pending_worker_ops = new List(); private bool _is_worker_call_in_progress = false; class PendingAddRemoveWorker { diff --git a/src/DataStreamSuite/DataStreamPublisher/Configurations/MarketDataPublisher.json b/src/DataStreamSuite/DataStreamPublisher/Configurations/MarketDataPublisher.json deleted file mode 100644 index 2f7a35544..000000000 --- a/src/DataStreamSuite/DataStreamPublisher/Configurations/MarketDataPublisher.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "user": "bts", - "sparkd": "http://192.168.1.80:8000/config", - "pubsub": { - "milliseconds_between_sub_info_updates": 1000, - "milliseconds_between_time_slice_updates": 5000, - "milliseconds_between_no_buffer_space_retries": 100, - "retries_on_no_buffer_space": 1, - "do_it_all_seconds_between_logs": 0, - "heartbeat_interval": 15000, - "missing_heartbeats_before_gc": 50, - "use_managed_sockets": true, - "state_update_period": 5000, - "statistics_update_period": 5000, - "disposed_connection_check_period": 1000, - "message_processing_warning_threshold": 1000, - "server_port": 12345, - "publisher_routes": [ - { - "name": "default", - "server_address": "bts-cloud://127.0.0.1:12345", - "tag": ".*" - } - ], - "subscriber_routes": [ - { - "name": "default", - "server_address": "bts-cloud://127.0.0.1:12345", - "tag": ".*" - } - ], - "max_packet_size": 500000000, - "blue_comm_must_die": true, - "crushable_tags": [], - "tag_type_to_assembly_map": [ - { - "handler_class": "BCG.PubSubServerTagHandler", - "assembly": "DataStreamCore.dll" - } - ], - "server_queue": "PubSubQueue", - "port_range": { - "first": 30400, - "last": 31700 - }, - "bind_to_random_port": false, - "debug_tags": "^NOTAGS$", - "latency_report_threshold_ms": 1500, - "use_substations": false, - "use_dynamic_clients": false, - "is_substation": false, - "internally_publish_sub_info": true, - "use_managed_clients_in_native_code": false, - "compressed_tags": "^NOTAGS$", - "tags_to_report_compression_ratio": "^NOTAGS$", - "disable_msmq": false, - "use_prepublished_server_state": false, - "ip_translation": null, - "gc_activation_threshold": 0, - "wait_period_after_gc": 1000 - }, - "publishers": [ - { - "name": "market_data", - "streams": [ - { - "name": "bbo", - "expression": "bbo()", - "is_on_websocket": true - }, - { - "name": "instruments", - "expression": "instruments()", - "is_on_websocket": true - }, - { - "name": "timesales", - "expression": "timesales(10000)", - "is_on_websocket": true - }, - { - "name": "books", - "expression": "books()", - "is_on_websocket": true - } - ] - }, - { - "name": "test_data", - "streams": [ - { - "name": "milliseconds_1000_100", - "expression": "milliseconds(1000,100)", - "is_on_websocket": true - }, - { - "name": "test_literal", - "expression": "literal(\"x\", \"420.0\")", - "is_on_websocket": true - }, - { - "name": "test_not_on_websocket", - "expression": "literal(\"x\", \"840.0\")", - "is_on_websocket": false - } - ] - } - // { - // "name": "news_data", - // "streams": [ - // { - // "name": "benzinga_news", - // "expression": "benzingaNews(\"mongodb://localhost:27017\",\"local\",\"news_headlines\", \"30s\", \"5d\")", - // "is_on_websocket": true - // }, - // { - // "name": "benzinga_news_symbols", - // "expression": "benzingaNewsSymbols(benzinga_news)", - // "is_on_websocket": true - // }, - // { - // "name": "benzinga_news_symbol_state", - // "expression": "benzingaNewsSymbolState(benzinga_news)", - // "is_on_websocket": true - // } - // ] - // } - ] -} \ No newline at end of file diff --git a/src/DataStreamSuite/DataStreamPublisher/Configurations/ReplayMarketData/.env b/src/DataStreamSuite/DataStreamPublisher/Configurations/ReplayMarketData/.env new file mode 100644 index 000000000..bf90f7ceb --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/Configurations/ReplayMarketData/.env @@ -0,0 +1,2 @@ +MD_PUBLISHER__CONFIG_DIR=src/DataStreamSuite/DataStreamPublisher/Configurations/ReplayMarketData +DOTNET_ENVIRONMENT=ReplayMarketData diff --git a/src/DataStreamSuite/DataStreamPublisher/Configurations/SimpleEchoClient.json b/src/DataStreamSuite/DataStreamPublisher/Configurations/SimpleEchoClient.json deleted file mode 100644 index d4ef92277..000000000 --- a/src/DataStreamSuite/DataStreamPublisher/Configurations/SimpleEchoClient.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "user": "bts", - "simple_echo_client": true -} diff --git a/src/DataStreamSuite/DataStreamPublisher/Configurations/SimpleTestDataPublisher.json b/src/DataStreamSuite/DataStreamPublisher/Configurations/SimpleTestDataPublisher.json deleted file mode 100644 index 64ec4dd76..000000000 --- a/src/DataStreamSuite/DataStreamPublisher/Configurations/SimpleTestDataPublisher.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "user": "bts", - "pubsub": { - "milliseconds_between_sub_info_updates": 1000, - "milliseconds_between_time_slice_updates": 5000, - "milliseconds_between_no_buffer_space_retries": 100, - "retries_on_no_buffer_space": 1, - "do_it_all_seconds_between_logs": 0, - "heartbeat_interval": 15000, - "missing_heartbeats_before_gc": 50, - "use_managed_sockets": true, - "state_update_period": 5000, - "statistics_update_period": 5000, - "disposed_connection_check_period": 1000, - "message_processing_warning_threshold": 1000, - "server_port": 12345, - "publisher_routes": [ - { - "name": "default", - "server_address": "bts-cloud://localhost:12345", - "tag": ".*" - } - ], - "subscriber_routes": [ - { - "name": "default", - "server_address": "bts-cloud://localhost:12345", - "tag": ".*" - } - ], - "max_packet_size": 500000000, - "blue_comm_must_die": true, - "crushable_tags": [], - "tag_type_to_assembly_map": [ - { - "handler_class": "BCG.PubSubServerTagHandler", - "assembly": "DataStreamCore.dll" - } - ], - "server_queue": "PubSubQueue", - "port_range": { - "first": 30400, - "last": 31700 - }, - "bind_to_random_port": false, - "debug_tags": "^NOTAGS$", - "latency_report_threshold_ms": 1500, - "use_substations": false, - "use_dynamic_clients": false, - "is_substation": false, - "internally_publish_sub_info": true, - "use_managed_clients_in_native_code": false, - "compressed_tags": "^NOTAGS$", - "tags_to_report_compression_ratio": "^NOTAGS$", - "disable_msmq": false, - "use_prepublished_server_state": false, - "ip_translation": null, - "gc_activation_threshold": 0, - "wait_period_after_gc": 1000 - }, - "publishers": [ - { - "name": "test_data", - "streams": [ - { - "name": "test_literal", - "expression": "literal(\"x\", \"420.0\")", - "is_on_websocket": true - } - ] - } - ] -} diff --git a/src/DataStreamSuite/DataStreamPublisher/Configurations/TestDataPublisher.json b/src/DataStreamSuite/DataStreamPublisher/Configurations/TestDataPublisher.json deleted file mode 100644 index 736a893e0..000000000 --- a/src/DataStreamSuite/DataStreamPublisher/Configurations/TestDataPublisher.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "user": "bts", - "publishers": [ - { - "name": "test_data", - "streams": [ - { - "name": "seconds_1_10", - "expression": "milliseconds(1000,10)", - "is_on_websocket": true - }, - { - "name": "benzinga_news", - "expression": "benzingaNews(\"mongodb://localhost:27017\",\"local\",\"news_headlines\", \"30s\", \"5d\")", - "is_on_websocket": true - }, - { - "name": "benzinga_news_symbols", - "expression": "benzingaNewsSymbols(benzinga_news)", - "is_on_websocket": true - }, - { - "name": "benzinga_news_symbol_state", - "expression": "benzingaNewsSymbolState(benzinga_news)", - "is_on_websocket": true - }, - { - "name": "test_literal", - "expression": "literal(\"x\", \"420.0\")", - "is_on_websocket": true - }, - { - "name": "test_not_on_websocket", - "expression": "literal(\"x\", \"840.0\")", - "is_on_websocket": false - } - ] - } - ] -} \ No newline at end of file diff --git a/src/DataStreamSuite/DataStreamPublisher/CsvPublisherConfig.cs b/src/DataStreamSuite/DataStreamPublisher/CsvPublisherConfig.cs new file mode 100644 index 000000000..7fecb3321 --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/CsvPublisherConfig.cs @@ -0,0 +1,6 @@ +namespace Bts.DataStreamPublisher; + +public class CsvPublisherConfig { + public string? Name { get; set; } + public string? CsvDir { get; set; } +} diff --git a/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisher.csproj b/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisher.csproj index 179d1c62e..0805cd9f0 100644 --- a/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisher.csproj +++ b/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisher.csproj @@ -17,6 +17,17 @@ + + + + + + + + + + + diff --git a/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisherConfig.cs b/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisherConfig.cs index 5e6dba0e3..d4bb4ac72 100644 --- a/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisherConfig.cs +++ b/src/DataStreamSuite/DataStreamPublisher/DataStreamPublisherConfig.cs @@ -1,7 +1,5 @@ namespace Bts.DataStreamPublisher; -using Bts.PubSub; - using CommandLine; using System; @@ -10,49 +8,13 @@ using System.IO; using System.Text.Json; using System.Text.Json.Serialization; -public class DataStreamPublisherConfig -{ - /// - /// The login user for sparkd - /// - [JsonPropertyName("user")] - [Option("user", HelpText = "The sparkd login user")] - public string? User { get; set; } - - /// - /// The login password for sparkd - /// - [JsonPropertyName("password")] - [Option("pass", HelpText = "The sparkd login password")] - public string? Password { get; set; } - - /// - /// The config server url for sparkd - /// - [JsonPropertyName("sparkd")] - [Option("sparkd", HelpText = "The sparkd config server")] - public string? Sparkd { get; set; } - +public class DataStreamPublisherConfig { /// /// The tables to publish on startup. Each key/value represents a table name/query to publish. /// - [JsonPropertyName("publishers")] - public List? Publishers { get; set; } + public List? PublisherNodes { get; set; } - [JsonPropertyName("mongodb_url")] - public string MONGO_DB_URL { get; set; } - - [JsonPropertyName("mongodb_db_name")] - public string MONGO_DB_NAME { get; set; } - - [JsonPropertyName("mongodb_db_collection")] - public string MONGO_DB_COLLECTION { get; set; } - - [JsonPropertyName("benzinga_news_ttl")] - public string BENZINGA_NEWS_TTL { get; set; } - - [JsonPropertyName("pubsub")] - public PubSubConfig? PubSub { get; set; } + public List? CsvDirs { get; set; } [Option( "config", @@ -62,18 +24,10 @@ public class DataStreamPublisherConfig public string? ConfigFile { get; set; } public static DataStreamPublisherConfig Default() => - new() - { - PubSub = PubSubConfig.Default(), - }; + new() { }; - public void MergeWith(DataStreamPublisherConfig other) - { - User ??= other.User; - Password ??= other.Password; - Sparkd ??= other.Sparkd; - Publishers ??= other.Publishers; - PubSub ??= other.PubSub; + public void MergeWith(DataStreamPublisherConfig other) { + PublisherNodes ??= other.PublisherNodes; ConfigFile ??= other.ConfigFile; } @@ -84,10 +38,8 @@ public class DataStreamPublisherConfig /// /// JsonSerializer.Deserialize returns null /// - public void MergeWithConfigFile() - { - if (ConfigFile is null) - { + public void MergeWithConfigFile() { + if (ConfigFile is null) { return; } var cfgString = File.ReadAllText(ConfigFile); diff --git a/src/DataStreamSuite/DataStreamPublisher/Dockerfile b/src/DataStreamSuite/DataStreamPublisher/Dockerfile new file mode 100644 index 000000000..ffb5117ce --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/Dockerfile @@ -0,0 +1,16 @@ +FROM bluetradingsystems/linux_dotnet7 + +ARG CONFIG_DIR="src/DataStreamSuite/DataStreamPublisher/Configurations/Development" +ARG SOURCE_DIR="build/Release/bin/net8.0/linux-x64/publish" + +ENV DOCKERIZE_VERSION=v0.7.0 +USER root +RUN apt-get update \ + && apt-get install -y wget \ + && wget -O - https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzf - -C /usr/local/bin \ + && apt-get autoremove -yqq --purge wget && rm -rf /var/lib/apt/lists/* + +USER "bts" +COPY --chown=bts:bts "${SOURCE_DIR}" "bin" +COPY --chown=bts:bts "${CONFIG_DIR}" "/home/bts/.local/share/bts/DataStreamPublisher/conf" +WORKDIR "/home/bts/bin" diff --git a/src/DataStreamSuite/DataStreamPublisher/Program.cs b/src/DataStreamSuite/DataStreamPublisher/Program.cs index 3af880dfa..b672f0bf3 100644 --- a/src/DataStreamSuite/DataStreamPublisher/Program.cs +++ b/src/DataStreamSuite/DataStreamPublisher/Program.cs @@ -1,169 +1,38 @@ -using BCG; -using BCG.Utilities.General; +using Bts.DataStream.Services; +using Bts.DataStreamCore.Services; +using Bts.DataStreamPublisher.Services; +using Bts.Extensions.Hosting; +using Bts.PubSub.Services; -using bts; -using bts.api.core; -using bts.utils; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; -using Bts.DataStreamExpressions; -using Bts.DataStreamPublisher; -using Bts.PubSub; - -using CommandLine; - -using mbts.config; +using Spark.Api.Services; +using Spark.Core.Services; using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text.Json; -using System.Threading.Tasks; -await Parser.Default.ParseArguments(args) - .MapResult(RunAsync, errs => Task.FromResult(1)); - -async Task RunAsync(DataStreamPublisherConfig cfg) -{ - try - { - cfg.MergeWithConfigFile(); - cfg.MergeWith(DataStreamPublisherConfig.Default()); - PubSubConfig.SetGlobalConfig(Log.notnull(cfg.PubSub)); - if (!await Configuration.InitializeAsync(cfg.Sparkd)) { - Console.Error.WriteLine("Failed to initialize Spark config"); - return 1; - } - Log.Gen.info("Starting DataStreamPublisher"); - var service_ctx = ServiceContext.create(cfg.Sparkd); - await service_ctx.login(cfg.User ?? "bts", cfg.Password ?? string.Empty); - _publish_streams(cfg.Publishers ?? new(0)); - } - catch (Exception ex) - { - // Write the error to console first, in case the logging system is compromised. - var error_msg = $"DataStreamPublisher threw exception:\n{ex}"; - Console.Error.WriteLine(error_msg); - Console.Error.Flush(); - bts.Log.Gen.error(error_msg); - return 1; - } - return 0; +var host = HostBuilderExtensions.CreateBtsBuilder(args) + .ConfigureServices(ConfigureServices) + .Build(); +try { + Console.Write("Starting DataStreamPublisher"); + host.Run(); + Console.Write("DataStreamPublisher exited gracefully."); +} catch (Exception ex) { + Console.Error.Write($"DataStreamPublisher crashed: {ex}"); + return 1; } +return 0; -static ViewStream? build_stream(string? stream_expression) -{ - // Console.WriteLine("Hit key to continue"); - // Console.ReadLine(); - if (stream_expression is null) - { - return null; - } - try - { - bts.Log.Gen.info($"build_stream stream_expression: {stream_expression}"); - var exp = DataStreamExpressionsInterpreter.Evaluate(stream_expression); - var rv = exp.getView(new Dictionary(0)); - return rv; - - } - catch (Exception ex) - { - bts.Log.assert(false, $"Could not build stream: {stream_expression} ex: {ex}"); - return null; - } -} - -void _publish_streams(IEnumerable publishers) -{ - PubTableBroker pb_broker = new PubTableBroker(); - RemoteQueryManager csm = new RemoteQueryManager(); - var csvPublishers = new List(); - - foreach (var publisher in publishers) - { - if (Directory.Exists(publisher.CsvDir)) - { - csvPublishers.Add(new(publisher.CsvDir, pb_broker)); - } - } - - var viewPublishers = publishers - .SelectMany(p => p.Streams.empty_if_null().Select(createViewPublisher)) - .ToList(); - - while (true) - { - System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1)); - ViewStreamDatabase.instance.doWork(); - csm.doWork(); - MasterWorker.getInstance(false).doWork(); - ManagedSubscriber.instance.doWork(); - } - - ViewPublisher? createViewPublisher(PublishedStream ps) - { - Log.Gen.info( - $"Instantiating ViewPublisher for: {JsonSerializer.Serialize(ps)}"); - if (string.IsNullOrEmpty(ps.Name)) - { - Log.Gen.warn( - $"Failed to instantiate ViewPublisher. Null/empty 'name': {JsonSerializer.Serialize(ps)}"); - return null; - } - var vs = build_stream(ps.Expression); - if (vs is null) - { - Log.Gen.warn( - $"Failed to instantiate ViewPublisher. Invalid 'expression': {JsonSerializer.Serialize(ps)}"); - return null; - } - var vpub = new ViewPublisher(ps.Name, pb_broker, vs); - vs.onChange += on_change; - return vpub; - } -} - -void on_change(object obj) -{ - bts.Log.Gen.info($"DSPublisher on_change dp: {obj}"); -} - -public class CSVPublisher : IWorker -{ - private IDictionary _pubs = new Dictionary(); - private readonly string _csv_directory; - private PubTableBroker _pub_table_broker; - - public CSVPublisher(string csv_directory, PubTableBroker pub_table_broker) - { - _csv_directory = csv_directory; - _pub_table_broker = pub_table_broker; - MasterWorker.getInstance(false).addWorker(this, TimeSpan.FromSeconds(1)); - } - public void doWork() - { - var file_names = Directory.GetFiles(_csv_directory); - foreach (var fn in file_names) - { - if (!_pubs.ContainsKey(fn)) - { - _handle_new_file(fn); - } - } - } - - private void _handle_new_file(string file_name) - { - if (file_name.EndsWith(".csv")) - { - ViewStream vs = new CSVReaderStream(file_name); - vs = new SchemaGuesserStream(vs); - var toks = file_name.Split('\\'); - string table_name = toks.Last(); - table_name = table_name.Remove(table_name.Length - ".csv".Length); - ViewPublisher vp = new ViewPublisher(table_name, _pub_table_broker, vs); - _pubs.Add(file_name, vp); - } - } +static void ConfigureServices(HostBuilderContext context, IServiceCollection services) { + var config = context.Configuration; + services.AddSpark(config.GetSection("Spark")) + .AddSparkApi(config.GetSection("SparkApi")) + .AddMasterWorker(config.GetSection("MasterWorker")) + .AddViewStreamDatabase() + .AddPubSubClient(config.GetSection("PubSub")) + .AddPubTableBroker() + .AddRemoteQueryManager() + .AddDataStreamPublisher(config.GetSection("DataStreamPublisher")); } diff --git a/src/DataStreamSuite/DataStreamPublisher/PublisherNode.cs b/src/DataStreamSuite/DataStreamPublisher/PublisherNode.cs index 0df5b39a9..ec9092fd7 100644 --- a/src/DataStreamSuite/DataStreamPublisher/PublisherNode.cs +++ b/src/DataStreamSuite/DataStreamPublisher/PublisherNode.cs @@ -9,7 +9,4 @@ public class PublisherNode { [JsonPropertyName("streams")] public List? Streams { get; set; } - - [JsonPropertyName("csv_dir")] - public string? CsvDir { get; set; } } diff --git a/src/DataStreamSuite/DataStreamPublisher/Services/CsvPublisher.cs b/src/DataStreamSuite/DataStreamPublisher/Services/CsvPublisher.cs new file mode 100644 index 000000000..3c04e893b --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/Services/CsvPublisher.cs @@ -0,0 +1,39 @@ +namespace Bts.DataStreamPublisher.Services; + +using BCG; +using BCG.Utilities.General; + +using bts; + +using Bts.DataStreamCore; + +using System; +using System.Collections.Generic; +using System.IO; + +public class CsvPublisher : IWorker, IDisposable { + readonly Dictionary publishers = new(); + readonly string directory; + readonly IPubTableBroker pubTableBroker; + + public CsvPublisher(string directory, IPubTableBroker pubTableBroker) { + this.directory = directory; + this.pubTableBroker = pubTableBroker; + } + + public void doWork() { + var newFiles = Directory.GetFiles(directory, "*.csv").WhereNot(publishers.ContainsKey); + foreach (var file in newFiles) { + ViewStream vs = new CSVReaderStream(file); + vs = new SchemaGuesserStream(vs); + var tableName = Path.GetFileNameWithoutExtension(file); + var vp = new ViewPublisher(tableName, pubTableBroker, vs); + publishers.Add(file, vp); + } + } + + public void Dispose() { + publishers.Values.DisposeAll(); + publishers.Clear(); + } +} diff --git a/src/DataStreamSuite/DataStreamPublisher/Services/DataStreamPublisherService.cs b/src/DataStreamSuite/DataStreamPublisher/Services/DataStreamPublisherService.cs new file mode 100644 index 000000000..7467cbd90 --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/Services/DataStreamPublisherService.cs @@ -0,0 +1,105 @@ +namespace Bts.DataStreamPublisher.Services; + +using BCG; + +using bts; + +using Bts.DataStreamCore; +using Bts.DataStreamExpressions; +using Bts.PubSub; + +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; + +using Spark.Core.Disposables; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; + +/// +/// An that publishes s to the PubSub. +/// It can be added to the application's services via +/// +public sealed class DataStreamPublisherService : IHostedService, IDisposable { + readonly DataStreamPublisherConfig config; + readonly IPubTableBroker pubTableBroker; + readonly IWorkScheduler workScheduler; + List? resources = new(); + + public DataStreamPublisherService(IPubTableBroker pubTableBroker, IWorkScheduler workScheduler, IOptions config) + : this(pubTableBroker, workScheduler, config.Value) { } + + public DataStreamPublisherService(IPubTableBroker pubTableBroker, IWorkScheduler workScheduler, DataStreamPublisherConfig config) { + this.pubTableBroker = pubTableBroker; + this.workScheduler = workScheduler; + this.config = config; + } + + public Task StartAsync(CancellationToken cancellationToken) { + cancellationToken.ThrowIfCancellationRequested(); + resources = new(); + foreach (var publisherNode in config.PublisherNodes.empty_if_null()) { + foreach (var publishedStream in publisherNode.Streams.empty_if_null()) { + if (string.IsNullOrEmpty(publishedStream.Name)) { + Log.Gen.warn("Skipping PublishedStream because it doesn't have a name (must define 'Name' in config json)."); + continue; + } + var vs = CreateViewStream(publishedStream); + if (vs is null) { + continue; + } + resources.Add(new ViewPublisher(publishedStream.Name, pubTableBroker, vs)); + } + } + var csvPublishers = config.CsvDirs.empty_if_null().Select(csvDir => new CsvPublisher(csvDir, pubTableBroker)).ToList(); + resources.AddRange(csvPublishers); + resources.Add(workScheduler.Subscribe(new CompositeWorker(csvPublishers))); + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken) { + cancellationToken.ThrowIfCancellationRequested(); + Dispose(); + return Task.CompletedTask; + } + + public void Dispose() { + resources?.DisposeAll(); + resources?.Clear(); + } + + static ViewStream? CreateViewStream(PublishedStream ps) { + Log.Gen.info( + $"Instantiating ViewPublisher for: {JsonSerializer.Serialize(ps)}"); + if (string.IsNullOrEmpty(ps.Name)) { + Log.Gen.warn( + $"Failed to instantiate ViewPublisher. Null/empty 'name': {JsonSerializer.Serialize(ps)}"); + return null; + } + var vs = buildStream(ps.Expression); + if (vs is null) { + Log.Gen.warn( + $"Failed to instantiate ViewPublisher. Invalid 'expression': {JsonSerializer.Serialize(ps)}"); + return null; + } + return vs; + } + + static ViewStream? buildStream(string? streamExpression) { + if (streamExpression is null) { + return null; + } + try { + Log.Gen.info($"Building ViewStream: {streamExpression}"); + var exp = DataStreamExpressionsInterpreter.Evaluate(streamExpression); + return exp.getView(new Dictionary(0)); + } catch (Exception ex) { + Log.assert(false, $"Could not build stream. expression: {streamExpression}; ex: {ex}"); + return null; + } + } +} diff --git a/src/DataStreamSuite/DataStreamPublisher/Services/DataStreamPublisherServices.cs b/src/DataStreamSuite/DataStreamPublisher/Services/DataStreamPublisherServices.cs new file mode 100644 index 000000000..a65913936 --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/Services/DataStreamPublisherServices.cs @@ -0,0 +1,10 @@ +namespace Bts.DataStreamPublisher.Services; + +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +public static class DataStreamPublisherServices { + public static IServiceCollection AddDataStreamPublisher(this IServiceCollection services, IConfiguration configurationSection) => + services.Configure(configurationSection) + .AddHostedService(); +} diff --git a/src/DataStreamSuite/DataStreamPublisher/appsettings.Development.json b/src/DataStreamSuite/DataStreamPublisher/appsettings.Development.json new file mode 100644 index 000000000..dd820fc8d --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/appsettings.Development.json @@ -0,0 +1,39 @@ +{ + "PubSub": { + "Routing": { + "PublisherRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://127.0.0.1:22019", + "TagRegExp": ".*" + } + ], + "SubscriberRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://127.0.0.1:22019", + "TagRegExp": ".*" + } + ] + } + }, + "DataStreamPublisher": { + "PublisherNodes": [ + { + "Name": "test_data", + "Streams": [ + { + "Name": "seconds_1_10", + "Expression": "milliseconds(1000,10)", + "IsOnWebsocket": true + }, + { + "Name": "test_literal", + "Expression": "literal(\"x\", \"420.0\")", + "IsOnWebsocket": true + } + ] + } + ] + } +} diff --git a/src/DataStreamSuite/DataStreamPublisher/appsettings.MarketData.json b/src/DataStreamSuite/DataStreamPublisher/appsettings.MarketData.json new file mode 100644 index 000000000..df9df695f --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/appsettings.MarketData.json @@ -0,0 +1,63 @@ +{ + "Spark": { + "ConfigServer": "http://sparkd:8000/config" + }, + "SparkApi": { + "Credentials": { + "User": "bts", + "Password": "" + }, + "EnableAdmin": true, + "EnableOrders": true, + "EnablePosition": true + }, + "DataStreamPublisher": { + "PublisherNodes": [ + { + "Name": "market_data", + "Streams": [ + { + "Name": "bbo", + "Expression": "bbo()", + "IsOnWebsocket": true + }, + { + "Name": "instruments", + "Expression": "instruments()", + "IsOnWebsocket": true + }, + { + "Name": "timesales", + "Expression": "timesales(10000)", + "IsOnWebsocket": true + }, + { + "Name": "books", + "Expression": "books()", + "IsOnWebsocket": true + } + ] + }, + { + "Name": "test_data", + "Streams": [ + { + "Name": "milliseconds_1000_100", + "Expression": "milliseconds(3000,5)", + "IsOnWebsocket": true + }, + { + "Name": "test_literal", + "Expression": "literal(\"x\", \"420.0\")", + "IsOnWebsocket": true + }, + { + "Name": "test_not_on_websocket", + "Expression": "literal(\"x\", \"840.0\")", + "IsOnWebsocket": false + } + ] + } + ] + } +} diff --git a/src/DataStreamSuite/DataStreamPublisher/appsettings.Production.json b/src/DataStreamSuite/DataStreamPublisher/appsettings.Production.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/appsettings.Production.json @@ -0,0 +1 @@ +{} diff --git a/src/DataStreamSuite/DataStreamPublisher/appsettings.ProductionAws.json b/src/DataStreamSuite/DataStreamPublisher/appsettings.ProductionAws.json new file mode 100644 index 000000000..d8a8c8c57 --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/appsettings.ProductionAws.json @@ -0,0 +1,91 @@ +{ + "Spark": { + "ConfigServer": "http://localhost:8000/config" + }, + "SparkApi": { + "Credentials": { + "User": "bts", + "Password": "" + }, + "EnableAdmin": true, + "EnableOrders": true, + "EnablePosition": true + }, + "PubSub": { + "Routing": { + "PublisherRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://172.30.2.181:22019", + "TagRegExp": ".*" + } + ], + "SubscriberRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://172.30.2.181:22019", + "TagRegExp": ".*" + } + ] + } + }, + "DataStreamPublisher": { + "PublisherNodes": [ + { + "Name": "market_data", + "Streams": [ + { + "Name": "bbo", + "Expression": "bbo()", + "IsOnWebsocket": true + }, + { + "Name": "instruments", + "Expression": "instruments()", + "IsOnWebsocket": true + }, + { + "Name": "timesales", + "Expression": "timesales(10000)", + "IsOnWebsocket": true + }, + { + "Name": "books", + "Expression": "books()", + "IsOnWebsocket": true + } + ] + }, + { + "Name": "test_data", + "Streams": [ + { + "Name": "seconds_1_10", + "Expression": "milliseconds(1000,10)", + "IsOnWebsocket": true + }, + { + "Name": "benzinga_news", + "Expression": "benzingaNews(\"mongodb://mongoadmin:bts@172.30.2.181:27017/?directConnection=true&serverSelectionTimeoutMS=2000&authSource=admin&appName=mongosh+2.2.12\" ,\"benzinga_news\",\"news_headlines\", \"30s\", \"5d\")", + "IsOnWebsocket": true + }, + { + "Name": "benzinga_news_symbols", + "Expression": "benzingaNewsSymbols(benzinga_news)", + "IsOnWebsocket": true + }, + { + "Name": "benzinga_news_symbol_state", + "Expression": "benzingaNewsSymbolState(benzinga_news)", + "IsOnWebsocket": true + }, + { + "Name": "test_literal", + "Expression": "literal(\"x\", \"420.0\")", + "IsOnWebsocket": true + } + ] + } + ] + } +} diff --git a/src/DataStreamSuite/DataStreamPublisher/appsettings.ReplayMarketData.json b/src/DataStreamSuite/DataStreamPublisher/appsettings.ReplayMarketData.json new file mode 100644 index 000000000..f801b147b --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/appsettings.ReplayMarketData.json @@ -0,0 +1,49 @@ +{ + "Spark": { + "ConfigServer": "http://sparkd:8000/config" + }, + "SparkApi": { + "IsEnabled": true, + "EnableOrders": false, + "EnablePositions": false, + "EnableMarketData": false, + "EnableAdmin": false, + "Credentials": { + "User": "bts", + "Password": "" + } + }, + "DatabentoMarketDataReplayer": { + "IsEnabled": true, + "BeginTime": "2025/07/01 09:30:00", + "EndTime": "2025/07/01 10:00:00", + "SecurityGroups": [ + { + "Venue": "Glbx", + "Asset": "ES", + "SecurityType": "Future" + } + ] + }, + "DataStreamPublisher": { + "PublisherNodes": [ + { + "Name": "MarketData", + "Streams": [ + { + "Name": "bbo", + "Expression": "bbo()" + }, + { + "Name": "instruments", + "Expression": "instruments()" + }, + { + "Name": "trades", + "Expression": "trades()" + } + ] + } + ] + } +} diff --git a/src/DataStreamSuite/DataStreamPublisher/appsettings.Staging.json b/src/DataStreamSuite/DataStreamPublisher/appsettings.Staging.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/appsettings.Staging.json @@ -0,0 +1 @@ +{} diff --git a/src/DataStreamSuite/DataStreamPublisher/appsettings.json b/src/DataStreamSuite/DataStreamPublisher/appsettings.json new file mode 100644 index 000000000..ec5c5cc1e --- /dev/null +++ b/src/DataStreamSuite/DataStreamPublisher/appsettings.json @@ -0,0 +1,124 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "Spark": {}, + "MasterWorker": { + "Interval": "00:00:00.1" + }, + "ViewStreamDatabase": { + "Interval": "00:00:00.1" + }, + "PrimitiveStream": { + "Assemblies": [ + "DataStream.dll", + "SharedStreams.dll" + ], + "ExcludedTypes": [ + "SettlementPriceStream", + "OHLCVStream" + ] + }, + "PubSub": { + "MillisecondsBetweenSubInfoUpdates": 1000, + "MillisecondsBetweenTimeSliceUpdates": 5000, + "MillisecondsBetweenNoBufferSpaceRetries": 100, + "RetriesOnNoBufferSpace": 1, + "DoItAllSecondsBetweenLogs": 0, + "HeartbeatInterval": 15000, + "MissingHeartbeatsBeforeGc": 50, + "UseManagedSockets": true, + "StateUpdatePeriod": 5000, + "StatisticsUpdatePeriod": 5000, + "DisposedConnectionCheckPeriod": 1000, + "ServerPort": 22019, + "Routing": { + "PublisherRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://pubsub:22019", + "TagRegExp": ".*" + } + ], + "SubscriberRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://pubsub:22019", + "TagRegExp": ".*" + } + ] + }, + "MaxPacketSize": 500000000, + "BlueCommMustDie": true, + "CrushableTags": [], + "TagTypeToAssemblyMap": { + "Entries": [ + { + "HandlerClass": "BCG.PubSubServerTagHandler", + "Assembly": "DataStreamCore.dll" + } + ] + }, + "TagHandlerFactory": { + "Handlers": [ + { + "TagType": "DataStream", + "Assembly": "DataStreamCore", + "Class": "bts.PubsubServerStreamTagHandler" + }, + { + "TagType": "System_Sub", + "Assembly": "PubSub", + "Class": "BCG.SystemSubscriptionMapPublisher" + }, + { + "TagType": "System_Stats", + "Assembly": "PubSub", + "Class": "BCG.SystemStatsPublisher" + }, + { + "TagType": ".*", + "Assembly": "DataStreamCore", + "Class": "bts.PubsubServerGenericDataHandler" + } + ] + }, + "ServerQueue": "PubSubQueue", + "PortRange": { + "First": 30400, + "Last": 31700 + }, + "BindToRandomPort": false, + "DebugTags": "^NOTAGS$", + "LatencyReportThresholdMs": 1500, + "UseSubstations": false, + "UseDynamicClients": false, + "IsSubstation": false, + "InternallyPublishSubInfo": true, + "UseManagedClientsInNativeCode": false, + "CompressedTags": "^NOTAGS$", + "TagsToReportCompressionRatio": "^NOTAGS$", + "DisableMsmq": false, + "UsePrepublishedServerState": false, + "IpTranslation": null, + "GcActivationThreshold": 0, + "WaitPeriodAfterGc": 1000 + }, + "DataStreamPublisher": { + "PublisherNodes": [ + { + "Name": "test_data", + "Streams": [ + { + "Name": "test_literal", + "Expression": "literal(\"test_literal\", \"x/Double\", \"420.0\")", + "IsOnWebsocket": true + } + ] + } + ] + } +} diff --git a/src/DataStreamSuite/DataStreamQueryAnalyzer/Configurations/DataStreamQueryAnalyzer.json b/src/DataStreamSuite/DataStreamQueryAnalyzer/Configurations/DataStreamQueryAnalyzer.json index 0dae5e74a..94c12c3a8 100644 --- a/src/DataStreamSuite/DataStreamQueryAnalyzer/Configurations/DataStreamQueryAnalyzer.json +++ b/src/DataStreamSuite/DataStreamQueryAnalyzer/Configurations/DataStreamQueryAnalyzer.json @@ -1,62 +1,106 @@ { - "user": "bts", - "sparkd": "http://127.0.0.1:8000/config", - "pubsub": { - "milliseconds_between_sub_info_updates": 1000, - "milliseconds_between_time_slice_updates": 5000, - "milliseconds_between_no_buffer_space_retries": 100, - "retries_on_no_buffer_space": 1, - "do_it_all_seconds_between_logs": 0, - "heartbeat_interval": 15000, - "missing_heartbeats_before_gc": 50, - "use_managed_sockets": true, - "state_update_period": 5000, - "statistics_update_period": 5000, - "disposed_connection_check_period": 1000, - "message_processing_warning_threshold": 1000, - "server_port": 12345, - "publisher_routes": [ - { - "name": "default", - "server_address": "bts-cloud://127.0.0.1:12345", - "tag": ".*" - } - ], - "subscriber_routes": [ - { - "name": "default", - "server_address": "bts-cloud://127.0.0.1:12345", - "tag": ".*" - } - ], - "max_packet_size": 500000000, - "blue_comm_must_die": true, - "crushable_tags": [], - "tag_type_to_assembly_map": [ - { - "handler_class": "BCG.PubSubServerTagHandler", - "assembly": "DataStreamCore.dll" - } - ], - "server_queue": "PubSubQueue", - "port_range": { - "first": 30400, - "last": 31700 + "MasterWorker": { + "Interval": "00:00:00.1" + }, + "ViewStreamDatabase": { + "Interval": "00:00:00.1" + }, + "Spark": { + "ConfigServer": "http://127.0.0.1:8000/config" + }, + "SparkApi": { + "Credentials": { + "User": "bts", + "Password": "" }, - "bind_to_random_port": false, - "debug_tags": "^NOTAGS$", - "latency_report_threshold_ms": 1500, - "use_substations": false, - "use_dynamic_clients": false, - "is_substation": false, - "internally_publish_sub_info": true, - "use_managed_clients_in_native_code": false, - "compressed_tags": "^NOTAGS$", - "tags_to_report_compression_ratio": "^NOTAGS$", - "disable_msmq": false, - "use_prepublished_server_state": false, - "ip_translation": null, - "gc_activation_threshold": 0, - "wait_period_after_gc": 1000 + "EnableAdmin": true, + "EnableOrders": true, + "EnablePosition": true + }, + "PubSub": { + "MillisecondsBetweenSubInfoUpdates": 1000, + "MillisecondsBetweenTimeSliceUpdates": 5000, + "MillisecondsBetweenNoBufferSpaceRetries": 100, + "RetriesOnNoBufferSpace": 1, + "DoItAllSecondsBetweenLogs": 0, + "HeartbeatInterval": 15000, + "MissingHeartbeatsBeforeGc": 50, + "UseManagedSockets": true, + "StateUpdatePeriod": 5000, + "StatisticsUpdatePeriod": 5000, + "DisposedConnectionCheckPeriod": 1000, + "MessageProcessingWarningThreshold": 1000, + "ServerPort": 12345, + "Routing": { + "PublisherRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://127.0.0.1:12345", + "TagRegExp": ".*" + } + ], + "SubscriberRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://127.0.0.1:12345", + "TagRegExp": ".*" + } + ] + }, + "MaxPacketSize": 500000000, + "BlueCommMustDie": true, + "CrushableTags": [], + "TagTypeToAssemblyMap": { + "Entries": [ + { + "HandlerClass": "BCG.PubSubServerTagHandler", + "Assembly": "DataStreamCore.dll" + } + ] + }, + "ServerQueue": "PubSubQueue", + "PortRange": { + "First": 30400, + "Last": 31700 + }, + "BindToRandomPort": false, + "DebugTags": "^NOTAGS$", + "LatencyReportThresholdMs": 1500, + "UseSubstations": false, + "UseDynamicClients": false, + "IsSubstation": false, + "InternallyPublishSubInfo": true, + "UseManagedClientsInNativeCode": false, + "CompressedTags": "^NOTAGS$", + "TagsToReportCompressionRatio": "^NOTAGS$", + "DisableMsmq": false, + "UsePrepublishedServerState": false, + "IpTranslation": null, + "GcActivationThreshold": 0, + "WaitPeriodAfterGc": 1000, + "TagHandlerFactory": { + "Handlers": [ + { + "TagType": "DataStream", + "Assembly": "DataStreamCore", + "Class": "bts.PubsubServerStreamTagHandler" + }, + { + "TagType": "System_Sub", + "Assembly": "PubSub", + "Class": "BCG.SystemSubscriptionMapPublisher" + }, + { + "TagType": "System_Stats", + "Assembly": "PubSub", + "Class": "BCG.SystemStatsPublisher" + }, + { + "TagType": ".*", + "Assembly": "DataStreamCore", + "Class": "bts.PubsubServerGenericDataHandler" + } + ] + } } } diff --git a/src/DataStreamSuite/DataStreamQueryAnalyzer/MainForm.cs b/src/DataStreamSuite/DataStreamQueryAnalyzer/MainForm.cs index 019e8de7a..ae227430f 100644 --- a/src/DataStreamSuite/DataStreamQueryAnalyzer/MainForm.cs +++ b/src/DataStreamSuite/DataStreamQueryAnalyzer/MainForm.cs @@ -1,29 +1,17 @@ using bts; -using bts.utils; -using mbts.config; -using mbts.spark; +using Bts.DataStreamExpressions; +using Bts.PubSub; using System; -using System.Drawing; -using System.Collections; using System.Collections.Generic; +using System.Collections; using System.ComponentModel; -using System.Windows.Forms; -using System.Text.RegularExpressions; -using System.IO; using System.Diagnostics; - -using BCG.Utilities; -// using BCG.Utilities.BlueConfiguration; -using BCG.Utilities.General; -using Spark.DataStream; -using Bts.DataStreamExpressions; -// using BCG.Evaluator.DataStreamExpression; -// using BCG.Utilities.Win32; -using System.Threading.Tasks; - - +using System.Drawing; +using System.IO; +using System.Text.RegularExpressions; +using System.Windows.Forms; namespace BCG { @@ -79,7 +67,7 @@ namespace BCG { // TODO: Port PublishedTagsStream from edge (then we can uncomment impl below) //ViewStream vs = new PubSubServerStateStream(); - ViewStream vs = new PubSubServerStateStream(); + ViewStream vs = new PubSubServerStateStream(new SubscriberCoreFactory(), ViewStreamDatabase.instance); return new FilterStream(vs, "tag~='DS_'"); //return new LiteralStream("tag/String", "DS_table1;DS_table2"); } @@ -589,7 +577,7 @@ namespace BCG myLoadAssemblies(); - ViewStreamDatabase.instance = new ViewStreamDatabase(); + // ViewStreamDatabase.instance = new ViewStreamDatabase(); myAllTagsStream = myGetAllTagsStream(); myAllTagsStream.onChange += new BCG.DataStream.ChangeDelegate(myHandleTableListChange); myTabControl.SelectedIndex = 3; @@ -614,7 +602,7 @@ namespace BCG // SitesCore.setMySiteName (mySite); - ViewStreamDatabase.instance = new ViewStreamDatabase(); + // ViewStreamDatabase.instance = new ViewStreamDatabase(); myAllTagsStream = myGetAllTagsStream(); myAllTagsStream.onChange += new BCG.DataStream.ChangeDelegate(myHandleTableListChange); diff --git a/src/DataStreamSuite/DataStreamSuite.sln b/src/DataStreamSuite/DataStreamSuite.sln index 5a6420d6b..fc1a17416 100644 --- a/src/DataStreamSuite/DataStreamSuite.sln +++ b/src/DataStreamSuite/DataStreamSuite.sln @@ -1,4 +1,5 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 @@ -36,88 +37,250 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.ColumnExpressions", "Bt EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.ColumnSortExpressions", "Bts.ColumnSortExpressions\Bts.ColumnSortExpressions.csproj", "{B038CB72-4E81-4AF1-976F-ED8655C2C3D6}" EndProject -/*Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamQueryAnalyzer", "DataStreamQueryAnalyzer\DataStreamQueryAnalyzer.csproj", "{BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}" -EndProject*/ +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamQueryAnalyzer", "DataStreamQueryAnalyzer\DataStreamQueryAnalyzer.csproj", "{BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Extensions.Hosting", "Bts.Extensions.Hosting\Bts.Extensions.Hosting.csproj", "{5C528A65-E43C-48A2-8CA9-ED2D0E356A37}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {049E6723-E859-4829-B9D9-4B47CEA3054D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {049E6723-E859-4829-B9D9-4B47CEA3054D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {049E6723-E859-4829-B9D9-4B47CEA3054D}.Debug|x64.ActiveCfg = Debug|Any CPU + {049E6723-E859-4829-B9D9-4B47CEA3054D}.Debug|x64.Build.0 = Debug|Any CPU + {049E6723-E859-4829-B9D9-4B47CEA3054D}.Debug|x86.ActiveCfg = Debug|Any CPU + {049E6723-E859-4829-B9D9-4B47CEA3054D}.Debug|x86.Build.0 = Debug|Any CPU {049E6723-E859-4829-B9D9-4B47CEA3054D}.Release|Any CPU.ActiveCfg = Release|Any CPU {049E6723-E859-4829-B9D9-4B47CEA3054D}.Release|Any CPU.Build.0 = Release|Any CPU + {049E6723-E859-4829-B9D9-4B47CEA3054D}.Release|x64.ActiveCfg = Release|Any CPU + {049E6723-E859-4829-B9D9-4B47CEA3054D}.Release|x64.Build.0 = Release|Any CPU + {049E6723-E859-4829-B9D9-4B47CEA3054D}.Release|x86.ActiveCfg = Release|Any CPU + {049E6723-E859-4829-B9D9-4B47CEA3054D}.Release|x86.Build.0 = Release|Any CPU {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Debug|x64.ActiveCfg = Debug|Any CPU + {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Debug|x64.Build.0 = Debug|Any CPU + {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Debug|x86.ActiveCfg = Debug|Any CPU + {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Debug|x86.Build.0 = Debug|Any CPU {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Release|Any CPU.ActiveCfg = Release|Any CPU {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Release|Any CPU.Build.0 = Release|Any CPU + {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Release|x64.ActiveCfg = Release|Any CPU + {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Release|x64.Build.0 = Release|Any CPU + {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Release|x86.ActiveCfg = Release|Any CPU + {CF444FFC-2A15-44AE-9DEA-9E0E412AB281}.Release|x86.Build.0 = Release|Any CPU {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Debug|x64.ActiveCfg = Debug|Any CPU + {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Debug|x64.Build.0 = Debug|Any CPU + {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Debug|x86.ActiveCfg = Debug|Any CPU + {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Debug|x86.Build.0 = Debug|Any CPU {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Release|Any CPU.ActiveCfg = Release|Any CPU {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Release|Any CPU.Build.0 = Release|Any CPU + {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Release|x64.ActiveCfg = Release|Any CPU + {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Release|x64.Build.0 = Release|Any CPU + {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Release|x86.ActiveCfg = Release|Any CPU + {4B5C4B20-6B37-48BD-A774-08932FA57E23}.Release|x86.Build.0 = Release|Any CPU {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Debug|x64.ActiveCfg = Debug|Any CPU + {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Debug|x64.Build.0 = Debug|Any CPU + {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Debug|x86.ActiveCfg = Debug|Any CPU + {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Debug|x86.Build.0 = Debug|Any CPU {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Release|Any CPU.ActiveCfg = Release|Any CPU {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Release|Any CPU.Build.0 = Release|Any CPU + {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Release|x64.ActiveCfg = Release|Any CPU + {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Release|x64.Build.0 = Release|Any CPU + {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Release|x86.ActiveCfg = Release|Any CPU + {9C45C299-14C5-4F8B-903F-49849D89D1DC}.Release|x86.Build.0 = Release|Any CPU {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Debug|x64.ActiveCfg = Debug|Any CPU + {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Debug|x64.Build.0 = Debug|Any CPU + {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Debug|x86.ActiveCfg = Debug|Any CPU + {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Debug|x86.Build.0 = Debug|Any CPU {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Release|Any CPU.ActiveCfg = Release|Any CPU {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Release|Any CPU.Build.0 = Release|Any CPU + {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Release|x64.ActiveCfg = Release|Any CPU + {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Release|x64.Build.0 = Release|Any CPU + {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Release|x86.ActiveCfg = Release|Any CPU + {0DBD814A-E17F-4836-8EEE-6E91B00C578F}.Release|x86.Build.0 = Release|Any CPU {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Debug|x64.ActiveCfg = Debug|Any CPU + {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Debug|x64.Build.0 = Debug|Any CPU + {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Debug|x86.ActiveCfg = Debug|Any CPU + {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Debug|x86.Build.0 = Debug|Any CPU {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Release|Any CPU.Build.0 = Release|Any CPU + {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Release|x64.ActiveCfg = Release|Any CPU + {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Release|x64.Build.0 = Release|Any CPU + {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Release|x86.ActiveCfg = Release|Any CPU + {EE53687E-BB62-45C6-A1B0-9B8F16B4E2C1}.Release|x86.Build.0 = Release|Any CPU {88E70136-91AE-4F56-B243-8F4642B46D6A}.Debug|Any CPU.ActiveCfg = Debug|x64 {88E70136-91AE-4F56-B243-8F4642B46D6A}.Debug|Any CPU.Build.0 = Debug|x64 + {88E70136-91AE-4F56-B243-8F4642B46D6A}.Debug|x64.ActiveCfg = Debug|Any CPU + {88E70136-91AE-4F56-B243-8F4642B46D6A}.Debug|x64.Build.0 = Debug|Any CPU + {88E70136-91AE-4F56-B243-8F4642B46D6A}.Debug|x86.ActiveCfg = Debug|Any CPU + {88E70136-91AE-4F56-B243-8F4642B46D6A}.Debug|x86.Build.0 = Debug|Any CPU {88E70136-91AE-4F56-B243-8F4642B46D6A}.Release|Any CPU.ActiveCfg = Release|x64 {88E70136-91AE-4F56-B243-8F4642B46D6A}.Release|Any CPU.Build.0 = Release|x64 + {88E70136-91AE-4F56-B243-8F4642B46D6A}.Release|x64.ActiveCfg = Release|Any CPU + {88E70136-91AE-4F56-B243-8F4642B46D6A}.Release|x64.Build.0 = Release|Any CPU + {88E70136-91AE-4F56-B243-8F4642B46D6A}.Release|x86.ActiveCfg = Release|Any CPU + {88E70136-91AE-4F56-B243-8F4642B46D6A}.Release|x86.Build.0 = Release|Any CPU {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Debug|Any CPU.ActiveCfg = Debug|x64 {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Debug|Any CPU.Build.0 = Debug|x64 + {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Debug|x64.ActiveCfg = Debug|Any CPU + {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Debug|x64.Build.0 = Debug|Any CPU + {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Debug|x86.ActiveCfg = Debug|Any CPU + {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Debug|x86.Build.0 = Debug|Any CPU {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Release|Any CPU.ActiveCfg = Release|x64 {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Release|Any CPU.Build.0 = Release|x64 - {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Release|Any CPU.Build.0 = Release|Any CPU + {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Release|x64.ActiveCfg = Release|Any CPU + {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Release|x64.Build.0 = Release|Any CPU + {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Release|x86.ActiveCfg = Release|Any CPU + {52DD33DB-00F5-44BF-AE0F-5FC58FB2277E}.Release|x86.Build.0 = Release|Any CPU {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Debug|x64.ActiveCfg = Debug|Any CPU + {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Debug|x64.Build.0 = Debug|Any CPU + {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Debug|x86.ActiveCfg = Debug|Any CPU + {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Debug|x86.Build.0 = Debug|Any CPU {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Release|Any CPU.ActiveCfg = Release|Any CPU {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Release|Any CPU.Build.0 = Release|Any CPU + {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Release|x64.ActiveCfg = Release|Any CPU + {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Release|x64.Build.0 = Release|Any CPU + {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Release|x86.ActiveCfg = Release|Any CPU + {A9EDEEBD-A03A-4281-8FAF-2419D3E7009C}.Release|x86.Build.0 = Release|Any CPU {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Debug|x64.ActiveCfg = Debug|Any CPU + {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Debug|x64.Build.0 = Debug|Any CPU + {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Debug|x86.ActiveCfg = Debug|Any CPU + {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Debug|x86.Build.0 = Debug|Any CPU {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Release|Any CPU.ActiveCfg = Release|Any CPU {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Release|Any CPU.Build.0 = Release|Any CPU + {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Release|x64.ActiveCfg = Release|Any CPU + {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Release|x64.Build.0 = Release|Any CPU + {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Release|x86.ActiveCfg = Release|Any CPU + {EFE6AD17-2564-43A1-B0E5-A2A8DA173002}.Release|x86.Build.0 = Release|Any CPU {D46A152D-AD29-4BEF-980B-5896694E312F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D46A152D-AD29-4BEF-980B-5896694E312F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D46A152D-AD29-4BEF-980B-5896694E312F}.Debug|x64.ActiveCfg = Debug|Any CPU + {D46A152D-AD29-4BEF-980B-5896694E312F}.Debug|x64.Build.0 = Debug|Any CPU + {D46A152D-AD29-4BEF-980B-5896694E312F}.Debug|x86.ActiveCfg = Debug|Any CPU + {D46A152D-AD29-4BEF-980B-5896694E312F}.Debug|x86.Build.0 = Debug|Any CPU {D46A152D-AD29-4BEF-980B-5896694E312F}.Release|Any CPU.ActiveCfg = Release|Any CPU {D46A152D-AD29-4BEF-980B-5896694E312F}.Release|Any CPU.Build.0 = Release|Any CPU + {D46A152D-AD29-4BEF-980B-5896694E312F}.Release|x64.ActiveCfg = Release|Any CPU + {D46A152D-AD29-4BEF-980B-5896694E312F}.Release|x64.Build.0 = Release|Any CPU + {D46A152D-AD29-4BEF-980B-5896694E312F}.Release|x86.ActiveCfg = Release|Any CPU + {D46A152D-AD29-4BEF-980B-5896694E312F}.Release|x86.Build.0 = Release|Any CPU {A844AB94-195B-4A7F-89CD-9A335985328E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A844AB94-195B-4A7F-89CD-9A335985328E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A844AB94-195B-4A7F-89CD-9A335985328E}.Debug|x64.ActiveCfg = Debug|Any CPU + {A844AB94-195B-4A7F-89CD-9A335985328E}.Debug|x64.Build.0 = Debug|Any CPU + {A844AB94-195B-4A7F-89CD-9A335985328E}.Debug|x86.ActiveCfg = Debug|Any CPU + {A844AB94-195B-4A7F-89CD-9A335985328E}.Debug|x86.Build.0 = Debug|Any CPU {A844AB94-195B-4A7F-89CD-9A335985328E}.Release|Any CPU.ActiveCfg = Release|Any CPU {A844AB94-195B-4A7F-89CD-9A335985328E}.Release|Any CPU.Build.0 = Release|Any CPU + {A844AB94-195B-4A7F-89CD-9A335985328E}.Release|x64.ActiveCfg = Release|Any CPU + {A844AB94-195B-4A7F-89CD-9A335985328E}.Release|x64.Build.0 = Release|Any CPU + {A844AB94-195B-4A7F-89CD-9A335985328E}.Release|x86.ActiveCfg = Release|Any CPU + {A844AB94-195B-4A7F-89CD-9A335985328E}.Release|x86.Build.0 = Release|Any CPU {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Debug|x64.ActiveCfg = Debug|Any CPU + {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Debug|x64.Build.0 = Debug|Any CPU + {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Debug|x86.ActiveCfg = Debug|Any CPU + {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Debug|x86.Build.0 = Debug|Any CPU {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Release|Any CPU.ActiveCfg = Release|Any CPU {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Release|Any CPU.Build.0 = Release|Any CPU + {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Release|x64.ActiveCfg = Release|Any CPU + {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Release|x64.Build.0 = Release|Any CPU + {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Release|x86.ActiveCfg = Release|Any CPU + {B94AB04B-76D0-4D37-8F2E-7A57A70D289F}.Release|x86.Build.0 = Release|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Debug|x64.ActiveCfg = Debug|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Debug|x64.Build.0 = Debug|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Debug|x86.ActiveCfg = Debug|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Debug|x86.Build.0 = Debug|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Release|Any CPU.Build.0 = Release|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Release|x64.ActiveCfg = Release|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Release|x64.Build.0 = Release|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Release|x86.ActiveCfg = Release|Any CPU + {66AB10D3-155F-4663-B1BC-D0818E17B87B}.Release|x86.Build.0 = Release|Any CPU {C1EBC423-4668-43D4-B7E5-A291086BA823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C1EBC423-4668-43D4-B7E5-A291086BA823}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1EBC423-4668-43D4-B7E5-A291086BA823}.Debug|x64.ActiveCfg = Debug|Any CPU + {C1EBC423-4668-43D4-B7E5-A291086BA823}.Debug|x64.Build.0 = Debug|Any CPU + {C1EBC423-4668-43D4-B7E5-A291086BA823}.Debug|x86.ActiveCfg = Debug|Any CPU + {C1EBC423-4668-43D4-B7E5-A291086BA823}.Debug|x86.Build.0 = Debug|Any CPU {C1EBC423-4668-43D4-B7E5-A291086BA823}.Release|Any CPU.ActiveCfg = Release|Any CPU {C1EBC423-4668-43D4-B7E5-A291086BA823}.Release|Any CPU.Build.0 = Release|Any CPU + {C1EBC423-4668-43D4-B7E5-A291086BA823}.Release|x64.ActiveCfg = Release|Any CPU + {C1EBC423-4668-43D4-B7E5-A291086BA823}.Release|x64.Build.0 = Release|Any CPU + {C1EBC423-4668-43D4-B7E5-A291086BA823}.Release|x86.ActiveCfg = Release|Any CPU + {C1EBC423-4668-43D4-B7E5-A291086BA823}.Release|x86.Build.0 = Release|Any CPU {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Debug|x64.ActiveCfg = Debug|Any CPU + {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Debug|x64.Build.0 = Debug|Any CPU + {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Debug|x86.ActiveCfg = Debug|Any CPU + {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Debug|x86.Build.0 = Debug|Any CPU {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Release|Any CPU.ActiveCfg = Release|Any CPU {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Release|Any CPU.Build.0 = Release|Any CPU + {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Release|x64.ActiveCfg = Release|Any CPU + {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Release|x64.Build.0 = Release|Any CPU + {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Release|x86.ActiveCfg = Release|Any CPU + {134C3915-CB2B-494C-BD62-E0B18250CBF5}.Release|x86.Build.0 = Release|Any CPU {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Debug|x64.ActiveCfg = Debug|Any CPU + {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Debug|x64.Build.0 = Debug|Any CPU + {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Debug|x86.ActiveCfg = Debug|Any CPU + {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Debug|x86.Build.0 = Debug|Any CPU {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Release|Any CPU.ActiveCfg = Release|Any CPU {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Release|Any CPU.Build.0 = Release|Any CPU + {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Release|x64.ActiveCfg = Release|Any CPU + {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Release|x64.Build.0 = Release|Any CPU + {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Release|x86.ActiveCfg = Release|Any CPU + {B038CB72-4E81-4AF1-976F-ED8655C2C3D6}.Release|x86.Build.0 = Release|Any CPU {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Debug|x64.ActiveCfg = Debug|Any CPU + {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Debug|x64.Build.0 = Debug|Any CPU + {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Debug|x86.ActiveCfg = Debug|Any CPU + {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Debug|x86.Build.0 = Debug|Any CPU {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Release|Any CPU.ActiveCfg = Release|Any CPU {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Release|Any CPU.Build.0 = Release|Any CPU + {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Release|x64.ActiveCfg = Release|Any CPU + {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Release|x64.Build.0 = Release|Any CPU + {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Release|x86.ActiveCfg = Release|Any CPU + {BFA5BA5C-927A-41A9-A696-1E2F4B5FFD15}.Release|x86.Build.0 = Release|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Debug|x64.ActiveCfg = Debug|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Debug|x64.Build.0 = Debug|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Debug|x86.ActiveCfg = Debug|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Debug|x86.Build.0 = Debug|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Release|Any CPU.Build.0 = Release|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Release|x64.ActiveCfg = Release|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Release|x64.Build.0 = Release|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Release|x86.ActiveCfg = Release|Any CPU + {5C528A65-E43C-48A2-8CA9-ED2D0E356A37}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal diff --git a/src/DataStreamSuite/PubSub/Client/IPubSubServerTagHandlerFactory.cs b/src/DataStreamSuite/PubSub/Client/IPubSubServerTagHandlerFactory.cs new file mode 100644 index 000000000..a50279455 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Client/IPubSubServerTagHandlerFactory.cs @@ -0,0 +1,7 @@ +namespace Bts.PubSub; + +using BCG; + +public interface IPubSubTagHandlerFactory { + IPubSubServerTagHandler? GetHandler(string tagType); +} diff --git a/src/DataStreamSuite/PubSub/Client/PubSubTagHandlerFactoryConfig.cs b/src/DataStreamSuite/PubSub/Client/PubSubTagHandlerFactoryConfig.cs new file mode 100644 index 000000000..511c7c8ce --- /dev/null +++ b/src/DataStreamSuite/PubSub/Client/PubSubTagHandlerFactoryConfig.cs @@ -0,0 +1,43 @@ +namespace Bts.PubSub; + +using BCG; + +using System.Collections.Generic; + +public class PubSubTagTypeHandlerConfig { + public string? TagType { get; set; } + public string? Assembly { get; set; } + public string? Class { get; set; } +} + +public class PubSubTagHandlerFactoryConfig { + public List? PluginDirs { get; set; } + public List? Handlers { get; set; } + + public static PubSubTagHandlerFactoryConfig Default() { + return new() { + Handlers = new() { + new() { + TagType = string.Empty, + Assembly = "DataStreamCore", + Class = "bts.PubsubServerStreamTagHandler", + }, + new() { + TagType = DSTagManager.DataStreamTagType, + Assembly = "DataStreamCore", + Class = "bts.PubsubServerStreamTagHandler", + }, + new() { + TagType = "System_Sub", + Assembly = "PubSub", + Class = "BCG.SystemSubscriptionMapPublisher", + }, + new() { + TagType = "System_Stats", + Assembly = "PubSub", + Class = "BCG.SystemStatsPublisher", + } + } + }; + } +} diff --git a/src/DataStreamSuite/PubSub/Client/PubsubTagHandlerFactory.cs b/src/DataStreamSuite/PubSub/Client/PubsubTagHandlerFactory.cs index 5da719b42..bcf6ea398 100644 --- a/src/DataStreamSuite/PubSub/Client/PubsubTagHandlerFactory.cs +++ b/src/DataStreamSuite/PubSub/Client/PubsubTagHandlerFactory.cs @@ -1,76 +1,132 @@ using System; -using System.Collections; using System.Reflection; -using BCG.Utilities; using System.Collections.Generic; using BCG; -using System.Runtime.InteropServices; using System.IO; - - +using System.Linq; +using Bts.PubSub; +using Microsoft.Extensions.Options; +using System.Text.RegularExpressions; +using System.Text.Json; +using Microsoft.Extensions.DependencyInjection; +using System.Diagnostics.CodeAnalysis; namespace bts { - public static class PubsubTagHandlerFactory { - // each tag type is represented by this - public class TagHandlerEntry { - public readonly string tag_type; - public readonly string assembly_name; - public readonly string handler_class_name; - public TagHandlerEntry(string tag_type_, string assembly_name_, string handler_class_name_) { - tag_type = tag_type_; - assembly_name = assembly_name_; - handler_class_name = handler_class_name_; - } + public class PubsubTagHandlerFactory : IPubSubTagHandlerFactory { + readonly List handlers; + readonly List? pluginDirs; + readonly IServiceProvider serviceProvider; + readonly PubSubTagHandlerFactoryConfig config; + + public PubsubTagHandlerFactory(IServiceProvider serviceProvider, IOptions config) + : this(serviceProvider, config.Value) { } + + public PubsubTagHandlerFactory(IServiceProvider serviceProvider, PubSubTagHandlerFactoryConfig config) { + this.serviceProvider = serviceProvider; + this.config = config; + Log.notnull(config.Handlers); + handlers = config.Handlers.Select(h => new TagTypeHandlerData(h)).ToList(); } - private static Dictionary _config_map = new Dictionary() - { - {String.Empty, new TagHandlerEntry(DSTagManager.DataStreamTagType , "DataStreamCore", "bts.PubsubServerStreamTagHandler")}, - {DSTagManager.DataStreamTagType, new TagHandlerEntry(DSTagManager.DataStreamTagType , "DataStreamCore", "bts.PubsubServerStreamTagHandler")}, - {"System_Sub", new TagHandlerEntry("System_Sub", "PubSub", "BCG.SystemSubscriptionMapPublisher")}, - {"System_Stats", new TagHandlerEntry("System_Stats", "PubSub", "BCG.SystemStatsPublisher")} + + public IPubSubServerTagHandler? GetHandler(string tag_type) { + if (_handler_map.TryGetValue(tag_type, out var handler)) { + return handler; + } + return get_handler(tag_type, true); + } + + private static PubSubTagTypeHandlerConfig _wildcard_handler = new() { + TagType = "*", + Assembly = "DataStreamCore", + Class = "bts.PubsubServerGenericDataHandler", }; - private static TagHandlerEntry _wildcard_handler = new TagHandlerEntry("*", "DataStreamCore", "bts.PubsubServerGenericDataHandler"); - private static Dictionary _handler_map = new Dictionary(); + private Dictionary _handler_map = new Dictionary(); - public static string assembly_location => Assembly.GetExecutingAssembly().Location; + public string assembly_location => Assembly.GetExecutingAssembly().Location; - public static IPubSubServerTagHandler get_handler(string tag_type) { - TagHandlerEntry handler_entry = _find_config_entry(tag_type); - Log.assert(handler_entry != null); - return _find_or_build_handler(handler_entry); + public BCG.IPubSubServerTagHandler get_handler(string tag_type, bool on_pubsub_server) { + var handler_entry = _find_config_entry(tag_type); + return _find_or_build_handler(handler_entry.Config); } - private static TagHandlerEntry _find_config_entry(string tag_type) { - TagHandlerEntry rv = null; - if (_config_map.TryGetValue(tag_type, out rv)) - return rv; - else - return _wildcard_handler; - } - - private static BCG.IPubSubServerTagHandler _find_or_build_handler(TagHandlerEntry entry) { - IPubSubServerTagHandler rv = null; - if (_handler_map.TryGetValue(entry.tag_type, out rv)) { - return rv; + private TagTypeHandlerData _find_config_entry(string tag_type) { + // Look for an exact match. + foreach (var handler in handlers) { + if (handler.TagType == tag_type) { + return handler; + } } - { + // If an exact match wasn't found, look for a regex match + foreach (var handler in handlers) { + if (handler.TagTypeRegex.IsMatch(tag_type)) { + return handler; + } + } + Log.assert(false); + throw new InvalidOperationException($"Failed to handler config for tag type '{tag_type}'"); + } + + private BCG.IPubSubServerTagHandler _find_or_build_handler(PubSubTagTypeHandlerConfig entry) { + ArgumentNullException.ThrowIfNull(entry.TagType); + lock (_handler_map) { + if (_handler_map.TryGetValue(entry.TagType, out var rv)) { + return rv; + } rv = _build_handler(entry); - _handler_map.Add(entry.tag_type, rv); + _handler_map.Add(entry.TagType, rv); + return rv; } - return rv; } - private static BCG.IPubSubServerTagHandler _build_handler(TagHandlerEntry entry) { + private BCG.IPubSubServerTagHandler _build_handler(PubSubTagTypeHandlerConfig entry) { + Log.notnull(entry.Assembly); + Log.notnull(entry.Class); var ass_loc = assembly_location; bts.Log.Gen.info($"PubsubTagHandlerFactory.load_handler entry: {entry} assembly_location: {ass_loc}"); - var assem = Assembly.LoadFrom(Path.ChangeExtension(entry.assembly_name, "dll")) + var assem = LoadAssembly(entry.Assembly) ?? throw new ArgumentException("Failed to instantiate TagHandlerEntry"); bts.Log.Gen.info($"PubsubTagHandlerFactory.load_handler successfully loaded assembly: {assem}"); - Type t = assem.GetType(entry.handler_class_name, true, true); - object obj = Activator.CreateInstance(t); - BCG.IPubSubServerTagHandler tag_handler = obj as BCG.IPubSubServerTagHandler; - bts.Log.Gen.info($"PubsubTagHandlerFactory.load_handler successfully created obj: {obj} of type: {t} from assem: {assem}"); + var t = assem.GetType(entry.Class, true, true); + Log.notnull(t); + var obj = ActivatorUtilities.GetServiceOrCreateInstance(serviceProvider, t); + var tag_handler = Log.notnull(obj as IPubSubServerTagHandler); + Log.Gen.info($"PubsubTagHandlerFactory created handler. {JsonSerializer.Serialize(entry)}"); return tag_handler; + + Assembly? LoadAssembly(string assembly) { + assembly = Path.ChangeExtension(assembly, "dll"); + if (TryLoad(assembly, out var ass)) { + return ass; + } + foreach (var dir in config.PluginDirs.empty_if_null().ExceptNull()) { + if (TryLoad(Path.Combine(dir, assembly), out ass)) { + return ass; + } + } + return null; + + static bool TryLoad(string assemblyPath, [NotNullWhen(true)]out Assembly? assembly) { + try { + assembly = Assembly.LoadFrom(assemblyPath); + return true; + } catch (FileNotFoundException) { } + assembly = null; + return false; + } + } + } + + readonly struct TagTypeHandlerData { + public TagTypeHandlerData(PubSubTagTypeHandlerConfig config) { + Config = config; + Log.notnull(config.TagType); + TagType = config.TagType; + TagTypeRegex = new(TagType); + } + + public PubSubTagTypeHandlerConfig Config { get; } + public string TagType { get; } + public Regex TagTypeRegex { get; } } } } diff --git a/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouter.cs b/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouter.cs index 0304c1411..f6d69702f 100644 --- a/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouter.cs +++ b/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouter.cs @@ -1,14 +1,15 @@ -using System; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; - -using BCG; -using Bts.PubSub; using bts; + +using Bts.PubSub; +using Bts.PubSub.Routing; + +using mbts.utils; + +using Microsoft.Extensions.Options; + +using System; +using System.Collections.Generic; using System.Linq; -//using BCG.Utilities; -//using bts; namespace BCG { public class PubSubRouter : IPubSubRouter { @@ -16,13 +17,15 @@ namespace BCG { private PubSubRoute[] _pub_routes; private PubSubRoute[] _sub_routes; - public PubSubRouter() : this( - PubSubConfig.Instance.SubscriberRoutes?.ToArray() - ?? throw new InvalidOperationException("Subscriber routes are not configured"), - PubSubConfig.Instance.PublisherRoutes?.ToArray() - ?? throw new InvalidOperationException("Publisher routes are not configured")) { } + public PubSubRouter() + : this(Log.notnull(PubSubConfig.Instance.Routing)) { } - public PubSubRouter(params PubSubRoute[] routes) : this(routes, routes) { } + public PubSubRouter(IOptions config) + : this(config.Value) { } + + public PubSubRouter(PubSubRouterConfig config) : this( + ExceptionAssert.Argument.NotNullOrEmpty(config.SubscriberRoutes?.ToArray()), + ExceptionAssert.Argument.NotNullOrEmpty(config.PublisherRoutes?.ToArray())) { } public PubSubRouter(PubSubRoute[] sub_routes, PubSubRoute[] pub_routes) { string log_msg = String.Empty; diff --git a/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouterConfig.cs b/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouterConfig.cs new file mode 100644 index 000000000..165279123 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Client/Routing/PubSubRouterConfig.cs @@ -0,0 +1,40 @@ +namespace Bts.PubSub.Routing; + +using BCG; + +using bts; + +using System.Collections.Generic; +using System.Linq; + +public class PubSubRouterConfig : ICloneable { + public List? PublisherRoutes { get; set; } + + public List? SubscriberRoutes { get; set; } + + public void MergeWith(PubSubRouterConfig other) { + PublisherRoutes = MergeRoutes(PublisherRoutes, other.PublisherRoutes); + SubscriberRoutes = MergeRoutes(SubscriberRoutes, other.SubscriberRoutes); + + List? MergeRoutes(List? routes, List? otherRoutes) { + if (otherRoutes is null) { + return routes; + } + if (routes is null) { + return otherRoutes; + } + foreach (var route in otherRoutes) { + if (!routes.Any(r => r.TagRegExp == route.TagRegExp || r.Name == route.Name)) { + routes.Add(route); + } + } + return routes; + } + } + + public PubSubRouterConfig Clone() => + new() { + PublisherRoutes = PublisherRoutes?.Select(r => r.Clone()).ToList(), + SubscriberRoutes = SubscriberRoutes?.Select(r => r.Clone()).ToList(), + }; +} diff --git a/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/IManagedSubscriber.cs b/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/IManagedSubscriber.cs new file mode 100644 index 000000000..e4c6870f9 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/IManagedSubscriber.cs @@ -0,0 +1,7 @@ +namespace Bts.PubSub; + +using System; + +public interface IManagedSubscriber { + void Subscribe(string tag, Action onData); +} diff --git a/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/ManagedSubscriber.cs b/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/ManagedSubscriber.cs index 56600213e..f4f032ee9 100644 --- a/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/ManagedSubscriber.cs +++ b/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/ManagedSubscriber.cs @@ -5,6 +5,7 @@ using System.Linq; using BCG.Utilities.General; +using Bts.PubSub; using OnData = System.Action; @@ -16,17 +17,17 @@ namespace BCG { /// Provides a callback based interface to the SubscriptionCore (this class is mainly here to allow backward compatibility /// with PubSub, as some clients are still using ManagedSubcribers) /// - public class ManagedSubscriber : IWorker, IDisposable { - private static ManagedSubscriber _self; - private SubscriberCore _subcore; + public class ManagedSubscriber : IManagedSubscriber, IWorker, IDisposable { + private static ManagedSubscriber? _self; + private ISubscriberCore _subcore; // private IDictionary myTypedDispatchTable = new Hashtable(), // myRawDispatchTable = new Hashtable(); private Dictionary> _dispatch_table = new Dictionary>(); + public ManagedSubscriber(ISubscriberCoreFactory subscriberCoreFactory) + : this(subscriberCoreFactory.Create()) { } - public ManagedSubscriber() : this(new SubscriberCore()) { } - - public ManagedSubscriber(SubscriberCore subsCore) { _subcore = subsCore; } + ManagedSubscriber(ISubscriberCore subsCore) { _subcore = subsCore; } public void doWork() { var msg_map = new Dictionary>(); @@ -82,6 +83,9 @@ namespace BCG { } } + void IManagedSubscriber.Subscribe(string tag, OnData onData) => + subscribe(tag, onData); + private void _fire_events(IEnumerable updates) { // TODO foreach (var u in updates) { @@ -100,9 +104,6 @@ namespace BCG { } } - public static ManagedSubscriber instance => - _self ??= new(); - #region IDisposable Members public void Dispose() { diff --git a/src/DataStreamSuite/PubSub/Config/PubSubConfig.cs b/src/DataStreamSuite/PubSub/Config/PubSubConfig.cs index c3ca57111..b87ed3c1e 100644 --- a/src/DataStreamSuite/PubSub/Config/PubSubConfig.cs +++ b/src/DataStreamSuite/PubSub/Config/PubSubConfig.cs @@ -4,9 +4,10 @@ using BCG; using bts; +using Bts.PubSub.Routing; + using System; using System.Collections.Generic; -using System.Text.Json.Serialization; public class PubSubConfig { static PubSubConfig? instance; @@ -21,79 +22,62 @@ public class PubSubConfig { instance = Log.notnull(cfg); } - [JsonPropertyName("server_port")] public short? ServerPort { get; set; } - [JsonPropertyName("simple_echo_server")] public bool? SimpleEchoServer { get; set; } // unused - [JsonPropertyName("milliseconds_between_sub_info_updates")] public int? MillisecondsBetweenSubInfoUpdates { get; set; } = 1000; // unused - [JsonPropertyName("milliseconds_between_time_slice_updates")] public int? MillisecondsBetweenTimeSliceUpdates { get; set; } = 5000; // unused - [JsonPropertyName("milliseconds_between_no_buffer_space_retries")] public int? MillisecondsBetweenNoBufferRetries { get; set; } = 100; // unused - [JsonPropertyName("retries_on_no_buffer_space")] public int? RetriesOnNoBufferSpace { get; set; } = 1; // unused - [JsonPropertyName("do_it_all_seconds_between_log")] public int? DoItAllSecondsBetweenLog { get; set; } = 0; // Used by the PubSubMessageReactor to pass to the ManagedTCPMessageHb (but unsed within it) - [JsonPropertyName("heartbeat_interval")] public int? HeartbeatInterval { get; set; } = 15000; - [JsonPropertyName("missing_heartbeats_before_gc")] public int? MissingHeartbeatsBeforeGc { get; set; } = 50; // unused // Milliseconds - [JsonPropertyName("state_update_period")] public int? StateUpdatePeriod { get; set; } = 5000; // unused // Milliseconds - [JsonPropertyName("statistics_update_period")] public int? StatisticsUpdatePeriod { get; set; } = 5000; // Milliseconds - [JsonPropertyName("disposed_connection_check_period")] public int? DisposedConnectionCheckPeriod { get; set; } = 1000; - [JsonPropertyName("tag_type_to_assembly_map")] public TagTypeToAssembly? TagTypeToAssemblyMap { get; set; } + public PubSubTagHandlerFactoryConfig? TagHandlerFactory { get; set; } + // unused - [JsonPropertyName("latency_report_threshold_ms")] public int? LatencyReportThresholdMs { get; set; } // unused - [JsonPropertyName("internally_publish_sub_info")] public bool? InternallyPublishSubInfo { get; set; } - [JsonPropertyName("compressed_tags")] public string? CompressedTags { get; set; } - [JsonPropertyName("gc_activation_threshold")] public int? GcActivationThreshold { get; set; } // Milliseconds - [JsonPropertyName("wait_period_after_gc")] public int? WaitPeriodAfterGc { get; set; } - [JsonPropertyName("publisher_routes")] - public List? PublisherRoutes { get; set; } + public PubSubRouterConfig? Routing { get; set; } - [JsonPropertyName("subscriber_routes")] - public List? SubscriberRoutes { get; set; } + public List? PublisherRoutes => Routing?.PublisherRoutes; + public List? SubscriberRoutes => Routing?.SubscriberRoutes; public static PubSubConfig Default() { const string NOTAGS = "^NOTAGS$"; @@ -110,17 +94,20 @@ public class PubSubConfig { DisposedConnectionCheckPeriod = 1000, ServerPort = 12345, TagTypeToAssemblyMap = new(), + TagHandlerFactory = PubSubTagHandlerFactoryConfig.Default(), LatencyReportThresholdMs = 1500, InternallyPublishSubInfo = true, CompressedTags = NOTAGS, GcActivationThreshold = 0, WaitPeriodAfterGc = 1000, SimpleEchoServer = false, - PublisherRoutes = new() { - new("bluto://127.0.0.1:12345", ".*") - }, - SubscriberRoutes = new() { - new("bluto://127.0.0.1:12345", ".*") + Routing = new() { + PublisherRoutes = new() { + new("bts-cloud://127.0.0.1:12345", ".*") + }, + SubscriberRoutes = new() { + new("bts-cloud://127.0.0.1:12345", ".*") + } } }; return rv; @@ -139,12 +126,20 @@ public class PubSubConfig { DisposedConnectionCheckPeriod ??= other.DisposedConnectionCheckPeriod; ServerPort ??= other.ServerPort; TagTypeToAssemblyMap ??= other.TagTypeToAssemblyMap; + TagHandlerFactory ??= other.TagHandlerFactory; LatencyReportThresholdMs ??= other.LatencyReportThresholdMs; InternallyPublishSubInfo ??= other.InternallyPublishSubInfo; CompressedTags ??= other.CompressedTags; GcActivationThreshold ??= other.GcActivationThreshold; WaitPeriodAfterGc ??= other.WaitPeriodAfterGc; SimpleEchoServer ??= other.SimpleEchoServer; + if (other.Routing is not null) { + if (Routing is null) { + Routing = other.Routing?.Clone(); + } else { + Routing.MergeWith(other.Routing); + } + } } } diff --git a/src/DataStreamSuite/PubSub/ISubscriberCoreFactory.cs b/src/DataStreamSuite/PubSub/ISubscriberCoreFactory.cs new file mode 100644 index 000000000..432b02313 --- /dev/null +++ b/src/DataStreamSuite/PubSub/ISubscriberCoreFactory.cs @@ -0,0 +1,21 @@ +namespace Bts.PubSub; + +using BCG; + +using System.Collections.Generic; +using System.Linq; + +public interface ISubscriberCoreFactory { + ISubscriberCore Create(); +} + +public static class SubscriberCoreFactoryExtensions { + public static ISubscriberCore Create(this ISubscriberCoreFactory factory, IEnumerable tags) => + Create(factory, tags.ToArray()); + + public static ISubscriberCore Create(this ISubscriberCoreFactory factory, params string[] tags) { + var subCore = factory.Create(); + subCore.subscribe(tags); + return subCore; + } +} diff --git a/src/DataStreamSuite/PubSub/Misc/CompositeWorker.cs b/src/DataStreamSuite/PubSub/Misc/CompositeWorker.cs new file mode 100644 index 000000000..dae20933e --- /dev/null +++ b/src/DataStreamSuite/PubSub/Misc/CompositeWorker.cs @@ -0,0 +1,18 @@ +namespace Bts.PubSub; + +using BCG.Utilities.General; + +using System.Collections.Generic; + +public class CompositeWorker : IWorker { + readonly List workers; + + public CompositeWorker(IEnumerable workers) => + this.workers = new(workers); + + public void doWork() { + foreach (var worker in workers) { + worker.doWork(); + } + } +} diff --git a/src/DataStreamSuite/PubSub/Misc/MasterWorker.cs b/src/DataStreamSuite/PubSub/Misc/MasterWorker.cs index 9f91a6f1e..6f19b0df5 100644 --- a/src/DataStreamSuite/PubSub/Misc/MasterWorker.cs +++ b/src/DataStreamSuite/PubSub/Misc/MasterWorker.cs @@ -2,6 +2,8 @@ using BCG.Utilities.General; using bts; +using Bts.PubSub; + using mbts; using System; @@ -9,7 +11,7 @@ using System.Collections.Generic; using System.Diagnostics; namespace BCG { - public class MasterWorker : IWorker { + public class MasterWorker : IWorker, IWorkScheduler { private DateTime myLastDoWorkTime = DateTime.MinValue, myLastLogTime = DateTime.MinValue; @@ -86,6 +88,12 @@ namespace BCG { } + void IWorkScheduler.Add(IWorker worker, TimeSpan interval) => + addWorker(worker, interval); + + void IWorkScheduler.Remove(IWorker worker) => + removeWorker(worker); + protected virtual void myLogEntries() { if (DateTime.UtcNow - myLastLogTime > myLogPeriod) { myLastLogTime = DateTime.UtcNow; diff --git a/src/DataStreamSuite/PubSub/Misc/WorkSchedulerExtensions.cs b/src/DataStreamSuite/PubSub/Misc/WorkSchedulerExtensions.cs index 7232356e4..1a30811b4 100644 --- a/src/DataStreamSuite/PubSub/Misc/WorkSchedulerExtensions.cs +++ b/src/DataStreamSuite/PubSub/Misc/WorkSchedulerExtensions.cs @@ -26,7 +26,13 @@ public static class WorkSchedulerExtensions { } } - public static IDisposable Subscribe(this IWorkScheduler scheduler, IWorker worker, TimeSpan? interval = null) { + public static IDisposable Subscribe(this IWorkScheduler scheduler, Action callback) => + Subscribe(scheduler, callback, null); + + public static IDisposable Subscribe(this IWorkScheduler scheduler, IWorker worker) => + Subscribe(scheduler, worker, null); + + public static IDisposable Subscribe(this IWorkScheduler scheduler, IWorker worker, TimeSpan? interval) { scheduler.Add(worker, interval ?? TimeSpan.Zero); return Disposable.Create(Dispose); void Dispose() => @@ -36,4 +42,3 @@ public static class WorkSchedulerExtensions { public static IDisposable Subscribe(this IWorkScheduler scheduler, Action work, TimeSpan? interval = null) => scheduler.Subscribe(new AnonymousWorker(work), interval); } - diff --git a/src/DataStreamSuite/PubSub/PublishedCache.cs b/src/DataStreamSuite/PubSub/PublishedCache.cs index 899396a02..c9d090bba 100644 --- a/src/DataStreamSuite/PubSub/PublishedCache.cs +++ b/src/DataStreamSuite/PubSub/PublishedCache.cs @@ -1,3 +1,5 @@ +using Bts.PubSub; + using System; using System.Collections.Generic; @@ -8,14 +10,19 @@ namespace bts { // PublisherCore calls get_content to get the data to re-publish, to // re-seed the PubSubServer public class PublishedCache { + readonly IPubSubTagHandlerFactory tagHandlerFactory; private Dictionary _data_map = new Dictionary(); + public PublishedCache(IPubSubTagHandlerFactory tagHandlerFactory) => + this.tagHandlerFactory = tagHandlerFactory; + public void publish(PublishMsg msg) { Log.Gen.info($"PublishedCache.publish msg: {msg}"); ArgumentException.ThrowIfNullOrEmpty(msg.tag); if (!_data_map.TryGetValue(msg.tag, out var tag_data)) { ArgumentException.ThrowIfNullOrEmpty(msg.tag_type); - tag_data = new SingleTagData(msg.tag, msg.tag_type); + var handler = Log.notnull(tagHandlerFactory.GetHandler(msg.tag_type)); + tag_data = new SingleTagData(msg.tag, msg.tag_type, handler); _data_map.Add(msg.tag, tag_data); } tag_data.handle_publish(msg); diff --git a/src/DataStreamSuite/PubSub/PublisherCore.cs b/src/DataStreamSuite/PubSub/PublisherCore.cs index 7e1b57b7a..c22ae260a 100644 --- a/src/DataStreamSuite/PubSub/PublisherCore.cs +++ b/src/DataStreamSuite/PubSub/PublisherCore.cs @@ -3,6 +3,8 @@ using System.IO; using System.Collections.Generic; using System.Threading; using bts; +using Bts.PubSub; +using Bts.PubSub.Services; namespace BCG { @@ -21,7 +23,7 @@ namespace BCG { // all the data published through this instance of PublisherCore // is kept there, in a form that can be used repopulate a pubsub server // in the event of a conection re-establishment to the PubSubServer - protected PublishedCache _state = new PublishedCache(); + protected PublishedCache _state; // every PubSubServer is communicated with a adifferent IPubSubServerConnection object. @@ -41,15 +43,12 @@ namespace BCG { #region constructors - public PublisherCore() - // TODOds - : this(new PubSubRouter()) { } - - public PublisherCore(string server_url) - : this(new PubSubRouter(new PubSubRoute(server_url, ".*"))) { } - - public PublisherCore(IPubSubRouter r) { - _router = r; + public PublisherCore(IPubSubRouter? router = null, IPubSubTagHandlerFactory? tagHandlerFactory = null, IServiceProvider? serviceProvider = null) { + router ??= new PubSubRouter(); + serviceProvider ??= PubSubServices.ServiceProvider; + tagHandlerFactory ??= new PubsubTagHandlerFactory(serviceProvider, PubSubTagHandlerFactoryConfig.Default()); + _router = router; + _state = new(tagHandlerFactory); Thread pump_thread = new Thread(new ThreadStart(_message_pump)); pump_thread.IsBackground = true; pump_thread.Start(); @@ -114,6 +113,10 @@ namespace BCG { #endregion + // static void setGlobalInstance() { + + // } + #region Message Pump Thread - this is where messages are dequeued and the action performed // all the state manahement happens here, the public interface methods merely enqueue the operation private void _message_pump() { diff --git a/src/DataStreamSuite/PubSub/Server/IInternalPublisher.cs b/src/DataStreamSuite/PubSub/Server/IInternalPublisher.cs new file mode 100644 index 000000000..bd0533eff --- /dev/null +++ b/src/DataStreamSuite/PubSub/Server/IInternalPublisher.cs @@ -0,0 +1,7 @@ +namespace Bts.PubSub.Server; + +using bts; + +interface IInternalPublisher { + void Publish(PublishMsg message); +} diff --git a/src/DataStreamSuite/PubSub/Server/IInternalPublisherQueue.cs b/src/DataStreamSuite/PubSub/Server/IInternalPublisherQueue.cs new file mode 100644 index 000000000..0d1ed8b8f --- /dev/null +++ b/src/DataStreamSuite/PubSub/Server/IInternalPublisherQueue.cs @@ -0,0 +1,16 @@ +namespace Bts.PubSub.Server; + +using bts; + +using System; +using System.Collections.Generic; + +/// +/// An instance of this interface is passed to the () so it can enqueue +/// messages to be published. It is also passed to the , so it +/// can dequeue these messages and send them over the wire. +/// +interface IInternalPublisherQueue { + void Enqueue(PublishMsg message); + List DequeueMultiple(TimeSpan ts, int maxElements); +} diff --git a/src/DataStreamSuite/PubSub/Server/IPubSubState.cs b/src/DataStreamSuite/PubSub/Server/IPubSubState.cs new file mode 100644 index 000000000..ecad176ec --- /dev/null +++ b/src/DataStreamSuite/PubSub/Server/IPubSubState.cs @@ -0,0 +1,33 @@ +namespace Bts.PubSub.Server; + +using BCG; + +using mbts; + +using System.Collections.Generic; + +public delegate void PubSubStateSingleTagChangeDelegate(PubSubSingleTagStateEvent theEvent); +public delegate void PubSubStateChangeDelegate(string[] tags); +public delegate void PubSubStatsDelegate(string tag, int size); + +public interface IPubSubState { + event PubSubStateChangeDelegate? onTagMapChanged; + event PubSubStatsDelegate? onPublishStats; + + ICollection all_tags { get; } + + byte[] get_content(string tag); + string getTagType(string tag); + void get_all_connections( + string tag, + out Dictionary subscribers, + out Dictionary activePublishers, + out ICollection> deadPublishers); + + ICollection get_subscriber_connections_for_tag(string tag); + + void remove_connection(string connection); + void update_pub_data(bts.PublishMsg pub_msg); + void handle_sub(bts.SubscribeMsg sub_msg); + void handle_unsub(bts.UnsubscribeMsg unsub_msg); +} diff --git a/src/DataStreamSuite/PubSub/Server/InternalPublisher.cs b/src/DataStreamSuite/PubSub/Server/InternalPublisher.cs new file mode 100644 index 000000000..04e7cd40c --- /dev/null +++ b/src/DataStreamSuite/PubSub/Server/InternalPublisher.cs @@ -0,0 +1,25 @@ +namespace Bts.PubSub.Server; + +using bts; + +using System.Threading; + +/// +/// A simple queue based implementation of . +/// +class InternalPublisher : IInternalPublisher { + static int instanceCounter = 0; + + readonly IInternalPublisherQueue queue; + + public InternalPublisher(IInternalPublisherQueue queue) { + Log.assert(Interlocked.Increment(ref instanceCounter) == 1); + this.queue = queue; + } + + public void Publish(PublishMsg message) { + Log.Gen.diag($"InternalPublisher.Publish message: {message}"); + Log.assert(!string.IsNullOrEmpty(message.tag)); + queue.Enqueue(message); + } +} diff --git a/src/DataStreamSuite/PubSub/Server/InternalPublisherQueue.cs b/src/DataStreamSuite/PubSub/Server/InternalPublisherQueue.cs new file mode 100644 index 000000000..16c8ccc42 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Server/InternalPublisherQueue.cs @@ -0,0 +1,27 @@ +namespace Bts.PubSub.Server; + +using BCG; + +using bts; + +using System; +using System.Collections.Generic; + +class InternalPublisherQueue : IInternalPublisherQueue { + readonly SyncQueue queue = new(); + readonly object lockObj = new(); + + public void Enqueue(PublishMsg message) { + Log.Gen.diag($"PubsubMessageReactor.internal_publish msg: {message}"); + Log.Gen.debug_assert(!string.IsNullOrEmpty(message.tag)); + lock (lockObj) { + queue.enqueue(message); + } + } + + public List DequeueMultiple(TimeSpan ts, int maxElements) { + lock (lockObj) { + return queue.dequeueMultipleElements(ts, maxElements); + } + } +} diff --git a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemHeartbeatPublisher.cs b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemHeartbeatPublisher.cs index 7867661c7..59d6b2401 100644 --- a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemHeartbeatPublisher.cs +++ b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemHeartbeatPublisher.cs @@ -4,6 +4,8 @@ using System.Text; using BCG.Utilities.General; using System.IO; using bts; +using Bts.PubSub; +using Bts.PubSub.Server; namespace BCG { class Pubsubheartbeat { @@ -32,27 +34,15 @@ namespace BCG { /// A subscriber can subscribe to it, and find out of a PubSub is alive or /// not. Infact more so, if the subsriptions are working or not. /// - internal class SystemHeartbeatPublisher : IWorker { + internal class SystemHeartbeatPublisher : IWorker, IParameterizedWorker { public static string tag_type = "System_Heartbeat"; public static string tag_name = "System_Heartbeat"; + readonly IInternalPublisher internalPublisher; - private static SystemHeartbeatPublisher? _self; + public SystemHeartbeatPublisher(IInternalPublisher internalPublisher) => + this.internalPublisher = internalPublisher; - private SystemHeartbeatPublisher() { - - ///this is using a multithreaded MasterWorker since the - ///regular one is called within the MessageReactor, which - ///waits 2500 msecs before calling doWork. This 2500 msecs - ///is only interceded by an external event (publication or - ///subscription) - MasterWorker.getInstance(true).addWorker(this, - TimeSpan.FromMilliseconds(500)); - } - - public static void init() { - if (_self == null) - _self = new SystemHeartbeatPublisher(); - } + TimeSpan IParameterizedWorker.Interval => TimeSpan.FromMilliseconds(500); #region IWorker Members @@ -67,7 +57,7 @@ namespace BCG { publish_time_epoch_ms = hb.hb_time_epoch, data_to_publish = hb.serialize() }; - PubSubMessageReactor.internal_publish(msg); + internalPublisher.Publish(msg); } #endregion diff --git a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemStatsPublisher.cs b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemStatsPublisher.cs index 0ab1037fa..f0fe3271a 100644 --- a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemStatsPublisher.cs +++ b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemStatsPublisher.cs @@ -4,6 +4,8 @@ using System.Text; using System.IO; using BCG.Utilities.General; using bts; +using Bts.PubSub; +using Bts.PubSub.Server; namespace BCG { /// @@ -13,31 +15,22 @@ namespace BCG { /// but returns the state in get_content (though it could have perhaps used update instead ofth spcialized event, onPublishStats) to /// keep track of publish sizes. /// - internal class SystemStatsPublisher : IPubSubServerTagHandler, IWorker { + internal class SystemStatsPublisher : IPubSubServerTagHandler, IParameterizedWorker { public static string tag_type = "System_Stats"; public static string tag_name = "System_AllStatistics"; // these tags have been touched, need to publish in the next doWork private HashSet _dirty_tags = new HashSet(); private Dictionary _tag_stats_map = new Dictionary(); - private MasterWorker _master_worker = MasterWorker.getInstance(false); - private static SystemStatsPublisher? _self; + readonly IInternalPublisher internalPublisher; - private SystemStatsPublisher(PubSubState state) { + public SystemStatsPublisher(IPubSubState state, IInternalPublisher internalPublisher) { bts.Log.Gen.info("SystemStatsPublisher constructed"); - state.onPublishStats += new PubSubState.PubSubStatsDelegate(_handle_publish); - _master_worker.addWorker(this, TimeSpan.FromMilliseconds(250)); + this.internalPublisher = internalPublisher; + state.onPublishStats += _handle_publish; } public string TagType => tag_type; - - public static void init(PubSubState state) { - bts.Log.Gen.info("SystemStatsPublisher.init"); - _self = new SystemStatsPublisher(state); - } - - public static IPubSubServerTagHandler? get_instance() { - return _self; - } + TimeSpan IParameterizedWorker.Interval => TimeSpan.FromMilliseconds(250); void _handle_publish(string tag, int size) { bts.Log.Gen.info($"SystemStatsPublisher._handle_publish tag: {tag} size: {size}"); @@ -72,7 +65,7 @@ namespace BCG { publish_time_epoch_ms = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), data_to_publish = bytes }; - PubSubMessageReactor.internal_publish(pub_msg); + internalPublisher.Publish(pub_msg); } } diff --git a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemSubscriptionMapPublisher.cs b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemSubscriptionMapPublisher.cs index f6fd76c52..e264ea7a8 100644 --- a/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemSubscriptionMapPublisher.cs +++ b/src/DataStreamSuite/PubSub/Server/InternalTagHandling/SystemSubscriptionMapPublisher.cs @@ -7,6 +7,8 @@ using System.Threading; using mbts; using System.Threading.Tasks; using bts; +using Bts.PubSub; +using Bts.PubSub.Server; namespace BCG { /// @@ -20,32 +22,25 @@ namespace BCG { /// It does not have much state except for the dirty state. It builds the state to publish /// as well as return in get_content, from calling into PububState /// - class SystemSubscriptionMapPublisher : IPubSubServerTagHandler, IWorker { - private PubSubState _state; + class SystemSubscriptionMapPublisher : IPubSubServerTagHandler, IParameterizedWorker { + private IPubSubState _state; private HashSet _dirty_tags = new HashSet(); private readonly string _ip = SysInfoManager.getIP(); public static string tag_type = "System_Sub"; public static string tag_name = "System_AllSubscriptions"; - private MasterWorker _master_worker = MasterWorker.getInstance(false); - private static IPubSubServerTagHandler _self; + private static SystemSubscriptionMapPublisher _self; + readonly IInternalPublisher internalPublisher; - private SystemSubscriptionMapPublisher(PubSubState state) { + public SystemSubscriptionMapPublisher(IPubSubState state, IInternalPublisher internalPublisher) { bts.Log.Gen.info("SystemSubscriptionMapPublisher.constructor"); + this.internalPublisher = internalPublisher; _state = state; - _state.onTagMapChanged += new PubSubState.PubSubStateChangeDelegate(_on_tag_state_changes); - _master_worker.addWorker(this, TimeSpan.FromMilliseconds(500)); + _state.onTagMapChanged += _on_tag_state_changes; } public string TagType => tag_type; - public static void init(PubSubState state) { - bts.Log.Gen.info("SystemSubscriptionMapPublisher.init"); - _self = new SystemSubscriptionMapPublisher(state); - } - - public static IPubSubServerTagHandler getInstance() { - return _self; - } + public TimeSpan Interval => TimeSpan.FromMilliseconds(500); private void _on_tag_state_changes(string[] tags) { Func tags_to_string = () => { @@ -81,7 +76,7 @@ namespace BCG { is_compressed = false, data_to_publish = ser_bytes }; - PubSubMessageReactor.internal_publish(pub_msg); + internalPublisher.Publish(pub_msg); } } diff --git a/src/DataStreamSuite/PubSub/Server/PubSubMessageReactor.cs b/src/DataStreamSuite/PubSub/Server/PubSubMessageReactor.cs index a043649ae..58ecbbde2 100644 --- a/src/DataStreamSuite/PubSub/Server/PubSubMessageReactor.cs +++ b/src/DataStreamSuite/PubSub/Server/PubSubMessageReactor.cs @@ -9,34 +9,47 @@ using Bts.PubSub; using Spark.Core; using System.Text; using System.Diagnostics; +using Bts.PubSub.Server; +using Microsoft.Extensions.Options; +using Microsoft.Extensions.Hosting; +using System.Threading.Tasks; namespace BCG { // This is the main PubSub Server class where it all starts (called by Program.cs). Its constructed and start is called and thats it. // The only outward facing members of this class is start // It has an IPubsubMessageHub, that it gets messages from, and updates the PubSubState (which really is all the pubsub server state) - public class PubSubMessageReactor { + class PubSubMessageReactor : IHostedService { private IPubsubMessageHub _msg_hub; // private delegate void MyMsgHandler(string sender, Stream msg, MetaData m); // private Dictionary myOperationToHandler = new Dictionary(); private Thread _msg_polling_thread; // all the data,list of subscribers etc are in the state - private PubSubState _state = new PubSubState(); - private MasterWorker _mainloop_master_worker = MasterWorker.getInstance(false); - private static SyncQueue _internal_pub_queue = new SyncQueue(); + private IPubSubState _state; + private IInternalPublisherQueue _internal_pub_queue; private Stopwatch _stop_watch = new Stopwatch(); + TaskCompletionSource? executionTask; + CancellationTokenSource? executionCts; - public PubSubMessageReactor(int port_no) { + public PubSubMessageReactor(IPubSubState state, IInternalPublisherQueue internalPublisherQueue, IOptions config) + : this(state, internalPublisherQueue, config.Value) { } + + public PubSubMessageReactor(IPubSubState state, IInternalPublisherQueue internalPublisherQueue, PubSubConfig config) + : this( + state, + internalPublisherQueue, + config.ServerPort.assert_value(), + TimeSpan.FromMilliseconds(config.HeartbeatInterval.assert_value()), + config.MissingHeartbeatsBeforeGc.assert_value(), + TimeSpan.FromMilliseconds(config.DisposedConnectionCheckPeriod.assert_value())) { } + + public PubSubMessageReactor(IPubSubState state, IInternalPublisherQueue internalPublisherQueue, int port, TimeSpan heartbeatInterval, int maxMissedHeartbeats, TimeSpan collectDisposedConnectionsInterval) { bts.Log.Gen.info("PubSubMessageReactor.cons System Initialized"); + _state = state; + _internal_pub_queue = internalPublisherQueue; _msg_polling_thread = new Thread(new ThreadStart(_polling_thread_func)); _msg_polling_thread.Priority = ThreadPriority.AboveNormal; - // TODO, fix it - //var port_no = 12345; - _msg_hub = new ManagedTCPMessageHub( - port_no, - TimeSpan.FromMilliseconds(PubSubConfig.Instance.HeartbeatInterval.assert_value()), - PubSubConfig.Instance.MissingHeartbeatsBeforeGc.assert_value(), - TimeSpan.FromMilliseconds(PubSubConfig.Instance.DisposedConnectionCheckPeriod.assert_value())); + _msg_hub = new ManagedTCPMessageHub(port, heartbeatInterval, maxMissedHeartbeats, collectDisposedConnectionsInterval); // this is the only event this class gets from hub _msg_hub.register_connection_callback(new PubSubCallbacks.PubSubServerConnectionStatusChange(_handle_client_connection)); @@ -52,8 +65,21 @@ namespace BCG { _state.remove_connection(client); } - public void start() { + public Task StartAsync(CancellationToken cancellationToken) { + if (cancellationToken.IsCancellationRequested) { + return Task.FromCanceled(cancellationToken); + } + executionCts = new(); _msg_polling_thread.Start(); + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken) { + if (cancellationToken.IsCancellationRequested) { + return Task.FromCanceled(cancellationToken); + } + executionCts?.Cancel(); + return executionTask?.Task ?? Task.CompletedTask; } /// @@ -67,7 +93,7 @@ namespace BCG { _msg_hub.activate(); Action handle_internal_pubs = () => { Log.Gen.info($"PubSubMessageReactor._polling_thread_func handle_internal_pubs"); - var internal_pubs = _internal_pub_queue.dequeueMultipleElements(TimeSpan.FromSeconds(1), 64000); + var internal_pubs = _internal_pub_queue.DequeueMultiple(TimeSpan.FromSeconds(1), 64000); //Log.Gen.info($"PubSubMessageReactor._polling_thread_func internal_pubs count: {internal_pubs.Count}"); foreach (var msg in internal_pubs) { try { @@ -78,7 +104,7 @@ namespace BCG { } }; - while (true) { + while (executionCts is null || !executionCts.IsCancellationRequested) { try { //bts.Log.Gen.info($"PubSubMessageReactor._polling_thread_func pre get_updates"); var received_data = _msg_hub.get_all_updates(); @@ -95,7 +121,6 @@ namespace BCG { _handle_client_msg(kv.first, kv.second); } handle_internal_pubs(); - _mainloop_master_worker.doWork(); } catch (Exception ex) { bts.Log.Gen.error($"PubSubMessageReactor._polling_thread_func ex: {ex}"); if (ex is OutOfMemoryException) { @@ -211,11 +236,5 @@ namespace BCG { // TODO: check ubnsub_msg.connection _state.handle_unsub(ubnsub_msg); } - - public static void internal_publish(PublishMsg msg) { - bts.Log.Gen.diag($"PubsubMessageReactor.internal_publish msg: {msg}"); - bts.Log.Gen.debug_assert(!String.IsNullOrEmpty(msg.tag)); - _internal_pub_queue.enqueue(msg); - } } } diff --git a/src/DataStreamSuite/PubSub/Server/PubSubState.cs b/src/DataStreamSuite/PubSub/Server/PubSubState.cs index aa456c595..8ddc44ae1 100644 --- a/src/DataStreamSuite/PubSub/Server/PubSubState.cs +++ b/src/DataStreamSuite/PubSub/Server/PubSubState.cs @@ -10,6 +10,8 @@ using System.Linq.Expressions; using bts; using mbts.utils; using bts.collections; +using Bts.PubSub; +using Bts.PubSub.Server; namespace BCG { /// @@ -24,22 +26,18 @@ namespace BCG { /// are subsribing or publishing the tag) /// /// - public class PubSubState { + public class PubSubState : IPubSubState { - public delegate void PubSubStateSingleTagChangeDelegate(PubSubSingleTagStateEvent theEvent); private event PubSubStateSingleTagChangeDelegate? onSingleTagChange; - public delegate void PubSubStateChangeDelegate(string[] tags); public event PubSubStateChangeDelegate? onTagMapChanged; - public delegate void PubSubStatsDelegate(string tag, int size); public event PubSubStatsDelegate? onPublishStats; + readonly IPubSubTagHandlerFactory tagHandlerFactory; private Dictionary _tag_to_data_map = new Dictionary(); private Dictionary _tag_to_connection_map = new Dictionary(); - public PubSubState() { - SystemSubscriptionMapPublisher.init(this); - SystemStatsPublisher.init(this); - SystemHeartbeatPublisher.init(); + public PubSubState(IPubSubTagHandlerFactory tagHandlerFactory) { + this.tagHandlerFactory = tagHandlerFactory; } #region subscription based state changes @@ -112,7 +110,8 @@ namespace BCG { ///this is the only place where SingleTagData should be created if (!_tag_to_data_map.ContainsKey(pub_msg.tag)) { ///first time data is published for this tag - _tag_to_data_map.Add(pub_msg.tag, new SingleTagData(pub_msg.tag, pub_msg.tag_type)); + var handler = tagHandlerFactory.GetHandler(pub_msg.tag_type); + _tag_to_data_map.Add(pub_msg.tag, new SingleTagData(pub_msg.tag, pub_msg.tag_type, handler)); } _tag_to_data_map[pub_msg.tag].handle_publish(pub_msg); diff --git a/src/DataStreamSuite/PubSub/Server/SingleTagData.cs b/src/DataStreamSuite/PubSub/Server/SingleTagData.cs index 1d751c9c1..02f06636d 100644 --- a/src/DataStreamSuite/PubSub/Server/SingleTagData.cs +++ b/src/DataStreamSuite/PubSub/Server/SingleTagData.cs @@ -20,24 +20,15 @@ namespace bts { public class SingleTagData { private readonly IPubSubServerTagHandler? _tag_handler; - public SingleTagData(string tag, string tag_type) { + public SingleTagData(string tag, string tag_type, IPubSubServerTagHandler tag_handler) { bts.Log.Gen.info($"SingleTagData constructed for tag: {tag} tag_type: {tag_type}"); this.tag = tag; this.tag_type = tag_type; - _tag_handler = get_handler(tag_type); + _tag_handler = tag_handler; Log.notnull(_tag_handler); Log.Gen.info($"SingleTagData.cons tag: {tag} tag_type: {tag_type} _tag_handler: {_tag_handler}"); } - public IPubSubServerTagHandler? get_handler(string tag_type) { - if (tag_type == SystemSubscriptionMapPublisher.tag_type) - return SystemSubscriptionMapPublisher.getInstance(); - else if (tag_type == SystemStatsPublisher.tag_type) - return SystemStatsPublisher.get_instance(); - return PubsubTagHandlerFactory.get_handler(tag_type); - - } - public string tag { get; } public string tag_type { get; } @@ -66,16 +57,5 @@ namespace bts { Log.Gen.info($"SingleTagData.get_current_content tag: {tag} rv (n bytes): {rv.Length}"); return rv; } - - private void _on_handler_internal_publish(ICollection> cbItems) { - foreach (var p in cbItems) { - PublishMsg pub_msg = new PublishMsg() { - tag = p.first, - tag_type = p.second, - data_to_publish = p.third - }; - PubSubMessageReactor.internal_publish(pub_msg); - } - } } } diff --git a/src/DataStreamSuite/PubSub/Services/EchoServerConfig.cs b/src/DataStreamSuite/PubSub/Services/EchoServerConfig.cs new file mode 100644 index 000000000..e62e84ee3 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Services/EchoServerConfig.cs @@ -0,0 +1,6 @@ +namespace Bts.PubSub.Services; + +public class EchoServerConfig { + public bool Echo { get; set; } + public short Port { get; set; } +} diff --git a/src/DataStreamSuite/PubSub/Services/MasterWorkerService.cs b/src/DataStreamSuite/PubSub/Services/MasterWorkerService.cs new file mode 100644 index 000000000..f40958023 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Services/MasterWorkerService.cs @@ -0,0 +1,44 @@ +namespace Bts.PubSub.Services; + +using BCG; +using BCG.Utilities.General; + +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +/// +/// An that imports a collection of s and +/// calls each in a loop. +/// +public class MasterWorkerService : BackgroundService { + readonly IWorker masterWorker; + readonly WorkerServiceConfig config; + + public MasterWorkerService(MasterWorker masterWorker, IEnumerable workers, IOptions config) + : this(masterWorker, workers, config.Value) { } + + public MasterWorkerService(MasterWorker masterWorker, IEnumerable workers, WorkerServiceConfig config) { + this.masterWorker = masterWorker; + this.config = config; + foreach (var worker in workers) { + masterWorker.addWorker(worker, (worker as IParameterizedWorker)?.Interval ?? TimeSpan.Zero); + } + } + + protected override Task ExecuteAsync(CancellationToken cancellationToken) { + return Task.Factory.StartNew( + Execute, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Default); + + void Execute() { + while (!cancellationToken.IsCancellationRequested) { + masterWorker.doWork(); + Thread.Sleep(config.Interval); + } + } + } +} diff --git a/src/DataStreamSuite/PubSub/Services/PubSubEchoServer.cs b/src/DataStreamSuite/PubSub/Services/PubSubEchoServer.cs new file mode 100644 index 000000000..7bdac63cb --- /dev/null +++ b/src/DataStreamSuite/PubSub/Services/PubSubEchoServer.cs @@ -0,0 +1,51 @@ +namespace Bts.PubSub.Services; + +using BCG; + +using bts; + +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; + +using System; +using System.Threading; +using System.Threading.Tasks; + +public class PubSubEchoServer : BackgroundService { + readonly EchoServerConfig config; + + public PubSubEchoServer(IOptions config) + : this(config.Value) { } + + public PubSubEchoServer(EchoServerConfig config) { + this.config = config; + } + + protected override Task ExecuteAsync(CancellationToken cancellationToken) { + return Task.Factory.StartNew( + Run, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Default); + + void Run() { + if (cancellationToken.IsCancellationRequested) { + return; + } + string log_msg = $"Running as TCP Echo server, port: {config.Port} echo: {config.Echo} Hit enter to continue:"; + Console.WriteLine(log_msg); + Console.ReadLine(); + var ready_msg = $"ready to listen to port: {config.Port}"; + Log.Gen.info(ready_msg); + Console.WriteLine(ready_msg); + var sts = new SimpleTCPServer(config.Port, config.Echo); + sts.init(); + Console.CancelKeyPress += OnCancelKeyPress; + while (true) { + Thread.Sleep(TimeSpan.FromSeconds(3)); + } + + void OnCancelKeyPress(object? sender, ConsoleCancelEventArgs e) { + Log.Gen.error("Cancel key press. Disposing echo server"); + sts.Dispose(); + } + } + } +} diff --git a/src/DataStreamSuite/PubSub/Services/PubSubGarbageCollectorConfig.cs b/src/DataStreamSuite/PubSub/Services/PubSubGarbageCollectorConfig.cs new file mode 100644 index 000000000..bb847670b --- /dev/null +++ b/src/DataStreamSuite/PubSub/Services/PubSubGarbageCollectorConfig.cs @@ -0,0 +1,8 @@ +namespace Bts.PubSub.Services; + +using System; + +public class PubSubGarbageCollectorConfig { + public int? ActivationThreshold { get; set; } + public TimeSpan? Interval { get; set; } +} diff --git a/src/DataStreamSuite/PubSub/Services/PubSubGarbageCollectorService.cs b/src/DataStreamSuite/PubSub/Services/PubSubGarbageCollectorService.cs new file mode 100644 index 000000000..2a5df3806 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Services/PubSubGarbageCollectorService.cs @@ -0,0 +1,47 @@ +namespace Bts.PubSub.Services; + +using bts; + +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; + +using System; +using System.Threading; +using System.Threading.Tasks; + +class PubSubGarbageCollectorService : BackgroundService { + readonly PubSubGarbageCollectorConfig config; + + public PubSubGarbageCollectorService(IOptions config) + : this(config.Value) { } + + public PubSubGarbageCollectorService(PubSubGarbageCollectorConfig config) => + this.config = config; + + protected override Task ExecuteAsync(CancellationToken cancellationToken) { + cancellationToken.ThrowIfCancellationRequested(); + return Task.Factory.StartNew( + Execute, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Default); + + void Execute() { + long currentMemory = 0; + var defaultWaitTime = TimeSpan.FromMilliseconds(100); + bool gced = false; + Log.Gen.info("PubSubGarbageCollectorService STARTED"); + Log.Gen.info($"Starting PubSubGarbageCollectorService execution loop"); + while (!cancellationToken.IsCancellationRequested) { + gced = false; + currentMemory = GC.GetTotalMemory(false); + if (config.ActivationThreshold > 0 && currentMemory > config.ActivationThreshold) { + Console.WriteLine($"GCing memory, mem before GC = {currentMemory}"); + GC.Collect(); + gced = true; + } + Thread.Sleep(gced && config.Interval.HasValue + ? config.Interval.Value + : defaultWaitTime); + } + Log.Gen.info("PubSubGarbageCollectorService STOPPED"); + } + } +} diff --git a/src/DataStreamSuite/PubSub/Services/PubSubServices.cs b/src/DataStreamSuite/PubSub/Services/PubSubServices.cs new file mode 100644 index 000000000..910d3bdd4 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Services/PubSubServices.cs @@ -0,0 +1,153 @@ +namespace Bts.PubSub.Services; + +using BCG; +using BCG.Utilities.General; + +using bts; + +using Bts.PubSub.Routing; +using Bts.PubSub.Server; + +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +public static class PubSubServices { + // TODO: get rid of this static singleton. For now, we need it to support + // many classes that have historically relied on static singletons. Rather than + // accessing such instances via 'Foo.getInstance' or something like that, these + // classes should call "PubSubServices.ServiceProvider.GetRequiredService()" + static IServiceProvider? serviceProvider; + + public static IServiceProvider ServiceProvider => + Log.notnull( + serviceProvider, + $"Global ServiceProvider is null. Initialize it via '{nameof(PubSubServices)}.{nameof(AddGlobalServiceProvider)}'"); + + public static IServiceCollection AddGlobalServiceProvider(this IServiceCollection services) { + if (!services.Any(s => s.ServiceType == typeof(GlobalServiceProvider))) { + services.AddSingleton() + .AddHostedService(sp => sp.GetRequiredService()); + } + return services; + } + + public static IServiceCollection AddMasterWorker(this IServiceCollection services, IConfiguration configurationSection) => + services + .Configure(configurationSection) + .AddSingleton(sp => MasterWorker.getInstance(false)) + .AddSingleton(sp => sp.GetRequiredService()) + .AddHostedService(); + + public static IServiceCollection AddManagedSubscriber(this IServiceCollection services) => + services.AddSingleton() + .AddSingleton(sp => sp.GetRequiredService()) + .AddSingleton(sp => sp.GetRequiredService()); + + public static IServiceCollection AddHeartbeatPublisher(this IServiceCollection services) => + services.AddSingleton() + .AddSingleton(sp => sp.GetRequiredService()); + + public static IServiceCollection AddPublisherCore(this IServiceCollection services) => + services.AddSingleton(); + + public static IServiceCollection AddSubscriberCore(this IServiceCollection services) => + services.AddSingleton(); + + public static IServiceCollection AddPubSubState(this IServiceCollection services) => + services.AddSingleton(); + + public static IServiceCollection AddSubscriptionMapPublisher(this IServiceCollection services) => + services.AddSingleton() + .AddSingleton(sp => sp.GetRequiredService()) + .AddSingleton(sp => sp.GetRequiredService()); + + public static IServiceCollection AddSystemStatsPublisher(this IServiceCollection services) => + services.AddSingleton() + .AddSingleton(sp => sp.GetRequiredService()) + .AddSingleton(sp => sp.GetRequiredService()); + + public static IServiceCollection AddTagHandlerFactory(this IServiceCollection services, IConfiguration configurationSection) => + services.Configure(configurationSection) + .AddGlobalServiceProvider() + .AddSingleton(); + + public static IServiceCollection AddPubSubRouter(this IServiceCollection services, IConfiguration configurationSection) => + services.Configure(configurationSection) + .AddSingleton(); + + public static IServiceCollection AddPubSubMessageReactor(this IServiceCollection services) => + services.AddHostedService(); + + public static IServiceCollection AddPubSubServer(this IServiceCollection services, IConfiguration configurationSection) { + services.Configure(configurationSection); + PubSubConfig.SetGlobalConfig(configurationSection.Get() ?? PubSubConfig.Default()); + return services.AddGlobalServiceProvider() + .AddTagHandlerFactory(configurationSection.GetSection(nameof(PubSubConfig.TagHandlerFactory))) + .AddSystemStatsPublisher() + .AddHeartbeatPublisher() + .AddSubscriptionMapPublisher() + .AddPubSubState() + .AddInternalPublisher() + .AddPubSubMessageReactor(); + } + + public static IServiceCollection AddPubSubEchoServer(this IServiceCollection services, IConfiguration configurationSection) => + services.Configure(configurationSection) + .AddHostedService(); + + public static IServiceCollection AddGarbageCollector(this IServiceCollection services, IConfiguration configurationSection) => + services.Configure(configurationSection) + .AddHostedService(); + + internal static IServiceCollection AddInternalPublisher(this IServiceCollection services) => + services.AddSingleton() + .AddSingleton(); + + public static IServiceCollection AddPubSubClient(this IServiceCollection services, IConfiguration configurationSection) { + services.Configure(configurationSection); + PubSubConfig.SetGlobalConfig(configurationSection.Get() ?? PubSubConfig.Default()); + return services.AddGlobalServiceProvider() + .AddPubSubRouter(configurationSection.GetSection(nameof(PubSubConfig.Routing))) + .AddPublisherCore() + .AddSubscriberCore() + .AddManagedSubscriber(); + } + + internal static void SetGlobalServiceProvider(IServiceProvider serviceProvider) { + Log.isnull(PubSubServices.serviceProvider); + PubSubServices.serviceProvider = serviceProvider; + } + + class GlobalServiceProvider : IHostedService { + public GlobalServiceProvider(IServiceProvider serviceProvider) { + if (PubSubServices.serviceProvider is not null) { + Log.assert(serviceProvider == PubSubServices.serviceProvider); + return; + } + SetGlobalServiceProvider(serviceProvider); + } + + public Task StartAsync(CancellationToken cancellationToken) => + Task.CompletedTask; + + public Task StopAsync(CancellationToken cancellationToken) => + Task.CompletedTask; + } + + class AnonymousTagHandlerFactory : IPubSubTagHandlerFactory { + readonly Func getHandler; + + public AnonymousTagHandlerFactory(Func getHandler) { + this.getHandler = getHandler; + } + + public IPubSubServerTagHandler GetHandler(string tagType) => + getHandler(tagType); + } +} diff --git a/src/DataStreamSuite/PubSub/Services/WorkerConfig.cs b/src/DataStreamSuite/PubSub/Services/WorkerConfig.cs new file mode 100644 index 000000000..718141572 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Services/WorkerConfig.cs @@ -0,0 +1,7 @@ +namespace Bts.PubSub.Services; + +using System; + +public class WorkerConfig { + public TimeSpan Interval { get; set; } +} diff --git a/src/DataStreamSuite/PubSub/Services/WorkerServiceConfig.cs b/src/DataStreamSuite/PubSub/Services/WorkerServiceConfig.cs new file mode 100644 index 000000000..9e06bd494 --- /dev/null +++ b/src/DataStreamSuite/PubSub/Services/WorkerServiceConfig.cs @@ -0,0 +1,7 @@ +namespace Bts.PubSub.Services; + +using System; + +public class WorkerServiceConfig { + public TimeSpan Interval { get; set; } +} diff --git a/src/DataStreamSuite/PubSub/SubscriberCore.cs b/src/DataStreamSuite/PubSub/SubscriberCore.cs index eb102e03f..bd5b1daea 100644 --- a/src/DataStreamSuite/PubSub/SubscriberCore.cs +++ b/src/DataStreamSuite/PubSub/SubscriberCore.cs @@ -1,6 +1,7 @@ using bts; using Bts.PubSub; +using Bts.PubSub.Routing; using System; using System.Collections.Generic; @@ -26,20 +27,11 @@ namespace BCG { #region constructors - public SubscriberCore() { - //this defaults to a basic pubsubrouter if the config key is not filled out - _tag_router = new PubSubRouter(Log.notnull(PubSubConfig.Instance.SubscriberRoutes).ToArray()); - } - public SubscriberCore(string site_name) { - _tag_router = new PubSubRouter(PubSubConfig.Instance.SubscriberRoutesFor(site_name).ToArray()); - } + public SubscriberCore() + : this((string?)null) { } - private IPubSubRouter _get_router() => - new PubSubRouter(Log.notnull(PubSubConfig.Instance.SubscriberRoutes).ToArray()); - - public SubscriberCore(PubSubRoute[] routes) { - _tag_router = new PubSubRouter(routes); - } + public SubscriberCore(string? siteName) + : this(new PubSubRouter(routerConfig(siteName))) { } public SubscriberCore(IPubSubRouter router) { _tag_router = router; @@ -66,6 +58,18 @@ namespace BCG { } } + static PubSubRouterConfig routerConfig(string? siteName = null) { + var pubSubCfg = PubSubConfig.Instance; + if (siteName is null) { + return Log.notnull(pubSubCfg.Routing); + } + var routes = PubSubConfig.Instance.SubscriberRoutesFor(siteName); + return new() { + PublisherRoutes = routes, + SubscriberRoutes = routes, + }; + } + private ISingleServerSubscriberCore _find_subscribercore(RemoteConnectionInfo server_rci) { if (!_server_route_to_subcore_map.TryGetValue(server_rci, out var rv)) { rv = new SingleServerSubscriberCore(server_rci, _connection_factory); diff --git a/src/DataStreamSuite/PubSub/SubscriberCoreFactory.cs b/src/DataStreamSuite/PubSub/SubscriberCoreFactory.cs new file mode 100644 index 000000000..a8f3efc64 --- /dev/null +++ b/src/DataStreamSuite/PubSub/SubscriberCoreFactory.cs @@ -0,0 +1,16 @@ +namespace Bts.PubSub; + +using BCG; + +public class SubscriberCoreFactory : ISubscriberCoreFactory { + readonly IPubSubRouter router; + + public SubscriberCoreFactory() + : this(new PubSubRouter()) { } + + public SubscriberCoreFactory(IPubSubRouter router) => + this.router = router; + + public ISubscriberCore Create() => + new SubscriberCore(router); +} diff --git a/src/DataStreamSuite/PubSub/Testing/TestSubscriber.cs b/src/DataStreamSuite/PubSub/Testing/TestSubscriber.cs index 359ac87f3..1721e5c91 100644 --- a/src/DataStreamSuite/PubSub/Testing/TestSubscriber.cs +++ b/src/DataStreamSuite/PubSub/Testing/TestSubscriber.cs @@ -1,18 +1,19 @@ -using BCG; - -using bts; +using Bts.PubSub; using System; -using System.IO; using System.Linq; -using System.Runtime.Serialization; namespace BCG { public class TestSubscriber { - SubscriberCore _sub_core = new SubscriberCore(); - public TestSubscriber() { + readonly ISubscriberCore _sub_core; + + public TestSubscriber(ISubscriberCoreFactory subscriberCoreFactory) + : this(subscriberCoreFactory.Create()) { } + + TestSubscriber(ISubscriberCore subscriberCore) { bts.Log.Gen.info("Started TestSubscriber"); + _sub_core = subscriberCore; } public void keep_polling(TimeSpan wait_per, int n_polls = System.Int32.MaxValue) { @@ -30,4 +31,4 @@ namespace BCG { } } } -} \ No newline at end of file +} diff --git a/src/DataStreamSuite/PubSubServer/Configurations/Development/.env b/src/DataStreamSuite/PubSubServer/Configurations/Development/.env new file mode 100644 index 000000000..a2c10c5ca --- /dev/null +++ b/src/DataStreamSuite/PubSubServer/Configurations/Development/.env @@ -0,0 +1,2 @@ +PUBSUB__CONFIG_DIR=src/DataStreamSuite/PubSubServer/Configurations/Development +DOTNET_ENVIRONMENT=Development diff --git a/src/DataStreamSuite/PubSubServer/Configurations/PubSubServer.json b/src/DataStreamSuite/PubSubServer/Configurations/PubSubServer.json deleted file mode 100644 index f8b799711..000000000 --- a/src/DataStreamSuite/PubSubServer/Configurations/PubSubServer.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "user": "bts", - "pubsub": { - "milliseconds_between_sub_info_updates": 1000, - "milliseconds_between_time_slice_updates": 5000, - "milliseconds_between_no_buffer_space_retries": 100, - "retries_on_no_buffer_space": 1, - "do_it_all_seconds_between_logs": 0, - "heartbeat_interval": 15000, - "missing_heartbeats_before_gc": 50, - "use_managed_sockets": true, - "state_update_period": 5000, - "statistics_update_period": 5000, - "disposed_connection_check_period": 1000, - "message_processing_warning_threshold": 1000, - "server_port": 12345, - "publisher_routes": [ - { - "name": "default", - "server_address": "bts-cloud://localhost:12345", - "tag": ".*" - } - ], - "subscriber_routes": [ - { - "name": "default", - "server_address": "bts-cloud://localhost:12345", - "tag": ".*" - } - ], - "max_packet_size": 500000000, - "blue_comm_must_die": true, - "crushable_tags": [], - "tag_type_to_assembly_map": [ - { - "handler_class": "BCG.PubSubServerTagHandler", - "assembly": "DataStreamCore.dll" - } - ], - "server_queue": "PubSubQueue", - "port_range": { - "first": 30400, - "last": 31700 - }, - "bind_to_random_port": false, - "debug_tags": "^NOTAGS$", - "latency_report_threshold_ms": 1500, - "use_substations": false, - "use_dynamic_clients": false, - "is_substation": false, - "internally_publish_sub_info": true, - "use_managed_clients_in_native_code": false, - "compressed_tags": "^NOTAGS$", - "tags_to_report_compression_ratio": "^NOTAGS$", - "disable_msmq": false, - "use_prepublished_server_state": false, - "ip_translation": null, - "gc_activation_threshold": 0, - "wait_period_after_gc": 1000 - } -} diff --git a/src/DataStreamSuite/PubSubServer/Configurations/PubsubServer_Linux.json b/src/DataStreamSuite/PubSubServer/Configurations/PubsubServer_Linux.json deleted file mode 100644 index 4c9a17a45..000000000 --- a/src/DataStreamSuite/PubSubServer/Configurations/PubsubServer_Linux.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "user": "bts", - "pubsub": { - "milliseconds_between_sub_info_updates": 1000, - "milliseconds_between_time_slice_updates": 5000, - "milliseconds_between_no_buffer_space_retries": 100, - "retries_on_no_buffer_space": 1, - "do_it_all_seconds_between_logs": 0, - "heartbeat_interval": 15000, - "missing_heartbeats_before_gc": 50, - "use_managed_sockets": true, - "state_update_period": 5000, - "statistics_update_period": 5000, - "disposed_connection_check_period": 1000, - "message_processing_warning_threshold": 1000, - "server_port": 12345, - "publisher_routes": [ - { - "name": "default", - "server_address": "bts-cloud://192.168.1.80:12345", - "tag": ".*" - } - ], - "subscriber_routes": [ - { - "name": "default", - "server_address": "bts-cloud://192.168.1.80:12345", - "tag": ".*" - } - ], - "max_packet_size": 500000000, - "blue_comm_must_die": true, - "crushable_tags": [], - "tag_type_to_assembly_map": [ - { - "handler_class": "BCG.PubSubServerTagHandler", - "assembly": "DataStreamCore.dll" - } - ], - "server_queue": "PubSubQueue", - "port_range": { - "first": 30400, - "last": 31700 - }, - "bind_to_random_port": false, - "debug_tags": "^NOTAGS$", - "latency_report_threshold_ms": 1500, - "use_substations": false, - "use_dynamic_clients": false, - "is_substation": false, - "internally_publish_sub_info": true, - "use_managed_clients_in_native_code": false, - "compressed_tags": "^NOTAGS$", - "tags_to_report_compression_ratio": "^NOTAGS$", - "disable_msmq": false, - "use_prepublished_server_state": false, - "ip_translation": null, - "gc_activation_threshold": 0, - "wait_period_after_gc": 1000 - } -} \ No newline at end of file diff --git a/src/DataStreamSuite/PubSubServer/Configurations/SimpleEchoServer.json b/src/DataStreamSuite/PubSubServer/Configurations/SimpleEchoServer.json deleted file mode 100644 index 8ec19d45e..000000000 --- a/src/DataStreamSuite/PubSubServer/Configurations/SimpleEchoServer.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "user": "bts", - "simple_echo_server": true -} diff --git a/src/DataStreamSuite/PubSubServer/Configurations/Staging/.env b/src/DataStreamSuite/PubSubServer/Configurations/Staging/.env new file mode 100644 index 000000000..b3f56d902 --- /dev/null +++ b/src/DataStreamSuite/PubSubServer/Configurations/Staging/.env @@ -0,0 +1,2 @@ +PUBSUB__CONFIG_DIR=src/DataStreamSuite/PubSubServer/Configurations/Staging +DOTNET_ENVIRONMENT=Staging diff --git a/src/DataStreamSuite/PubSubServer/Dockerfile b/src/DataStreamSuite/PubSubServer/Dockerfile new file mode 100644 index 000000000..f97be6b26 --- /dev/null +++ b/src/DataStreamSuite/PubSubServer/Dockerfile @@ -0,0 +1,9 @@ +FROM bluetradingsystems/linux_dotnet7 + +ARG CONFIG_DIR="src/DataStreamSuite/PubSubServer/Configurations/Development" +ARG SOURCE_DIR="build/Release/bin/net8.0/linux-x64/publish" + +USER "bts" +COPY --chown=bts:bts "${SOURCE_DIR}" "bin" +COPY --chown=bts:bts "${CONFIG_DIR}" "/home/bts/.local/share/bts/PubSubServer/conf" +WORKDIR "/home/bts/bin" diff --git a/src/DataStreamSuite/PubSubServer/Program.cs b/src/DataStreamSuite/PubSubServer/Program.cs index f453d4234..d7b663942 100644 --- a/src/DataStreamSuite/PubSubServer/Program.cs +++ b/src/DataStreamSuite/PubSubServer/Program.cs @@ -1,86 +1,37 @@ -using BCG; +using Bts.Extensions.Hosting; +using Bts.PubSub.Services; -using bts; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; -using Bts.PubSub; -using Bts.PubSubServer; - -using CommandLine; - -using mbts.config; - -using Spark.Core; +using Spark.Core.Services; using System; -using System.Collections.Specialized; -using System.Threading; -using System.Threading.Tasks; -Parser.Default.ParseArguments(args) - .MapResult(Run, errs => Task.FromResult(1)); - -async Task Run(PubSubServerConfig cfg) { - try { - cfg.MergeWithConfigFile(); - cfg.MergeWith(PubSubServerConfig.Default()); - PubSubConfig.SetGlobalConfig(Log.notnull(cfg.PubSub)); - if (!await Configuration.InitializeAsync(cfg.Sparkd)) { - Console.Error.WriteLine("Failed to initialize Spark config"); - return 1; - } - bool run_echo_server = false; - bool echo_msg_back = false; - cfg.SimpleEchoServer = run_echo_server; - return cfg.SimpleEchoServer ?? false ? - RunEchoServer(cfg.PubSub.ServerPort.assert_value(), echo_msg_back) : - RunPubSubServer(); - } catch (Exception ex) { - // Write the error to console first, in case the logging system is compromised. - var error_msg = $"PubSubServer threw exception:\n{ex}"; - Console.Error.WriteLine(error_msg); - Console.Error.Flush(); - Log.Gen.error(error_msg); - return 1; - } +var host = HostBuilderExtensions.CreateBtsBuilder(args) + .ConfigureServices(ConfigureServices) + .Build(); +try { + Console.Write($"Starting Application"); + host.Run(); + Console.Write($"Application exited gracefully."); +} catch (Exception ex) { + Console.Error.Write($"Application crashed: {ex}"); + return 1; } +return 0; -int RunPubSubServer() { - var config = PubSubConfig.Instance; - long currentMemory = 0; - int defaultWaitTime = 100; - bool gced = false; - Task.Run(() => { - while (true) { - gced = false; - currentMemory = GC.GetTotalMemory(false); - if (config.GcActivationThreshold > 0 && currentMemory > config.GcActivationThreshold) { - Console.WriteLine($"GCing memory, mem before GC = {currentMemory}"); - GC.Collect(); - gced = true; - } - Thread.Sleep(gced ? config.WaitPeriodAfterGc.assert_value() : defaultWaitTime); - } - }); - new PubSubMessageReactor(config.ServerPort.assert_value()).start(); - return 0; -} - -int RunEchoServer(short port, bool echo) { - string log_msg = $"Running as TCP Echo server, port: {port} echo: {echo} Hit enter to continue:"; - Console.WriteLine(log_msg); - Console.ReadLine(); - var ready_msg = $"ready to listen to port: {port}"; - Log.Gen.info(ready_msg); - Console.WriteLine(ready_msg); - var sts = new SimpleTCPServer(port, echo); - sts.init(); - Console.CancelKeyPress += OnCancelKeyPress; - while (true) { - Thread.Sleep(TimeSpan.FromSeconds(3)); - } - - void OnCancelKeyPress(object? sender, ConsoleCancelEventArgs e) { - Log.Gen.error("Cancel key press. Disposing echo server"); - sts.Dispose(); +static void ConfigureServices(HostBuilderContext context, IServiceCollection services) { + var echoServerCfg = context.Configuration.GetSection("SimpleEchoServer"); + if (echoServerCfg.Get() is not null) { + services.AddPubSubEchoServer(echoServerCfg); + return; } + /// Bind configuration json fields to strong types. This allows us to add services with + /// constructors that accept these types as arguments. + services.AddSpark(context.Configuration.GetSection("Spark")) + .AddMasterWorker(context.Configuration.GetSection("MasterWorker")) + .AddPubSubServer(context.Configuration.GetSection("PubSub")) + .AddGarbageCollector(context.Configuration.GetSection("GarbageCollector")); } diff --git a/src/DataStreamSuite/PubSubServer/PubSubServer.csproj b/src/DataStreamSuite/PubSubServer/PubSubServer.csproj index 666dd989e..de8f1646e 100644 --- a/src/DataStreamSuite/PubSubServer/PubSubServer.csproj +++ b/src/DataStreamSuite/PubSubServer/PubSubServer.csproj @@ -6,13 +6,20 @@ enable - - - - + + + + + + + + + + + diff --git a/src/DataStreamSuite/PubSubServer/PubSubServerConfig.cs b/src/DataStreamSuite/PubSubServer/PubSubServerConfig.cs index 026b6f39f..e146a6f4c 100644 --- a/src/DataStreamSuite/PubSubServer/PubSubServerConfig.cs +++ b/src/DataStreamSuite/PubSubServer/PubSubServerConfig.cs @@ -2,8 +2,6 @@ namespace Bts.PubSubServer; using Bts.PubSub; -using CommandLine; - using System; using System.IO; using System.Text.Json; @@ -14,21 +12,15 @@ public class PubSubServerConfig { /// The config server url for sparkd /// [JsonPropertyName("sparkd")] - [Option("sparkd", HelpText = "The sparkd config server")] public string? Sparkd { get; set; } [JsonPropertyName("simple_echo_server")] - [Option("simple-echo-server", HelpText = "Run a simple echo server (won't connect to sparkd)")] public bool? SimpleEchoServer { get; set; } [JsonPropertyName("pubsub")] public PubSubConfig? PubSub { get; set; } [JsonIgnore] - [Option( - "config", - MetaValue = "PATH", - HelpText = "Path to json file representing these options (PubSubServerConfig)")] public string? ConfigFile { get; set; } public static PubSubServerConfig Default() => diff --git a/src/DataStreamSuite/PubSubServer/appsettings.Development.json b/src/DataStreamSuite/PubSubServer/appsettings.Development.json new file mode 100644 index 000000000..f83647ef7 --- /dev/null +++ b/src/DataStreamSuite/PubSubServer/appsettings.Development.json @@ -0,0 +1,20 @@ +{ + "PubSub": { + "Routing": { + "PublisherRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://localhost:22019", + "TagRegExp": ".*" + } + ], + "SubscriberRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://localhost:22019", + "TagRegExp": ".*" + } + ] + } + } +} diff --git a/src/DataStreamSuite/PubSubServer/appsettings.EchoServer.json b/src/DataStreamSuite/PubSubServer/appsettings.EchoServer.json new file mode 100644 index 000000000..b7a63f076 --- /dev/null +++ b/src/DataStreamSuite/PubSubServer/appsettings.EchoServer.json @@ -0,0 +1,6 @@ +{ + "PubSubEchoServer": { + "Echo": true, + "Port": 12345 + } +} diff --git a/src/DataStreamSuite/PubSubServer/appsettings.Production.json b/src/DataStreamSuite/PubSubServer/appsettings.Production.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/src/DataStreamSuite/PubSubServer/appsettings.Production.json @@ -0,0 +1 @@ +{} diff --git a/src/DataStreamSuite/PubSubServer/appsettings.ProductionAws.json b/src/DataStreamSuite/PubSubServer/appsettings.ProductionAws.json new file mode 100644 index 000000000..d54f0f942 --- /dev/null +++ b/src/DataStreamSuite/PubSubServer/appsettings.ProductionAws.json @@ -0,0 +1,20 @@ +{ + "PubSub": { + "Routing": { + "PublisherRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://34.237.179.93:22019", + "TagRegExp": ".*" + } + ], + "SubscriberRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://34.237.179.93:22019", + "TagRegExp": ".*" + } + ] + } + } +} diff --git a/src/DataStreamSuite/PubSubServer/appsettings.Staging.json b/src/DataStreamSuite/PubSubServer/appsettings.Staging.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/src/DataStreamSuite/PubSubServer/appsettings.Staging.json @@ -0,0 +1 @@ +{} diff --git a/src/DataStreamSuite/PubSubServer/appsettings.json b/src/DataStreamSuite/PubSubServer/appsettings.json new file mode 100644 index 000000000..dfd8fb356 --- /dev/null +++ b/src/DataStreamSuite/PubSubServer/appsettings.json @@ -0,0 +1,94 @@ +{ + "Spark": {}, + "MasterWorker": { + "Interval": "00:00:00.1" + }, + "PubSub": { + "MillisecondsBetweenSubInfoUpdates": 1000, + "MillisecondsBetweenTimeSliceUpdates": 5000, + "MillisecondsBetweenNoBufferSpaceRetries": 100, + "RetriesOnNoBufferSpace": 1, + "DoItAllSecondsBetweenLogs": 0, + "HeartbeatInterval": 15000, + "MissingHeartbeatsBeforeGc": 50, + "UseManagedSockets": true, + "StateUpdatePeriod": 5000, + "StatisticsUpdatePeriod": 5000, + "DisposedConnectionCheckPeriod": 1000, + "MessageProcessingWarningThreshold": 1000, + "ServerPort": 22019, + "Routing": { + "PublisherRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://pubsub:22019", + "TagRegExp": ".*" + } + ], + "SubscriberRoutes": [ + { + "Name": "default", + "ServerAddress": "bts-cloud://pubsub:22019", + "TagRegExp": ".*" + } + ] + }, + "MaxPacketSize": 500000000, + "BlueCommMustDie": true, + "CrushableTags": [], + "TagTypeToAssemblyMap": { + "Entries": [ + { + "HandlerClass": "BCG.PubSubServerTagHandler", + "Assembly": "DataStreamCore.dll" + } + ] + }, + "ServerQueue": "PubSubQueue", + "PortRange": { + "First": 30400, + "Last": 31700 + }, + "BindToRandomPort": false, + "DebugTags": "^NOTAGS$", + "LatencyReportThresholdMs": 1500, + "UseSubstations": false, + "UseDynamicClients": false, + "IsSubstation": false, + "InternallyPublishSubInfo": true, + "UseManagedClientsInNativeCode": false, + "CompressedTags": "^NOTAGS$", + "TagsToReportCompressionRatio": "^NOTAGS$", + "DisableMsmq": false, + "UsePrepublishedServerState": false, + "IpTranslation": null, + "TagHandlerFactory": { + "Handlers": [ + { + "TagType": "DataStream", + "Assembly": "DataStreamCore", + "Class": "bts.PubsubServerStreamTagHandler" + }, + { + "TagType": "System_Sub", + "Assembly": "PubSub", + "Class": "BCG.SystemSubscriptionMapPublisher" + }, + { + "TagType": "System_Stats", + "Assembly": "PubSub", + "Class": "BCG.SystemStatsPublisher" + }, + { + "TagType": ".*", + "Assembly": "DataStreamCore", + "Class": "bts.PubsubServerGenericDataHandler" + } + ] + } + }, + "GarbageCollector": { + "ActivationThreshold": 0, + "Interval": "00:00:01" + } +} diff --git a/src/DataStreamSuite/SharedStreams/System/PS3/Health/DeadPublisherTagsStream.cs b/src/DataStreamSuite/SharedStreams/System/PS3/Health/DeadPublisherTagsStream.cs index 63e89efba..b181d32bb 100644 --- a/src/DataStreamSuite/SharedStreams/System/PS3/Health/DeadPublisherTagsStream.cs +++ b/src/DataStreamSuite/SharedStreams/System/PS3/Health/DeadPublisherTagsStream.cs @@ -1,15 +1,17 @@ using bts; +using Bts.PubSub; + namespace BCG { /// /// List of all the tags that result from a /// dead publisher, ie tags that have data /// but no active publisher /// - [DataStreamUserRespresentation("deadPublisherTags")] + [DataStreamUserRespresentation(/*"deadPublisherTags"*/ false)] public class DeadPublisherTagsStream : ViewStream { - public DeadPublisherTagsStream() { - ViewStream serverState = new PubSubServerStateStream(); + public DeadPublisherTagsStream(ISubscriberCoreFactory subscriberCoreFactory, ViewStreamDatabase viewStreamDatabase) { + ViewStream serverState = new PubSubServerStateStream(subscriberCoreFactory, viewStreamDatabase); serverState = new FilterStream(serverState, "publishers='' and deadPublishers<>''"); serverState = new ProjectStream(serverState, "!subscribers publishers deadPublishers"); mySetRealSource(serverState); diff --git a/src/DataStreamSuite/SharedStreams/System/PS3/Stats/PubSubServerTagStatsStream.cs b/src/DataStreamSuite/SharedStreams/System/PS3/Stats/PubSubServerTagStatsStream.cs index 17e5a172a..a66051580 100644 --- a/src/DataStreamSuite/SharedStreams/System/PS3/Stats/PubSubServerTagStatsStream.cs +++ b/src/DataStreamSuite/SharedStreams/System/PS3/Stats/PubSubServerTagStatsStream.cs @@ -1,13 +1,14 @@ - using BCG; using BCG.Utilities.General; -using MathNet.Numerics.RootFinding; +using Bts.PubSub; namespace bts { - [DataStreamUserRespresentation("pss_stats")] + // TODO: Use dependency injection to instantiate this stream, and others like it that depend on + // ISubscriberCore(Factory). Until then, hide it from DSQA. + [DataStreamUserRespresentation(/*"pss_stats"*/ false)] public class PubSubServerTagStatsStream : ViewStream, IWorker { - private SubscriberCore _sub_core; + readonly ISubscriberCore _sub_core; private ViewStreamDatabase _vsd; private IBlueTableSchema _schema = new BlueTableSchema("tagStats", @@ -23,13 +24,13 @@ namespace bts { new ColumnInfo("last_update_time", 9, typeof(DateTime))); private IDictionary _tag_map = new Dictionary(); - public PubSubServerTagStatsStream(ViewStreamDatabase vsd) { - _vsd = vsd; - _sub_core = new SubscriberCore(); - } + public PubSubServerTagStatsStream(ISubscriberCoreFactory subscriberCoreFactory, ViewStreamDatabase vsd) + : this(subscriberCoreFactory.Create(), vsd) { } - public PubSubServerTagStatsStream() - : this(ViewStreamDatabase.instance) { } + PubSubServerTagStatsStream(ISubscriberCore subscriberCore, ViewStreamDatabase vsd) { + _vsd = vsd; + _sub_core = subscriberCore; + } protected override void myOnFirstSubscriber() { _sub_core.subscribe("System_AllStatistics"); diff --git a/src/DataStreamSuite/SharedStreams/System/PS3/Subscription/PubSubServerStateStream.cs b/src/DataStreamSuite/SharedStreams/System/PS3/Subscription/PubSubServerStateStream.cs index f395cfbfb..88a260a92 100644 --- a/src/DataStreamSuite/SharedStreams/System/PS3/Subscription/PubSubServerStateStream.cs +++ b/src/DataStreamSuite/SharedStreams/System/PS3/Subscription/PubSubServerStateStream.cs @@ -1,25 +1,29 @@ -using BCG.Utilities.General; using BCG; +using BCG.Utilities.General; + +using Bts.PubSub; namespace bts { /// /// Gets the subscription and publication state for one /// server. /// - [DataStreamUserRespresentation("pss_state")] + // TODO: Use dependency injection to instantiate this stream, and others like it that depend on + // ISubscriberCore(Factory). Until then, hide it from DSQA. + [DataStreamUserRespresentation(/*"pss_state"*/ false)] public class PubSubServerStateStream : ViewStream, IWorker { private IDictionary _tag_map = new Dictionary(); private readonly string _tag = "System_AllSubscriptions"; private IBlueTableSchema _schema = null; - private SubscriberCore _sub_core; + readonly ISubscriberCore _sub_core; private ViewStreamDatabase _vsd; + public PubSubServerStateStream(ISubscriberCoreFactory subscriberCoreFactory, ViewStreamDatabase vsd) + : this(subscriberCoreFactory.Create(), vsd) { } - public PubSubServerStateStream() - : this(ViewStreamDatabase.instance) { } - - public PubSubServerStateStream(ViewStreamDatabase vsd) { + PubSubServerStateStream(ISubscriberCore subscriberCore, ViewStreamDatabase vsd) { + _sub_core = subscriberCore; // TODO, construct schema _schema = BlueDataUtility.form_schema("pubsub_server_state", Tuple.Create("id", TypeCode.Int32), diff --git a/src/DataStreamSuite/SharedStreams/System/PS3/Subscription/PubsubHeartbeatStream.cs b/src/DataStreamSuite/SharedStreams/System/PS3/Subscription/PubsubHeartbeatStream.cs index 62c2e75e4..0e895063f 100644 --- a/src/DataStreamSuite/SharedStreams/System/PS3/Subscription/PubsubHeartbeatStream.cs +++ b/src/DataStreamSuite/SharedStreams/System/PS3/Subscription/PubsubHeartbeatStream.cs @@ -1,17 +1,23 @@ namespace bts { - using BCG; - using BCG.Utilities.General; + using BCG; + using BCG.Utilities.General; - using MathNet.Numerics.RootFinding; + using Bts.PubSub; - using ZstdSharp.Unsafe; - [DataStreamUserRespresentation("pss_hb")] + // TODO: Use dependency injection to instantiate this stream, and others like it that depend on + // ISubscriberCore(Factory). Until then, hide it from DSQA. + [DataStreamUserRespresentation(/*"pss_hb"*/ false)] public class PubsubHeartbeatStream : ViewStream, IWorker { private ViewStreamDatabase _vsd; - private SubscriberCore _subcore = new SubscriberCore(); + readonly ISubscriberCore _subcore; private MutableBlueRow _row = null; private readonly IBlueTableSchema _schema = null; - public PubsubHeartbeatStream(ViewStreamDatabase vsd) { + + public PubsubHeartbeatStream(ISubscriberCoreFactory subscriberCore, ViewStreamDatabase vsd) + : this(subscriberCore.Create(), vsd) { } + + PubsubHeartbeatStream(ISubscriberCore subscriberCore, ViewStreamDatabase vsd) { + _subcore = subscriberCore; _vsd = vsd; _schema = BlueDataUtility.form_schema("PS_HBB", Tuple.Create("id", TypeCode.Int32), @@ -21,8 +27,6 @@ namespace bts { Tuple.Create("time_since_last_recv_msecs", TypeCode.Int32) ); } - public PubsubHeartbeatStream() : - this(ViewStreamDatabase.instance) { } protected override void myOnFirstSubscriber() { _subcore.subscribe("pss_hb"); diff --git a/src/DataStreamSuite/SharedStreams/System/PS3/TableMetaDataStream.cs b/src/DataStreamSuite/SharedStreams/System/PS3/TableMetaDataStream.cs index 49ab64a91..31571ec57 100644 --- a/src/DataStreamSuite/SharedStreams/System/PS3/TableMetaDataStream.cs +++ b/src/DataStreamSuite/SharedStreams/System/PS3/TableMetaDataStream.cs @@ -3,6 +3,8 @@ namespace bts using BCG; using BCG.Utilities.General; + using Bts.PubSub; + public class TableMetaDataStream : ViewStream, IWorker { private class TableState @@ -36,12 +38,11 @@ namespace bts private ViewStream _base_stream; private IDictionary _table_map = new Dictionary(); private BlueTable _state; - public TableMetaDataStream() - : this(ViewStreamDatabase.instance) { } - public TableMetaDataStream(ViewStreamDatabase vsd) + + public TableMetaDataStream(ISubscriberCoreFactory subscriberCoreFactory, ViewStreamDatabase vsd) { _vsd = vsd; - _base_stream = new PubSubServerStateStream(_vsd); + _base_stream = new PubSubServerStateStream(subscriberCoreFactory, _vsd); _state = new BlueTable(_schema); } protected override void myOnFirstSubscriber() @@ -111,4 +112,4 @@ namespace bts } } } -} \ No newline at end of file +} diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 87b8de912..a7e2e217d 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -88,4 +88,13 @@ + + + $(OutputPath)\Configurations\$(MSBuildProjectName) + $(OutputPath)\$(MSBuildProjectName).%(FileName)%(Extension) + $(OutputPath)\publish\Configurations\$(MSBuildProjectName) + $(OutputPath)\publish\$(MSBuildProjectName).%(FileName)%(Extension) + + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 3409f22ba..c1772d679 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -36,6 +36,25 @@ + + + + + + + + +