LiamMorrow / OrgnalR

SignalR backplane implemented through Orleans
Apache License 2.0
34 stars 7 forks source link

Having trouble getting chat app to run #35

Closed bbehrens closed 1 year ago

bbehrens commented 1 year ago

I tried to fire up the ChatApp example and I can't get it going. Here's everything I tried:

Open chatapp solution in vs 2022 Configure multiple startup projects -> 404

Manually run the ChatApp.Silo and ChatApp.Server projects via dotnet run - This works, but I can't get hit a URL

Manually run the ChatApp.Silo and ChatApp.Server projects via dotnet run then run yarn start for the chatapp project

That brings up the chatapp html page but it can't connect to the backend stuff

image

I tried running things in VS code and couldn't get that to work either.

Am I missing a short path to victory here?

LiamMorrow commented 1 year ago

Yeah you should be able to run the silo, then run the server (the server serves the SPA and signalr, so no need for yarn start).

The Server app will spit out a URL which you can open in your browser, and will setup the SPA.

So basically in two terminals: 1st terminal:

cd example/chat-app/ChatApp.Silo
dotnet run

2nd terminal:

cd example/chat-app/ChatApp.Server
dotnet run

The output of the 2nd terminal will have the link you need to click. image

I do run on linux though, not sure if there's extra setup I'm missing on other OSs

bbehrens commented 1 year ago

Thanks, but couldn't get it going. I'll get with my coworker tomorrow and see if we can get it going.

On Mon, Dec 5, 2022 at 5:15 PM Liam Morrow @.***> wrote:

Yeah you should be able to run the silo, then run the server (the server serves the SPA and signalr, so no need for yarn start).

The Server app will spit out a URL which you can open in your browser, and will setup the SPA

— Reply to this email directly, view it on GitHub https://github.com/LiamMorrow/OrgnalR/issues/35#issuecomment-1338322513, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAPCRZ3D2SYGAJ3VK5X2W3WLZZPZANCNFSM6AAAAAASU2HL64 . You are receiving this because you authored the thread.Message ID: @.***>

-- Brandon Behrens 512.659.7171 (c)

bbehrens commented 1 year ago

From Developer Command Prompt inside visual studio:

Silo logs:

C:\code\OrgnalR\example\chat-app\ChatApp.Silo>dotnet run
info: Orleans.Runtime.Silo[100404]
      Silo starting with GC settings: ServerGC=True GCLatencyMode=Interactive
info: Orleans.Runtime.Silo[100403]
      -------------- Initializing silo on host L5CD9412361 MachineName L5CD9412361 at 127.0.0.1:11111, gen 29342352 --------------
info: Orleans.Runtime.Silo[100415]
      Starting silo Silo_ceee4
warn: Orleans.Runtime.NoOpHostEnvironmentStatistics[100708]
      No implementation of IHostEnvironmentStatistics was found. Load shedding will not work yet
info: Orleans.Runtime.Silo[100422]
      -------------- Started silo S127.0.0.1:11111:29342352, ConsistentHashCode 347F3993 --------------
info: Orleans.Hosting.SiloHostedService[0]
      Starting Orleans Silo.
