Commit Graph
281 Commits
Author SHA1 Message Date
John Colvin b20c38bd1a build: Resolve app data dir and shared mem prefix at runtime
We really can't define them at compile time anymore as we build multiple
exes that depend on libspark in the same dir (e.g., spark api server,
pubsub, ds-publisher, webapp, etc.). That means one libspark.so (or dll)
must serve all exes. We should compile a consistent libspark to mitigate
the risk of running an exe with the wrong version (of libspark). For
example, running pubsub with a libspark configured for spark api server,
leftover from an earlier build.
2024-11-29 14:58:54 +00:00
John Colvin badb5e4c2d Display exception stack trace w/ 1 call per line in ds webapp 2024-11-29 14:57:44 +00:00
John Colvin 7d870d925b Remove unused ErrorView from ds webapp 2024-11-29 14:57:44 +00:00
John Colvin a47fc311b3 Propagate ViewStream errors to webapp frontend 2024-11-29 14:57:44 +00:00
John Colvin 4e63428540 Add ErrorChanged event to propagate DataStream exceptions 2024-11-29 14:57:44 +00:00
John Colvin 29b305635d Set columns to empty array rather than null in ds webapp
If no data has been received. Since the 'columns' property was marked
'required', this eliminates a warning that was being logged to console.
2024-11-29 14:57:44 +00:00
John Colvin ef10ae6075 Improve alignment/spacing in ds webapp 2024-11-29 14:57:44 +00:00
John Colvin 7e8ee6a22c Configure datastream deployment with docker-compose
To deploy to aws, connect to our aws vpn then run:
tools/deploy-docker-compose.sh

The deploy script does the following:
* builds sparkd
* builds datastream apps (pubsub, md-publisher, and webapp)
* uploads the build to aws
* bounces all services (sparkd, pubsub, md-publisher, and webapp)

Note: the name 'md-publisher' refers to DataStreamPublisher w/ MarketData
configuration
2024-11-29 14:57:44 +00:00
John Colvin 95d3f643d5 Remove "BTS Cloud Streams" title from webapp
Space is precious when viewing on phone (tbh, it didn't look that good
anyways).
2024-11-29 14:57:44 +00:00
John Colvin 5819bfdd87 fix: Ensure md-publisher waits for pubsub and sparkd
Bugs (fixed):
  * md-publisher silently fails if it tries to connect before those services are "ready".

The Docker compose "depends_on" property ensures sparkd and pubsub
containers are up, but doesn't prevent startup race bugs (e.g., if
md-publisher and pubsub start around the same time, and md-publisher
tries to connect before pubsub has started accepting connections). To
address these race conditions, we use a nifty tool called "dockerize"

References:
  * https://github.com/jwilder/dockerize
2024-11-29 14:57:44 +00:00
John Colvin 61427533d3 Replace ErrorView component w/ robust QueryStatusView 2024-11-29 14:57:44 +00:00
John Colvin a84af452af Fix typos in query button theme 2024-11-29 14:57:44 +00:00
John Colvin c1bdd09d80 fix: Don't assert on exception in BooleanExpression.evaluate
Bugs (fixed):
  * DataStream WebApp Server sometimes crashes when the user enters a
    bad query.
