Commit Graph
13610 Commits
Author SHA1 Message Date
John Colvin 5efd2d1663 fix build: Add ShmSegmentName.cpp to windows client sources 2024-10-21 13:29:59 +00:00
John Colvin fe88e570a2 Make a few timestamp fns const
They should have been const in the first place
2024-10-21 13:29:59 +00:00
John Colvin afad713f4e Add config profiles to libspark
This is part of a larger effort to unify the libspark build, and eliminate
compile time differences between the builds used by our various services
2024-10-21 13:29:59 +00:00
John Colvin 99da1d3dc3 Add api server to docker compose 2024-10-21 13:29:59 +00:00
John Colvin 48832dd75d Rename pingtest "sparkd-ping-test", make it depend on sparkd
Add it to a "ping-test" profile, as we may add similar tests for other services
2024-10-21 13:29:59 +00:00
John Colvin 60f1165dae cleanup: Remove unnecessary env vars from webapp docker compose 2024-10-21 13:29:59 +00:00
John Colvin fc3990912c Change api server ports so they don't conflict w/ ds webapp 2024-10-21 13:29:59 +00:00
John Colvin 277f0d3660 vscode: Fix sparkd debug config 2024-10-21 13:29:59 +00:00
John Colvin a0d8dfd3de 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-10-21 13:29:59 +00:00
John Colvin 413bdf0403 Don't log "initializing spark config" if it has already been initialized 2024-10-21 13:29:59 +00:00
John Colvin 1f61c37c79 vscode: Add debug cfg for spark api server 2024-10-21 13:29:59 +00:00
John Colvin ddb1302a08 Use dependency injection in spark api server 2024-10-21 13:29:59 +00:00
John Colvin e34fdac548 Add SparkLoggerAdapter for Msft ILogger 2024-10-21 13:29:59 +00:00
John Colvin 6a88337355 Display exception stack trace w/ 1 call per line in ds webapp 2024-10-21 13:29:59 +00:00
John Colvin 5cd558d402 Remove unused ErrorView from ds webapp 2024-10-21 13:29:59 +00:00
John Colvin 7f87644b10 Propagate ViewStream errors to webapp frontend 2024-10-21 13:29:59 +00:00
John Colvin 3e36a4ded5 Add ErrorChanged event to propagate DataStream exceptions 2024-10-21 13:29:59 +00:00
John Colvin 81f27e0dc5 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-10-21 13:29:59 +00:00
John Colvin 10f1eb9144 Improve alignment/spacing in ds webapp 2024-10-21 13:29:59 +00:00
John Colvin 146a52f0ab 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-10-21 13:29:59 +00:00
John Colvin 179926ce94 Remove "BTS Cloud Streams" title from webapp
Space is precious when viewing on phone (tbh, it didn't look that good
anyways).
2024-10-21 13:29:59 +00:00
John Colvin 6fef5410a2 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-10-21 13:29:59 +00:00
John Colvin 7f94366389 Replace ErrorView component w/ robust QueryStatusView 2024-10-21 13:29:59 +00:00
John Colvin aca2f92fcc Fix typos in query button theme 2024-10-21 13:29:59 +00:00
John Colvin a330e22beb fix: Don't assert on exception in BooleanExpression.evaluate
Bugs (fixed):
  * DataStream WebApp Server sometimes crashes when the user enters a
    bad query.
2024-10-21 13:29:59 +00:00
John Colvin e078043829 Change VITE_DATASTREAM_WEBSOCKET_URL to localhost 2024-10-21 13:29:59 +00:00
John Colvin 6b2d9c0bc3 Assert that local ip address is successfully obtained 2024-10-21 13:29:59 +00:00
John Colvin bd95260cc1 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-10-21 13:29:59 +00:00
John Colvin a697cc4958 Assert TcpConnection endpoint matches expected 2024-10-21 13:29:59 +00:00
John Colvin 596478d978 Fix typo in log msg (was missing interpolation '$') 2024-10-21 13:29:59 +00:00
John Colvin 6cace25a7c 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-10-21 13:29:59 +00:00
John Colvin 6a723b913f fix: Format PubSubRoute as json in log msgs
It was previously using the default ToString, which simply returns the type name
2024-10-21 13:29:59 +00:00
John Colvin 4afbca2e05 build: Upgrade packages (deps) in DataStreamTests 2024-10-21 13:29:59 +00:00
John Colvin 17efe0a411 cleanup: Remove unused ViewStreamDatabase config 2024-10-21 13:29:59 +00:00
John Colvin e4edcfba53 vscode: Add PubSubServer debug cfg to skip build 2024-10-21 13:29:59 +00:00
John Colvin 6a881c8f2b Configure apps as a distributed system via Docker compose 2024-10-21 13:29:59 +00:00
John Colvin 4c5c4388b5 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-10-21 13:29:59 +00:00
John Colvin e8f5407e2f refactor: Run RemoteQueryManager as an IHostedService
This paradigm more accurately represents the RemoteQueryManager as a
Service that can be started/stopped.
2024-10-21 13:29:59 +00:00
John Colvin 3f0d3889d7 Remove inappropriate "Unable to dispose subscription" log msg 2024-10-21 13:29:59 +00:00
John Colvin 5bfbaf9976 fix: Ensure spark config init and login are only performed once
As a static function that could be called from anywhere in the code
(directly or indirectly), 'Configuration.Initialize' was vulnerable to
race bugs. The "Configuration.get<T>()" method, whose calls are
ubiquitous in our code, would initialize config if it hadn't been done
so already. Without a reference to the configServer param, this param
would effectively be ignored/overridden with null.

It's important that login only be performed once, for obvious reasons
(our exes that connect to sparkd are generally designed to process data
for a single user). Furthermore, not every routine that requires a
successful login has a reference to the credentials needed to do it. To
address this, we now pass the ISparkdLoginService singleton to these
routines so they can wait until the singular login task has completed
before they begin.
2024-10-21 13:29:59 +00:00
John Colvin 0435fbee94 Move misplaced log abt initializing query text to appropriate place 2024-10-21 13:29:59 +00:00
John Colvin c5ff2aa03d Assert ViewStreamDatabase.instance is only created once
The instance must be initialized via ViewStreamDatabase.SetGlobalInstance
2024-10-21 13:29:59 +00:00
John Colvin 8d7f1469cc cleanup: Remove unused code from ViewStreamDatabase 2024-10-21 13:29:59 +00:00
John Colvin ecbf9d083c Include subscription id in ds websocket updates 2024-10-21 13:29:59 +00:00
John Colvin de3300de02 fix: Define BoooleanConstant before StringConstant
Otherwise the former masks the latter and prevents it from matching
2024-10-21 13:29:59 +00:00
John Colvin c92f219357 Log event data in websocket open, close, error callbacks 2024-10-21 13:29:59 +00:00
John Colvin 65d8af4939 refactor: Bring back Material DataGrid
Fix the column resize bugs that made it previously unusable
2024-10-21 13:29:59 +00:00
John Colvin 2342670c66 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-10-21 13:29:59 +00:00
John Colvin d8bf2d3cda cleanup: Get rid of magic const (subscriptionId) in webapp App.jsx 2024-10-21 13:29:59 +00:00
John Colvin 86e0378008 build: Copy configuration profiles to publish dir 2024-10-21 13:29:59 +00:00