info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.ActivationCountBasedPlacementOptions:
      ChooseOutOf: 2

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.ClusterMembershipOptions:
      NumMissedTableIAmAliveLimit: 2
      LivenessEnabled: True
      ProbeTimeout: 00:00:05
      TableRefreshTimeout: 00:01:00
      DeathVoteExpirationTimeout: 00:02:00
      IAmAliveTablePublishTimeout: 00:05:00
      MaxJoinAttemptTime: 00:05:00
      UseLivenessGossip: True
      NumProbedSilos: 3
      NumMissedProbesLimit: 3
      NumVotesForDeathDeclaration: 2
      DefunctSiloExpiration: 7.00:00:00
      DefunctSiloCleanupPeriod: 01:00:00
      LocalHealthDegradationMonitoringPeriod: 00:00:10
      ExtendProbeTimeoutDuringDegradation: True
      EnableIndirectProbes: True

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.ClusterOptions:
      ClusterId: default
      ServiceId: default

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.ConnectionOptions:
      ProtocolVersion: Version1
      ConnectionsPerEndpoint: 1
      ConnectionRetryDelay: 00:00:01
      OpenConnectionTimeout: 00:00:05

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.ConsistentRingOptions:
      NumVirtualBucketsConsistentRing: 30
      UseVirtualBucketsConsistentRing: True

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.DevelopmentClusterMembershipOptions:
      PrimarySiloEndpoint: 127.0.0.1:11111

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.EndpointOptions:
      AdvertisedIPAddress: 127.0.0.1
      SiloPort: 11111
      GatewayPort: 30000
      SiloListeningEndpoint:
      GatewayListeningEndpoint:

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.GrainCollectionOptions:
      CollectionQuantum: 00:01:00
      CollectionAge: 00:15:00
      ActivationTimeout: 00:00:30
      DeactivationTimeout: 00:00:30

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.GrainDirectoryOptions:
      CachingStrategy: Adaptive
      CacheSize: 1000000
      InitialCacheTTL: 00:00:30
      MaximumCacheTTL: 00:04:00
      CacheTTLExtensionFactor: 2
      LazyDeregistrationDelay: 00:01:00

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.GrainVersioningOptions:
      DefaultCompatibilityStrategy: BackwardCompatible
      DefaultVersionSelectorStrategy: AllCompatibleVersions

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.LoadSheddingOptions:
      LoadSheddingEnabled: False
      LoadSheddingLimit: 95

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.MemoryGrainStorageOptions-ORGNALR_GROUP_STORAGE:
      NumStorageGrains: 10
      InitStage: 10000

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.MemoryGrainStorageOptions-ORGNALR_MESSAGE_STORAGE:
      NumStorageGrains: 10
      InitStage: 10000

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.MemoryGrainStorageOptions-ORGNALR_USER_STORAGE:
      NumStorageGrains: 10
      InitStage: 10000

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.SchedulingOptions:
      DelayWarningThreshold: 00:00:10
      ActivationSchedulingQuantum: 00:00:00.1000000
      TurnWarningLengthThreshold: 00:00:01
      MaxPendingWorkItemsSoftLimit: 0
      StoppedActivationWarningInterval: 00:01:00

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.SiloMessagingOptions:
      SiloSenderQueues: 0
      GatewaySenderQueues: 0
      MaxForwardCount: 2
      ClientDropTimeout: 00:01:00
      ClientRegistrationRefresh: 00:05:00
      ClientGatewayShutdownNotificationTimeout: 00:00:05
      MaxEnqueuedRequestsSoftLimit: 0
      MaxEnqueuedRequestsHardLimit: 0
      MaxEnqueuedRequestsSoftLimit_StatelessWorker: 0
      MaxEnqueuedRequestsHardLimit_StatelessWorker: 0
      MaxRequestProcessingTime: 02:00:00
      AssumeHomogenousSilosForTesting: False
      ShutdownRerouteTimeout: 00:00:10
      SystemResponseTimeout: 00:00:30
      GrainWorkloadAnalysisPeriod: 00:00:05
      RequestProcessingWarningTime: 00:00:05
      RequestQueueDelayWarningTime: 00:00:10
      WaitForMessageToBeQueuedForOutboundTime: 00:00:02
      ResponseTimeout: 00:00:30
      ResponseTimeoutWithDebugger: 00:30:00
      DropExpiredMessages: True
      MaxMessageHeaderSize: 10485760
      MaxMessageBodySize: 104857600

info: Orleans.Runtime.SiloOptionsLogger[0]
      Configuration Orleans.Configuration.SiloOptions:
      SiloName: Silo_ceee4

info: Orleans.Runtime.InsideRuntimeClient[100452]
      Start InsideRuntimeClient took 0 milliseconds
info: Orleans.Runtime.Silo[100401]
      Silo Start()
info: Orleans.Runtime.GrainDirectory.LocalGrainDirectory[0]
      Start