2024-11-29 14:57:44 +00:00
John Colvin 9de72db6fd Change VITE_DATASTREAM_WEBSOCKET_URL to localhost 2024-11-29 14:57:44 +00:00
John Colvin dd0e46b6f8 Assert that local ip address is successfully obtained 2024-11-29 14:57:44 +00:00
John Colvin 1b5a4aad61 improvement: Resolve hostnames when comparing ip addrs
So we can to configure pubsub routes by hostname or ipv4 (ipv6 hasn't been
tested yet...so we should assume it doesn't work).
2024-11-29 14:57:44 +00:00
John Colvin 1bd8765f39 Assert TcpConnection endpoint matches expected 2024-11-29 14:57:44 +00:00
John Colvin 493f7229f3 Fix typo in log msg (was missing interpolation '$') 2024-11-29 14:57:44 +00:00
John Colvin 0ad996a959 Catch exceptions on AsyncTCPConnector_AsyncWrapper background thread
Since it spawns a new thread on each attempt, uncaught exceptions were previously undetected,
and caused silent failures down the pipe. This should make it easier to track such bugs down.
2024-11-29 14:57:44 +00:00
John Colvin 4c5a3fa229 fix: Format PubSubRoute as json in log msgs
It was previously using the default ToString, which simply returns the type name
2024-11-29 14:57:44 +00:00
John Colvin 565b004ea5 build: Upgrade packages (deps) in DataStreamTests 2024-11-29 14:57:44 +00:00
John Colvin 92952eb9e9 cleanup: Remove unused ViewStreamDatabase config 2024-11-29 14:57:44 +00:00
John Colvin 00c110beb2 Configure apps as a distributed system via Docker compose 2024-11-29 14:57:44 +00:00
John Colvin 86448372cb Remove reference to spark protobuf Config in ViewStream
We can't read spark protobuf Config until it has been initialized,
and since ViewStream doesn't have the configServer param handy it
isn't able to initialize config if necessary. In that case, it would simply
block until config was initialized by someone else. Such a risk doesn't
seem justified for this particular configuration dependency
(DataStreamConfig.UseUncopiedNewRowsInFire). For now, its hardcoded to false.
2024-11-29 14:57:44 +00:00
John Colvin 525bb61140 refactor: Run RemoteQueryManager as an IHostedService
This paradigm more accurately represents the RemoteQueryManager as a
Service that can be started/stopped.
2024-11-29 14:57:44 +00:00
John Colvin b49e392915 Remove inappropriate "Unable to dispose subscription" log msg 2024-11-29 14:57:44 +00:00
John Colvin 2241da9f9e Move misplaced log abt initializing query text to appropriate place 2024-11-29 14:57:44 +00:00
John Colvin 659e387841 Assert ViewStreamDatabase.instance is only created once
The instance must be initialized via ViewStreamDatabase.SetGlobalInstance
2024-11-29 14:57:44 +00:00
John Colvin 1a408fe86d cleanup: Remove unused code from ViewStreamDatabase 2024-11-29 14:57:44 +00:00
John Colvin 5b9302a3f0 Include subscription id in ds websocket updates 2024-11-29 14:57:44 +00:00
John Colvin dc5a5c858f fix: Define BoooleanConstant before StringConstant
Otherwise the former masks the latter and prevents it from matching
2024-11-29 14:57:44 +00:00
John Colvin 3dec8153f6 Log event data in websocket open, close, error callbacks 2024-11-29 14:57:44 +00:00
John Colvin 2b47263453 refactor: Bring back Material DataGrid
Fix the column resize bugs that made it previously unusable
2024-11-29 14:57:44 +00:00
John Colvin 4539113b70 refactor: Improve react webapp state management
* Add queryTextResetTime as part of the CannedQuery state
  (the QueryControl compares the canned query click time with the time of the
  last user input, and applies the text from the most recent change)

* Replace 'isRunning' (bool) with a 'queryState' (string) to reflect the subscription status
  value received from the server. Less indirection this way.

* Replace inappropriate useMemo call w/ useEffect
2024-11-29 14:57:44 +00:00
John Colvin f6bac8750b cleanup: Get rid of magic const (subscriptionId) in webapp App.jsx 2024-11-29 14:57:44 +00:00
John Colvin 8933523731 cleanup: Remove unnecessary deps from csprojs 2024-11-29 14:57:44 +00:00
John Colvin 563ef13420 fix: Downgrade Microsoft.Extensions.Hosting to 7.0.1
A handful of csprojs were referencing version 8.0.0. Since that version
targets net8.0, I have no idea why it didn't cause the build to fail.
Instead, this framework mismatch led to a mysterious runtime crash with
the following error, despite the dll in question being present in the
build dir:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The system cannot find the file specified.

It is worth noting that this crash would only happen for exes published
as part of the DataStreamSuite.sln with the "--self-contained" flag. For
example, the Bts.DataStreamSuite.Server exe would always fail if
published via:

dotnet publish --configuration Release --sc --framework net7.0 --runtime linux-x64 <DataStreamSuite.sln>
2024-11-29 14:57:44 +00:00
John Colvin ffd07b96e3 Add HttpsRedirection middleware first in the webapp pipeline
Middleware handlers are invoked in the order in which they are added. Any middleware
that is added before HttpsRedirection may can prevent the request from being redirected.
As of now, only development-specific middleware is added ahead of HttpsRedircetion.
2024-11-29 14:57:44 +00:00
John Colvin 435bad013f build: Copy configuration profiles to build dir
So they are readily available to publish/deploy scripts.
2024-11-29 14:57:44 +00:00
John Colvin 8326abdf10 fix: Catch exception when creating TcpClient 2024-11-29 14:57:44 +00:00
John Colvin 66697830a0 fix: Catch WebSocketException in DataStreamSubscription 2024-11-29 14:57:44 +00:00
John Colvin 35d2016670 fix: Add null check to NonIncGroupByStream 2024-11-29 14:57:44 +00:00
John Colvin be18e269a3 fix: Add null check to TableAccumulator2 2024-11-29 14:57:44 +00:00
John Colvin 6865485d55 fix: Make SystemSubscriptionMapPublisher threadsafe
The PubSubState.onTagMapChanged event may not be invoked on
the same thread as doWork.
2024-11-29 14:57:44 +00:00
John Colvin a6b7ddbe38 fix: Add null check in TimeBasedFilter.cs 2024-11-29 14:57:44 +00:00
John Colvin 4ebb02810f Reduce task wait/timeout code in AsyncTCPConnector 2024-11-29 14:57:43 +00:00
John Colvin 0ffc8cb9b6 Add a few canned queries to AwsProd.json for ds webapp 2024-11-29 14:57:43 +00:00
John Colvin da14a2b4ae fix: Copy canned queries to clipboard on click
Instead of trying to update the text directly, which causes the front end
to overwrite the user's changes everytime the data updates from then on.
2024-11-29 14:57:43 +00:00
John Colvin 6fd6a0dd55 fix: Convert invalid doubles to nan in ds webapp serializer 2024-11-29 14:57:43 +00:00
John Colvin b9a5e91cad Increase datagrid maxheight in ds webapp to 1000px 2024-11-29 14:57:43 +00:00