Commit Graph
13619 Commits
Author SHA1 Message Date
John Colvin b020939c99 refactor: Add lib_system proj for common utils
Migrates the following:
* Delegate.h
* bts_array_size.h
* string_utils.h

Note: File names in the new lib are snake_case (this seems to be the
standard naming convention for c++).
2024-10-30 19:31:40 +00:00
John Colvin c660c52c3d cleanup: Trivial whitespace cleanup in sparkd CMakeLists 2024-10-30 19:31:40 +00:00
John Colvin 37322fccb1 build: Add cmake fns to symlink and install local libs
The code needed to do this (inline) is ugly and verbose
2024-10-30 19:31:40 +00:00
John Colvin 40ae9ff7a0 cleanup: Use conventional UPPER_CASE var names in sparkd CMakeLists 2024-10-30 19:31:40 +00:00
John Colvin 60bcbe67e4 cleanup: Trivial whitespace cleanup in Protobuf.cmake 2024-10-30 19:31:40 +00:00
John Colvin b983f80bfa build: Clean up data_files cmake proj (support --target clean) 2024-10-30 19:31:40 +00:00
John Colvin c58a2f90e0 refactor: Organize libspark proj w/ stuttering include
This new structure provides several benefits:

* Allows us to install multiple CMake projects in the same destination
  dir (without include path conflicts).
  - This makes shipping the trading algo sdk a trivial excercise. Simply
    copy the lib and include dirs from the install dest. That's it!
* Puts us in a position to break up the monolithic libspark into smaller
  modules, which are easier to manage.
2024-10-30 19:31:40 +00:00
John Colvin 2515030501 vscode: Add debug cfg to skip sparkd build 2024-10-30 19:31:40 +00:00
John Colvin 7146aca538 fix build: Add ShmSegmentName.cpp to windows client sources 2024-10-30 19:31:40 +00:00
John Colvin e0f01b6810 Make a few timestamp fns const
They should have been const in the first place
2024-10-30 19:31:40 +00:00
John Colvin 92e3094259 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-30 19:31:40 +00:00
John Colvin a9a5b563a0 Add api server to docker compose 2024-10-30 19:31:40 +00:00
John Colvin 84183d2741 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-30 19:31:40 +00:00
John Colvin acb44c836d cleanup: Remove unnecessary env vars from webapp docker compose 2024-10-30 19:31:40 +00:00
John Colvin cb5c7d2012 Change api server ports so they don't conflict w/ ds webapp 2024-10-30 19:31:40 +00:00
John Colvin fefb848281 vscode: Fix sparkd debug config 2024-10-30 19:31:40 +00:00
John Colvin 3af14cecd7 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-30 19:31:40 +00:00
John Colvin 5df30e8857 Don't log "initializing spark config" if it has already been initialized 2024-10-30 19:31:40 +00:00
John Colvin d813a6a2c6 vscode: Add debug cfg for spark api server 2024-10-30 19:31:40 +00:00
John Colvin b3e28d5f7f Use dependency injection in spark api server 2024-10-30 19:31:40 +00:00
John Colvin 5c11b83df5 Add SparkLoggerAdapter for Msft ILogger 2024-10-30 19:31:40 +00:00
John Colvin 5c5a0ca09a Display exception stack trace w/ 1 call per line in ds webapp 2024-10-30 19:31:40 +00:00
John Colvin 114873eb35 Remove unused ErrorView from ds webapp 2024-10-30 19:31:40 +00:00
John Colvin a9799b2a00 Propagate ViewStream errors to webapp frontend 2024-10-30 19:31:40 +00:00
John Colvin d5aeaa5e0f Add ErrorChanged event to propagate DataStream exceptions 2024-10-30 19:31:40 +00:00
John Colvin 8a8c491fb1 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-30 19:31:39 +00:00
John Colvin 450a6c62b6 Improve alignment/spacing in ds webapp 2024-10-30 19:31:39 +00:00
John Colvin a3887e6246 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-30 19:31:39 +00:00
John Colvin 982ddd24d4 Remove "BTS Cloud Streams" title from webapp
Space is precious when viewing on phone (tbh, it didn't look that good
anyways).
2024-10-30 19:31:39 +00:00
John Colvin 20e959fea3 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-30 19:31:39 +00:00
John Colvin a108823ea5 Replace ErrorView component w/ robust QueryStatusView 2024-10-30 19:31:39 +00:00
John Colvin 52c74cd800 Fix typos in query button theme 2024-10-30 19:31:39 +00:00
John Colvin a473cbc703 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-30 19:31:39 +00:00
John Colvin 63c648a659 Change VITE_DATASTREAM_WEBSOCKET_URL to localhost 2024-10-30 19:31:39 +00:00
John Colvin 3ffe02254e Assert that local ip address is successfully obtained 2024-10-30 19:31:39 +00:00
John Colvin f5de2b5355 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-30 19:31:39 +00:00
John Colvin 979b51fb20 Assert TcpConnection endpoint matches expected 2024-10-30 19:31:39 +00:00
John Colvin 4efb0bfc42 Fix typo in log msg (was missing interpolation '$') 2024-10-30 19:31:39 +00:00
John Colvin f925be32a6 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-30 19:31:39 +00:00
John Colvin f3b5ff8970 fix: Format PubSubRoute as json in log msgs
It was previously using the default ToString, which simply returns the type name
2024-10-30 19:31:39 +00:00
John Colvin fdea340492 build: Upgrade packages (deps) in DataStreamTests 2024-10-30 19:31:39 +00:00
John Colvin 5ce2ffa5d6 cleanup: Remove unused ViewStreamDatabase config 2024-10-30 19:31:39 +00:00
John Colvin cdae65b098 vscode: Add PubSubServer debug cfg to skip build 2024-10-30 19:31:39 +00:00
John Colvin a1d7607065 Configure apps as a distributed system via Docker compose 2024-10-30 19:31:39 +00:00
John Colvin 233d089c34 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-30 19:31:39 +00:00
John Colvin 759f6dd59a refactor: Run RemoteQueryManager as an IHostedService
This paradigm more accurately represents the RemoteQueryManager as a
Service that can be started/stopped.
2024-10-30 19:31:39 +00:00
John Colvin 80622ddaba Remove inappropriate "Unable to dispose subscription" log msg 2024-10-30 19:31:39 +00:00
John Colvin 434d4b6ad3 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-30 19:31:39 +00:00
John Colvin a90e8807ad Move misplaced log abt initializing query text to appropriate place 2024-10-30 19:31:39 +00:00
John Colvin 6dc25bab01 Assert ViewStreamDatabase.instance is only created once
The instance must be initialized via ViewStreamDatabase.SetGlobalInstance
2024-10-30 19:31:39 +00:00