info: Orleans.Runtime.Silo[100452]
      Start local grain directory took 1 milliseconds to finish
info: Orleans.Runtime.MembershipService.MembershipTableManager[100603]
      MembershipOracle starting on host L5CD9412361 with SiloAddress S127.0.0.1:11111:29342352 at 2022-12-06 14:39:12.867 GMT
info: Orleans.Runtime.MembershipService.SystemTargetBasedMembershipTable[100635]
      Creating in-memory membership table
info: Orleans.Runtime.Silo[100452]
      Init grain services took 1 milliseconds to finish
info: Orleans.Runtime.MembershipService.MembershipTableSystemTarget[100637]
      GrainBasedMembershipTable Activated.
info: Orleans.Runtime.Silo[100452]
      Start deployment load collector took 12 milliseconds to finish
info: Orleans.Runtime.Watchdog[0]
      Starting Silo Watchdog.
info: Orleans.Runtime.MembershipService.SystemTargetBasedMembershipTable[100631]
      Connected to membership table provider.
info: Orleans.Runtime.MembershipService.MembershipAgent[100663]
      Joining
info: Orleans.Runtime.MembershipService.MembershipAgent[100604]
      -BecomeActive
info: Orleans.Runtime.MembershipService.MembershipAgent[100605]
      -Finished BecomeActive.
info: Orleans.Hosting.SiloHostedService[0]
      Orleans Silo started.
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:58801/
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:58802/
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\code\OrgnalR\example\chat-app\ChatApp.Silo
info: Orleans.Runtime.Messaging.Gateway[101301]
      Recorded opened connection from endpoint 127.0.0.1:63609, client ID sys.client/943b57923b764a609c13ac63a29dfc8b.
warn: Orleans.Runtime.MembershipService.MembershipTableCleanupAgent[100662]
      CleanupDefunctSiloEntries operation is not supported by the current implementation of IMembershipTable. Disabling the timer now.
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Closing connection [Local: 127.0.0.1:30000, Remote: 127.0.0.1:63609, ConnectionId: 0HMMNJ57BSV80]
info: Orleans.Runtime.Messaging.Gateway[101302]
      Recorded closed socket from endpoint 127.0.0.1:63609, client ID sys.client/943b57923b764a609c13ac63a29dfc8b.
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Connection [Local: 127.0.0.1:30000, Remote: 127.0.0.1:63609, ConnectionId: 0HMMNJ57BSV80] terminated
info: Orleans.Runtime.Messaging.Gateway[101301]
      Recorded opened connection from endpoint 127.0.0.1:65519, client ID sys.client/75181ed530264031b1aa7a67a9b800fe.
info: Orleans.Runtime.Messaging.Gateway[101303]
      Dropping client sys.client/943b57923b764a609c13ac63a29dfc8b, 00:01:05.3590000 after disconnect with no reconnect
info: Orleans.Runtime.ActivationCollector[100509]
      DeactivateActivationsFromCollector: total 1 to promptly Destroy.
info: Orleans.Messaging[101033]
      Forwarding 1 requests destined for address [GrainAddress GrainId anonymousmessage/ChatHub, ActivationId: @92012f8974b94cbfa9ab6b10593e5e60, SiloAddress: S127.0.0.1:11111:29342352] to address (null) after This activation has become idle.
info: Orleans.Messaging[101031]
      Trying to forward Request [S127.0.0.1:11111:29342352 sys.client/75181ed530264031b1aa7a67a9b800fe]->[S127.0.0.1:11111:29342352 anonymousmessage/ChatHub] OrgnalR.Backplane.GrainInterfaces.IAnonymousMessageGrainOrgnalR.Backplane.GrainInterfaces.IAnonymousMessageGrain.SubscribeToMessages(GrainReference:sys.client/75181ed530264031b1aa7a67a9b800fe+23c141cbfc614c3abcac110387ed6a1c:OrgnalR.Backplane.GrainInterfaces.IAnonymousMessageObserver, OrgnalR.Core.Provider.MessageHandle) #27 from [GrainAddress GrainId anonymousmessage/ChatHub, ActivationId: @92012f8974b94cbfa9ab6b10593e5e60, SiloAddress: S127.0.0.1:11111:29342352] to (null) after This activation has become idle.. Attempt 0
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Closing connection [Local: 127.0.0.1:30000, Remote: 127.0.0.1:65519, ConnectionId: 0HMMNJ57BSV81]
info: Orleans.Runtime.Messaging.Gateway[101302]
      Recorded closed socket from endpoint 127.0.0.1:65519, client ID sys.client/75181ed530264031b1aa7a67a9b800fe.
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Connection [Local: 127.0.0.1:30000, Remote: 127.0.0.1:65519, ConnectionId: 0HMMNJ57BSV81] terminated

Server logs:

C:\code\OrgnalR\example\chat-app\ChatApp.Server>dotnet run
info: Orleans.OutsideRuntimeClient[100314]
      Starting Orleans client with runtime version "7.0.0. Commit Hash: 5a95f934183113f7bae1e59465ae3b436653b616+5a95f934183113f7bae1e59465ae3b436653b616 (Release).", local address 10.84.90.5 and client id sys.client/943b57923b764a609c13ac63a29dfc8b
info: Orleans.Messaging.GatewayManager[101309]
      Found 1 gateways: [gwy.tcp://127.0.0.1:30000/0]
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Establishing connection to endpoint S127.0.0.1:30000:0
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Connected to endpoint S127.0.0.1:30000:0
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Established connection to S127.0.0.1:11111:29342352 with protocol version Version1
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Connection [Local: 127.0.0.1:63609, Remote: 127.0.0.1:30000, ConnectionId: 0HMMNJ1BBNUGV] established with S127.0.0.1:30000:0
info: Orleans.OutsideRuntimeClient[100929]
      Started client with address [GrainAddress GrainId sys.client/943b57923b764a609c13ac63a29dfc8b, ActivationId: @420a631d90784ac8bad6be53e0a00fd3, SiloAddress: C10.84.90.5:0:-29342651] and id sys.client/943b57923b764a609c13ac63a29dfc8b
info: Orleans.ClientOptionsLogger[0]
      Configuration Orleans.Configuration.ClientMessagingOptions:
      ClientSenderBuckets: 8192
      PreferredFamily: InterNetwork
      NetworkInterfaceName:
      LocalAddress:
      ResponseTimeout: 00:00:30
      ResponseTimeoutWithDebugger: 00:30:00
      DropExpiredMessages: True
      MaxMessageHeaderSize: 10485760
      MaxMessageBodySize: 104857600

info: Orleans.ClientOptionsLogger[0]
      Configuration Orleans.Configuration.ClusterOptions:
      ClusterId: default
      ServiceId: default

info: Orleans.ClientOptionsLogger[0]
      Configuration Orleans.Configuration.ConnectionOptions:
      ProtocolVersion: Version1
      ConnectionsPerEndpoint: 1
      ConnectionRetryDelay: 00:00:01
      OpenConnectionTimeout: 00:00:05

info: Orleans.ClientOptionsLogger[0]
      Configuration Orleans.Configuration.StaticGatewayListProviderOptions:
      Gateways.0: gwy.tcp://127.0.0.1:30000/0

info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:58811/
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:58812/
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\code\OrgnalR\example\chat-app\ChatApp.Server
info: Microsoft.Hosting.Lifetime[0]
      Application is shutting down...
info: Orleans.ClusterClient[0]
      Client shutting down
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Closing connection [Local: 127.0.0.1:63609, Remote: 127.0.0.1:30000, ConnectionId: 0HMMNJ1BBNUGV]
info: Orleans.ClusterClient[0]
      Client shutdown completed

C:\code\OrgnalR\example\chat-app\ChatApp.Server>dotnet run
info: Orleans.OutsideRuntimeClient[100314]
      Starting Orleans client with runtime version "7.0.0. Commit Hash: 5a95f934183113f7bae1e59465ae3b436653b616+5a95f934183113f7bae1e59465ae3b436653b616 (Release).", local address 10.84.90.5 and client id sys.client/75181ed530264031b1aa7a67a9b800fe
info: Orleans.Messaging.GatewayManager[101309]
      Found 1 gateways: [gwy.tcp://127.0.0.1:30000/0]
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Establishing connection to endpoint S127.0.0.1:30000:0
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Connected to endpoint S127.0.0.1:30000:0
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Established connection to S127.0.0.1:11111:29342352 with protocol version Version1
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Connection [Local: 127.0.0.1:65519, Remote: 127.0.0.1:30000, ConnectionId: 0HMMNJ5A32Q9U] established with S127.0.0.1:30000:0
info: Orleans.OutsideRuntimeClient[100929]
      Started client with address [GrainAddress GrainId sys.client/75181ed530264031b1aa7a67a9b800fe, ActivationId: @b84a4cb26a6348c9baaa406b8224b8d9, SiloAddress: C10.84.90.5:0:-29343076] and id sys.client/75181ed530264031b1aa7a67a9b800fe
info: Orleans.ClientOptionsLogger[0]
      Configuration Orleans.Configuration.ClientMessagingOptions:
      ClientSenderBuckets: 8192
      PreferredFamily: InterNetwork
      NetworkInterfaceName:
      LocalAddress:
      ResponseTimeout: 00:00:30
      ResponseTimeoutWithDebugger: 00:30:00
      DropExpiredMessages: True
      MaxMessageHeaderSize: 10485760
      MaxMessageBodySize: 104857600

info: Orleans.ClientOptionsLogger[0]
      Configuration Orleans.Configuration.ClusterOptions:
      ClusterId: default
      ServiceId: default

info: Orleans.ClientOptionsLogger[0]
      Configuration Orleans.Configuration.ConnectionOptions:
      ProtocolVersion: Version1
      ConnectionsPerEndpoint: 1
      ConnectionRetryDelay: 00:00:01
      OpenConnectionTimeout: 00:00:05

info: Orleans.ClientOptionsLogger[0]
      Configuration Orleans.Configuration.StaticGatewayListProviderOptions:
      Gateways.0: gwy.tcp://127.0.0.1:30000/0

info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:58811/
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:58812/
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\code\OrgnalR\example\chat-app\ChatApp.Server
info: Microsoft.Hosting.Lifetime[0]
      Application is shutting down...
info: Orleans.ClusterClient[0]
      Client shutting down
info: Orleans.Runtime.Messaging.NetworkingTrace[0]
      Closing connection [Local: 127.0.0.1:65519, Remote: 127.0.0.1:30000, ConnectionId: 0HMMNJ5A32Q9U]
info: Orleans.ClusterClient[0]
      Client shutdown completed

In the server logs:

info: Microsoft.Hosting.Lifetime[14] Now listening on: https://localhost:58811/

I get a 404 at that url when I open it in my browser

bbehrens commented 1 year ago

Do you think we might be better off just converting the GPSTracker Orleans sample to use OrgnalR? https://github.com/dotnet/samples/tree/main/orleans/GPSTracker That'd potentially be a familiar point of reference for anyone coming in to look at the library.

LiamMorrow commented 1 year ago

Definitely not against it. Very interesting that that link returns 404. It's just the default app you get when you run dotnet new web with orgnalR added.

bbehrens commented 1 year ago

We got the app to run, but IMO it's a ways off from where it needs to be for the community to really engage with this library. I'm going to close this issue, but would like to discuss what needs to happen to get this in a more usable state. I never got an email or anything from you that I saw. Would you be available to discuss outside of Github?

LiamMorrow commented 1 year ago

Ah that's good news! Yeah I'll definitely grant that it's not the most sophisticated, just something I whipped up to show that it works. I have considered the idea of porting the ones in SignalR.Orleans, but it's been competing with my time.

Weird you're not getting my emails, I sent them to your gmail one on your profile. However feel free to reach out to me on ldmorrow@outlook.com