kuhl-haus-mdp-servers 0.0.3__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kuhl_haus_mdp_servers-0.1.3/LICENSE.txt +21 -0
- kuhl_haus_mdp_servers-0.1.3/PKG-INFO +117 -0
- kuhl_haus_mdp_servers-0.1.3/README.md +86 -0
- {kuhl_haus_mdp_servers-0.0.3 → kuhl_haus_mdp_servers-0.1.3}/pyproject.toml +75 -21
- {kuhl_haus_mdp_servers-0.0.3 → kuhl_haus_mdp_servers-0.1.3}/src/kuhl_haus/servers/mdl_server.py +7 -7
- {kuhl_haus_mdp_servers-0.0.3 → kuhl_haus_mdp_servers-0.1.3}/src/kuhl_haus/servers/mdp_server.py +1 -1
- {kuhl_haus_mdp_servers-0.0.3 → kuhl_haus_mdp_servers-0.1.3}/src/kuhl_haus/servers/wds_server.py +1 -11
- kuhl_haus_mdp_servers-0.0.3/PKG-INFO +0 -23
- kuhl_haus_mdp_servers-0.0.3/README.md +0 -2
- kuhl_haus_mdp_servers-0.0.3/setup.cfg +0 -28
- kuhl_haus_mdp_servers-0.0.3/setup.py +0 -22
- kuhl_haus_mdp_servers-0.0.3/src/kuhl_haus_mdp_servers.egg-info/PKG-INFO +0 -23
- kuhl_haus_mdp_servers-0.0.3/src/kuhl_haus_mdp_servers.egg-info/SOURCES.txt +0 -15
- kuhl_haus_mdp_servers-0.0.3/src/kuhl_haus_mdp_servers.egg-info/dependency_links.txt +0 -1
- kuhl_haus_mdp_servers-0.0.3/src/kuhl_haus_mdp_servers.egg-info/entry_points.txt +0 -4
- kuhl_haus_mdp_servers-0.0.3/src/kuhl_haus_mdp_servers.egg-info/requires.txt +0 -7
- kuhl_haus_mdp_servers-0.0.3/src/kuhl_haus_mdp_servers.egg-info/top_level.txt +0 -1
- kuhl_haus_mdp_servers-0.0.3/src/kuhl_haus_mdp_servers.egg-info/zip-safe +0 -1
- {kuhl_haus_mdp_servers-0.0.3 → kuhl_haus_mdp_servers-0.1.3}/src/kuhl_haus/servers/__init__.py +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kuhl Haus
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kuhl-haus-mdp-servers
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Container image build repository for market data processing servers
|
|
5
|
+
Author-Email: Tom Pounders <git@oldschool.engineer>
|
|
6
|
+
License-File: LICENSE.txt
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Programming Language :: Python
|
|
9
|
+
Project-URL: Homepage, https://github.com/kuhl-haus/kuhl-haus-mdp-servers
|
|
10
|
+
Project-URL: Documentation, https://github.com/kuhl-haus/kuhl-haus-mdp-servers/wiki
|
|
11
|
+
Project-URL: Source, https://github.com/kuhl-haus/kuhl-haus-mdp-servers.git
|
|
12
|
+
Project-URL: Changelog, https://github.com/kuhl-haus/kuhl-haus-mdp-servers/commits
|
|
13
|
+
Project-URL: Tracker, https://github.com/kuhl-haus/kuhl-haus-mdp-servers/issues
|
|
14
|
+
Requires-Python: <3.13,>=3.9.21
|
|
15
|
+
Requires-Dist: kuhl-haus-mdp
|
|
16
|
+
Requires-Dist: websockets
|
|
17
|
+
Requires-Dist: aio-pika
|
|
18
|
+
Requires-Dist: redis[asyncio]
|
|
19
|
+
Requires-Dist: tenacity
|
|
20
|
+
Requires-Dist: fastapi
|
|
21
|
+
Requires-Dist: uvicorn[standard]
|
|
22
|
+
Requires-Dist: pydantic-settings
|
|
23
|
+
Requires-Dist: python-dotenv
|
|
24
|
+
Requires-Dist: massive
|
|
25
|
+
Provides-Extra: testing
|
|
26
|
+
Requires-Dist: setuptools; extra == "testing"
|
|
27
|
+
Requires-Dist: pdm-backend; extra == "testing"
|
|
28
|
+
Requires-Dist: pytest; extra == "testing"
|
|
29
|
+
Requires-Dist: pytest-cov; extra == "testing"
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/blob/mainline/LICENSE.txt)
|
|
34
|
+
[](https://pypi.org/project/kuhl-haus-mdp-servers/)
|
|
35
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/releases)
|
|
36
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/actions/workflows/build-images.yml)
|
|
37
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/actions/workflows/codeql.yml)
|
|
38
|
+
[](https://pepy.tech/project/kuhl-haus-mdp-servers)
|
|
39
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/branches)
|
|
40
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/issues)
|
|
41
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/pulls)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# kuhl-haus-mdp-servers
|
|
46
|
+
Container image build repository for market data processing servers
|
|
47
|
+
|
|
48
|
+
## TL;DR
|
|
49
|
+
Non-business Massive (AKA Polygon.IO) accounts are limited to a single WebSocket connection per asset class and it has to be fast enough to handle messages in a non-blocking fashion or it'll get disconnected. The market data processing pipeline consists of loosely-coupled market data processing components so that a single WebSocket connection can handle messages fast enough to maintain a reliable connection with the market data provider.
|
|
50
|
+
|
|
51
|
+
Per, https://massive.com/docs/websocket/quickstart#connecting-to-the-websocket:
|
|
52
|
+
> *By default, one concurrent WebSocket connection per asset class is allowed. If you require multiple simultaneous connections for the same asset class, please [contact support](https://massive.com/contact).*
|
|
53
|
+
|
|
54
|
+
# Components Summary
|
|
55
|
+
|
|
56
|
+
Non-business Massive (AKA Polygon.IO) accounts are limited to a single WebSocket connection per asset class and it has to be fast enough to handle messages in a non-blocking fashion or it'll get disconnected. The Market Data Listener (MDL) connects to the Market Data Source (Massive) and subscribes to unfiltered feeds. MDL inspects the message type for selecting the appropriate serialization method and destination Market Data Queue (MDQ). The Market Data Processors (MDP) subscribe to raw market data in the MDQ and perform the heavy lifting that would otherwise constrain the message handling speed of the MDL. This decoupling allows the MDP and MDL to scale independently. Post-processed market data is stored in the MDC for consumption by the Widget Data Service (WDS). Client-side widgets receive market data from the WDS, which provides a WebSocket interface to MDC pub/sub streams and cached data.
|
|
57
|
+
|
|
58
|
+
[]
|
|
59
|
+
|
|
60
|
+
# Component Descriptions
|
|
61
|
+
|
|
62
|
+
## Market Data Listener (MDL)
|
|
63
|
+
The MDL performs minimal processing on the messages. MDL inspects the message type for selecting the appropriate serialization method and destination queue. MDL implementations may vary as new MDS become available (for example, news).
|
|
64
|
+
|
|
65
|
+
MDL runs as a container and scales independently of other components. The MDL should not be accessible outside the data plane local network.
|
|
66
|
+
|
|
67
|
+
## Market Data Queues (MDQ)
|
|
68
|
+
|
|
69
|
+
**Purpose:** Buffer high-velocity market data stream for server-side processing with aggressive freshness controls
|
|
70
|
+
- **Queue Type:** FIFO with TTL (5-second max message age)
|
|
71
|
+
- **Cleanup Strategy:** Discarded when TTL expires
|
|
72
|
+
- **Message Format:** Timestamped JSON preserving original Massive.com structure
|
|
73
|
+
- **Durability:** Non-persistent messages (speed over reliability for real-time data)
|
|
74
|
+
- **Independence:** Queues operate completely independently - one queue per subscription
|
|
75
|
+
- **Technology**: RabbitMQ
|
|
76
|
+
|
|
77
|
+
The MDQ should not be accessible outside the data plane local network.
|
|
78
|
+
|
|
79
|
+
## Market Data Processors (MDP)
|
|
80
|
+
The purpose of the MDP is to process raw real-time market data and delegate processing to data-specific handlers. This separation of concerns allows MDPs to handle any type of data and simplifies horizontal scaling. The MDP stores its processed results in the Market Data Cache (MDC).
|
|
81
|
+
|
|
82
|
+
The MDP:
|
|
83
|
+
- Hydrates the in-memory cache on MDC
|
|
84
|
+
- Processes market data
|
|
85
|
+
- Publishes messages to pub/sub channels
|
|
86
|
+
- Maintains cache entries in MDC
|
|
87
|
+
|
|
88
|
+
MDPs runs as containers and scale independently of other components. The MDPs should not be accessible outside the data plane local network.
|
|
89
|
+
|
|
90
|
+
## Market Data Cache (MDC)
|
|
91
|
+
|
|
92
|
+
**Purpose:** In-memory data store for serialized processed market data.
|
|
93
|
+
* **Cache Type**: In-memory persistent or with TTL
|
|
94
|
+
- **Queue Type:** pub/sub
|
|
95
|
+
- **Technology**: Redis
|
|
96
|
+
|
|
97
|
+
The MDC should not be accessible outside the data plane local network.
|
|
98
|
+
|
|
99
|
+
## Widget Data Service (WDS)
|
|
100
|
+
**Purpose**:
|
|
101
|
+
1. WebSocket interface provides access to processed market data for client-side code
|
|
102
|
+
2. Is the network-layer boundary between clients and the data that is available on the data plane
|
|
103
|
+
|
|
104
|
+
WDS runs as a container and scales independently of other components. WDS is the only data plane component that should be exposed to client networks.
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
## Service Control Plane (SCP)
|
|
108
|
+
**Purpose**:
|
|
109
|
+
1. Authentication and authorization
|
|
110
|
+
2. Serve static and dynamic content via py4web
|
|
111
|
+
3. Serve SPA to authenticated clients
|
|
112
|
+
4. Injects authentication token and WDS url into SPA environment for authenticated access to WDS
|
|
113
|
+
5. Control plane for managing application components at runtime
|
|
114
|
+
6. API for programmatic access to service controls and instrumentation.
|
|
115
|
+
|
|
116
|
+
The SCP requires access to the data plane network for API access to data plane components.
|
|
117
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
|
|
2
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/blob/mainline/LICENSE.txt)
|
|
3
|
+
[](https://pypi.org/project/kuhl-haus-mdp-servers/)
|
|
4
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/releases)
|
|
5
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/actions/workflows/build-images.yml)
|
|
6
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/actions/workflows/codeql.yml)
|
|
7
|
+
[](https://pepy.tech/project/kuhl-haus-mdp-servers)
|
|
8
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/branches)
|
|
9
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/issues)
|
|
10
|
+
[](https://github.com/kuhl-haus/kuhl-haus-mdp-servers/pulls)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# kuhl-haus-mdp-servers
|
|
15
|
+
Container image build repository for market data processing servers
|
|
16
|
+
|
|
17
|
+
## TL;DR
|
|
18
|
+
Non-business Massive (AKA Polygon.IO) accounts are limited to a single WebSocket connection per asset class and it has to be fast enough to handle messages in a non-blocking fashion or it'll get disconnected. The market data processing pipeline consists of loosely-coupled market data processing components so that a single WebSocket connection can handle messages fast enough to maintain a reliable connection with the market data provider.
|
|
19
|
+
|
|
20
|
+
Per, https://massive.com/docs/websocket/quickstart#connecting-to-the-websocket:
|
|
21
|
+
> *By default, one concurrent WebSocket connection per asset class is allowed. If you require multiple simultaneous connections for the same asset class, please [contact support](https://massive.com/contact).*
|
|
22
|
+
|
|
23
|
+
# Components Summary
|
|
24
|
+
|
|
25
|
+
Non-business Massive (AKA Polygon.IO) accounts are limited to a single WebSocket connection per asset class and it has to be fast enough to handle messages in a non-blocking fashion or it'll get disconnected. The Market Data Listener (MDL) connects to the Market Data Source (Massive) and subscribes to unfiltered feeds. MDL inspects the message type for selecting the appropriate serialization method and destination Market Data Queue (MDQ). The Market Data Processors (MDP) subscribe to raw market data in the MDQ and perform the heavy lifting that would otherwise constrain the message handling speed of the MDL. This decoupling allows the MDP and MDL to scale independently. Post-processed market data is stored in the MDC for consumption by the Widget Data Service (WDS). Client-side widgets receive market data from the WDS, which provides a WebSocket interface to MDC pub/sub streams and cached data.
|
|
26
|
+
|
|
27
|
+
[]
|
|
28
|
+
|
|
29
|
+
# Component Descriptions
|
|
30
|
+
|
|
31
|
+
## Market Data Listener (MDL)
|
|
32
|
+
The MDL performs minimal processing on the messages. MDL inspects the message type for selecting the appropriate serialization method and destination queue. MDL implementations may vary as new MDS become available (for example, news).
|
|
33
|
+
|
|
34
|
+
MDL runs as a container and scales independently of other components. The MDL should not be accessible outside the data plane local network.
|
|
35
|
+
|
|
36
|
+
## Market Data Queues (MDQ)
|
|
37
|
+
|
|
38
|
+
**Purpose:** Buffer high-velocity market data stream for server-side processing with aggressive freshness controls
|
|
39
|
+
- **Queue Type:** FIFO with TTL (5-second max message age)
|
|
40
|
+
- **Cleanup Strategy:** Discarded when TTL expires
|
|
41
|
+
- **Message Format:** Timestamped JSON preserving original Massive.com structure
|
|
42
|
+
- **Durability:** Non-persistent messages (speed over reliability for real-time data)
|
|
43
|
+
- **Independence:** Queues operate completely independently - one queue per subscription
|
|
44
|
+
- **Technology**: RabbitMQ
|
|
45
|
+
|
|
46
|
+
The MDQ should not be accessible outside the data plane local network.
|
|
47
|
+
|
|
48
|
+
## Market Data Processors (MDP)
|
|
49
|
+
The purpose of the MDP is to process raw real-time market data and delegate processing to data-specific handlers. This separation of concerns allows MDPs to handle any type of data and simplifies horizontal scaling. The MDP stores its processed results in the Market Data Cache (MDC).
|
|
50
|
+
|
|
51
|
+
The MDP:
|
|
52
|
+
- Hydrates the in-memory cache on MDC
|
|
53
|
+
- Processes market data
|
|
54
|
+
- Publishes messages to pub/sub channels
|
|
55
|
+
- Maintains cache entries in MDC
|
|
56
|
+
|
|
57
|
+
MDPs runs as containers and scale independently of other components. The MDPs should not be accessible outside the data plane local network.
|
|
58
|
+
|
|
59
|
+
## Market Data Cache (MDC)
|
|
60
|
+
|
|
61
|
+
**Purpose:** In-memory data store for serialized processed market data.
|
|
62
|
+
* **Cache Type**: In-memory persistent or with TTL
|
|
63
|
+
- **Queue Type:** pub/sub
|
|
64
|
+
- **Technology**: Redis
|
|
65
|
+
|
|
66
|
+
The MDC should not be accessible outside the data plane local network.
|
|
67
|
+
|
|
68
|
+
## Widget Data Service (WDS)
|
|
69
|
+
**Purpose**:
|
|
70
|
+
1. WebSocket interface provides access to processed market data for client-side code
|
|
71
|
+
2. Is the network-layer boundary between clients and the data that is available on the data plane
|
|
72
|
+
|
|
73
|
+
WDS runs as a container and scales independently of other components. WDS is the only data plane component that should be exposed to client networks.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## Service Control Plane (SCP)
|
|
77
|
+
**Purpose**:
|
|
78
|
+
1. Authentication and authorization
|
|
79
|
+
2. Serve static and dynamic content via py4web
|
|
80
|
+
3. Serve SPA to authenticated clients
|
|
81
|
+
4. Injects authentication token and WDS url into SPA environment for authenticated access to WDS
|
|
82
|
+
5. Control plane for managing application components at runtime
|
|
83
|
+
6. API for programmatic access to service controls and instrumentation.
|
|
84
|
+
|
|
85
|
+
The SCP requires access to the data plane network for API access to data plane components.
|
|
86
|
+
|
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = [
|
|
3
|
-
|
|
2
|
+
requires = [
|
|
3
|
+
"pdm-backend",
|
|
4
|
+
"setuptools>=61.0",
|
|
5
|
+
]
|
|
6
|
+
build-backend = "pdm.backend"
|
|
4
7
|
|
|
5
8
|
[project]
|
|
6
9
|
name = "kuhl-haus-mdp-servers"
|
|
7
|
-
|
|
10
|
+
dynamic = []
|
|
8
11
|
description = "Container image build repository for market data processing servers"
|
|
9
12
|
authors = [
|
|
10
13
|
{ name = "Tom Pounders", email = "git@oldschool.engineer" },
|
|
11
14
|
]
|
|
12
15
|
readme = "README.md"
|
|
13
16
|
requires-python = "<3.13,>=3.9.21"
|
|
14
|
-
license-files = [
|
|
17
|
+
license-files = [
|
|
18
|
+
"LICENSE.txt",
|
|
19
|
+
]
|
|
15
20
|
classifiers = [
|
|
16
21
|
"Development Status :: 4 - Beta",
|
|
17
|
-
"Programming Language :: Python"
|
|
22
|
+
"Programming Language :: Python",
|
|
18
23
|
]
|
|
19
24
|
dependencies = [
|
|
20
25
|
"kuhl-haus-mdp",
|
|
26
|
+
"websockets",
|
|
27
|
+
"aio-pika",
|
|
28
|
+
"redis[asyncio]",
|
|
29
|
+
"tenacity",
|
|
30
|
+
"fastapi",
|
|
31
|
+
"uvicorn[standard]",
|
|
32
|
+
"pydantic-settings",
|
|
33
|
+
"python-dotenv",
|
|
34
|
+
"massive",
|
|
21
35
|
]
|
|
36
|
+
version = "0.1.3"
|
|
22
37
|
|
|
23
38
|
[project.urls]
|
|
24
39
|
Homepage = "https://github.com/kuhl-haus/kuhl-haus-mdp-servers"
|
|
@@ -43,32 +58,71 @@ wds_server = "kuhl_haus.servers.wds_server:app"
|
|
|
43
58
|
[tool.setuptools]
|
|
44
59
|
zip-safe = true
|
|
45
60
|
include-package-data = true
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
|
|
62
|
+
[tool.setuptools.package-dir]
|
|
63
|
+
"" = "src"
|
|
64
|
+
|
|
65
|
+
[tool.setuptools.packages.find]
|
|
66
|
+
where = [
|
|
67
|
+
"src",
|
|
68
|
+
]
|
|
69
|
+
exclude = [
|
|
70
|
+
"tests",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[tool.setuptools_scm]
|
|
74
|
+
version_scheme = "guess-next-dev"
|
|
75
|
+
local_scheme = "no-local-version"
|
|
76
|
+
|
|
77
|
+
[tool.pdm]
|
|
78
|
+
distribution = true
|
|
79
|
+
|
|
80
|
+
[tool.pdm.version]
|
|
81
|
+
source = "scm"
|
|
82
|
+
|
|
83
|
+
[tool.pdm.build]
|
|
84
|
+
package-dir = "src"
|
|
85
|
+
includes = [
|
|
86
|
+
"src/kuhl_haus",
|
|
87
|
+
]
|
|
48
88
|
|
|
49
89
|
[tool.pytest.ini_options]
|
|
50
|
-
addopts = [
|
|
51
|
-
|
|
52
|
-
|
|
90
|
+
addopts = [
|
|
91
|
+
"--verbose",
|
|
92
|
+
]
|
|
93
|
+
norecursedirs = [
|
|
94
|
+
"dist",
|
|
95
|
+
"build",
|
|
96
|
+
".tox",
|
|
97
|
+
]
|
|
98
|
+
testpaths = [
|
|
99
|
+
"tests",
|
|
100
|
+
]
|
|
53
101
|
|
|
54
102
|
[tool.devpi.upload]
|
|
55
103
|
no_vcs = 1
|
|
56
|
-
formats = [
|
|
104
|
+
formats = [
|
|
105
|
+
"bdist_wheel",
|
|
106
|
+
]
|
|
57
107
|
|
|
58
108
|
[tool.flake8]
|
|
59
109
|
max_line_length = 88
|
|
60
|
-
extend_ignore = [
|
|
61
|
-
|
|
110
|
+
extend_ignore = [
|
|
111
|
+
"E203",
|
|
112
|
+
"W503",
|
|
113
|
+
]
|
|
114
|
+
exclude = [
|
|
115
|
+
".tox",
|
|
116
|
+
"build",
|
|
117
|
+
"dist",
|
|
118
|
+
".eggs",
|
|
119
|
+
"docs/conf.py",
|
|
120
|
+
]
|
|
62
121
|
|
|
63
122
|
[tool.pyscaffold]
|
|
64
123
|
version = "4.6"
|
|
65
124
|
package = "servers"
|
|
66
|
-
extensions = [
|
|
125
|
+
extensions = [
|
|
126
|
+
"namespace",
|
|
127
|
+
]
|
|
67
128
|
namespace = "kuhl_haus"
|
|
68
|
-
|
|
69
|
-
[tool.pdm]
|
|
70
|
-
distribution = true
|
|
71
|
-
|
|
72
|
-
[tool.pdm.build]
|
|
73
|
-
package-dir = "src"
|
|
74
|
-
includes = ["src/kuhl_haus"]
|
{kuhl_haus_mdp_servers-0.0.3 → kuhl_haus_mdp_servers-0.1.3}/src/kuhl_haus/servers/mdl_server.py
RENAMED
|
@@ -12,12 +12,6 @@ from kuhl_haus.mdp.integ.massive_data_queues import MassiveDataQueues
|
|
|
12
12
|
from kuhl_haus.mdp.integ.massive_data_listener import MassiveDataListener
|
|
13
13
|
from kuhl_haus.mdp.integ.utils import get_massive_api_key
|
|
14
14
|
|
|
15
|
-
logging.basicConfig(
|
|
16
|
-
level=logging.INFO,
|
|
17
|
-
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
|
18
|
-
)
|
|
19
|
-
logger = logging.getLogger(__name__)
|
|
20
|
-
|
|
21
15
|
|
|
22
16
|
class Settings(BaseSettings):
|
|
23
17
|
# TODO: Retrieve Massive client settings from Service Control Plane API call
|
|
@@ -28,7 +22,7 @@ class Settings(BaseSettings):
|
|
|
28
22
|
# The default values can be overridden via environment variable; use the API to manage at runtime.
|
|
29
23
|
feed: Union[str, Feed] = os.environ.get("MASSIVE_FEED", Feed.RealTime)
|
|
30
24
|
market: Union[str, Market] = os.environ.get("MASSIVE_MARKET", Market.Stocks)
|
|
31
|
-
subscriptions: Optional[List[str]] = os.environ.get("MASSIVE_SUBSCRIPTIONS", ["
|
|
25
|
+
subscriptions: Optional[List[str]] = os.environ.get("MASSIVE_SUBSCRIPTIONS", ["AM.*"])
|
|
32
26
|
|
|
33
27
|
# Additional Massive/Polygon.io Settings - default values can be overridden via environment variables
|
|
34
28
|
raw: bool = os.environ.get("MASSIVE_RAW", False)
|
|
@@ -55,6 +49,12 @@ class Settings(BaseSettings):
|
|
|
55
49
|
|
|
56
50
|
settings = Settings()
|
|
57
51
|
|
|
52
|
+
logging.basicConfig(
|
|
53
|
+
level=settings.log_level,
|
|
54
|
+
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
|
55
|
+
)
|
|
56
|
+
logger = logging.getLogger(__name__)
|
|
57
|
+
|
|
58
58
|
# Global state
|
|
59
59
|
massive_data_queues: Optional[MassiveDataQueues] = None
|
|
60
60
|
massive_data_listener: Optional[MassiveDataListener] = None
|
{kuhl_haus_mdp_servers-0.0.3 → kuhl_haus_mdp_servers-0.1.3}/src/kuhl_haus/servers/mdp_server.py
RENAMED
|
@@ -237,7 +237,7 @@ async def health_check(response: Response):
|
|
|
237
237
|
except Exception as e:
|
|
238
238
|
logger.error(f"Health check error: {e}")
|
|
239
239
|
response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE
|
|
240
|
-
return {"status": "ERROR", "message":
|
|
240
|
+
return {"status": "ERROR", "message": "An unhandled exception occurred during health check."}
|
|
241
241
|
|
|
242
242
|
|
|
243
243
|
if __name__ == "__main__":
|
{kuhl_haus_mdp_servers-0.0.3 → kuhl_haus_mdp_servers-0.1.3}/src/kuhl_haus/servers/wds_server.py
RENAMED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import asyncio
|
|
2
1
|
import json
|
|
3
2
|
import logging
|
|
4
3
|
import os
|
|
@@ -18,7 +17,7 @@ class UnauthorizedException(Exception):
|
|
|
18
17
|
|
|
19
18
|
class Settings(BaseSettings):
|
|
20
19
|
# Redis Settings
|
|
21
|
-
redis_url: str = os.environ.get("REDIS_URL", "redis://
|
|
20
|
+
redis_url: str = os.environ.get("REDIS_URL", "redis://localhost:6379/0")
|
|
22
21
|
|
|
23
22
|
# Server Settings
|
|
24
23
|
server_ip: str = os.environ.get("SERVER_IP", "0.0.0.0")
|
|
@@ -80,15 +79,6 @@ async def root():
|
|
|
80
79
|
return RedirectResponse(url="/health")
|
|
81
80
|
|
|
82
81
|
|
|
83
|
-
@app.get("/restart")
|
|
84
|
-
async def restart_wds_service():
|
|
85
|
-
logger.info("Restarting Widget Data Service...")
|
|
86
|
-
await wds_service.stop()
|
|
87
|
-
await asyncio.sleep(1)
|
|
88
|
-
await wds_service.start()
|
|
89
|
-
logger.info("Widget Data Service restarted successfully.")
|
|
90
|
-
|
|
91
|
-
|
|
92
82
|
@app.get("/health", status_code=200)
|
|
93
83
|
async def health_check(response: Response):
|
|
94
84
|
"""Kubernetes health check endpoint."""
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: kuhl-haus-mdp-servers
|
|
3
|
-
Version: 0.0.3
|
|
4
|
-
Summary: Container image build repository for market data processing servers
|
|
5
|
-
Author-email: Tom Pounders <git@oldschool.engineer>
|
|
6
|
-
Project-URL: Homepage, https://github.com/kuhl-haus/kuhl-haus-mdp-servers
|
|
7
|
-
Project-URL: Documentation, https://github.com/kuhl-haus/kuhl-haus-mdp-servers/wiki
|
|
8
|
-
Project-URL: Source, https://github.com/kuhl-haus/kuhl-haus-mdp-servers.git
|
|
9
|
-
Project-URL: Changelog, https://github.com/kuhl-haus/kuhl-haus-mdp-servers/commits
|
|
10
|
-
Project-URL: Tracker, https://github.com/kuhl-haus/kuhl-haus-mdp-servers/issues
|
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Programming Language :: Python
|
|
13
|
-
Requires-Python: <3.13,>=3.9.21
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
Requires-Dist: kuhl-haus-mdp
|
|
16
|
-
Provides-Extra: testing
|
|
17
|
-
Requires-Dist: setuptools; extra == "testing"
|
|
18
|
-
Requires-Dist: pdm-backend; extra == "testing"
|
|
19
|
-
Requires-Dist: pytest; extra == "testing"
|
|
20
|
-
Requires-Dist: pytest-cov; extra == "testing"
|
|
21
|
-
|
|
22
|
-
# kuhl-haus-mdp-servers
|
|
23
|
-
Container image build repository for market data processing servers
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
[options]
|
|
2
|
-
package_dir =
|
|
3
|
-
= src
|
|
4
|
-
zip_safe = True
|
|
5
|
-
include_package_data = True
|
|
6
|
-
|
|
7
|
-
[options.packages.find]
|
|
8
|
-
where = src
|
|
9
|
-
exclude =
|
|
10
|
-
tests
|
|
11
|
-
|
|
12
|
-
[options.package_data]
|
|
13
|
-
kuhl_haus.servers =
|
|
14
|
-
py.typed
|
|
15
|
-
|
|
16
|
-
[tool:pytest]
|
|
17
|
-
addopts =
|
|
18
|
-
--verbose
|
|
19
|
-
norecursedirs =
|
|
20
|
-
dist
|
|
21
|
-
build
|
|
22
|
-
.tox
|
|
23
|
-
testpaths = tests
|
|
24
|
-
|
|
25
|
-
[egg_info]
|
|
26
|
-
tag_build =
|
|
27
|
-
tag_date = 0
|
|
28
|
-
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Setup file for kuhl-haus-crow.
|
|
3
|
-
Use setup.cfg to configure your project.
|
|
4
|
-
|
|
5
|
-
This file was generated with PyScaffold 4.6.
|
|
6
|
-
PyScaffold helps you to put up the scaffold of your new Python project.
|
|
7
|
-
Learn more under: https://pyscaffold.org/
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
from setuptools import setup
|
|
11
|
-
|
|
12
|
-
if __name__ == "__main__":
|
|
13
|
-
try:
|
|
14
|
-
setup()
|
|
15
|
-
except: # noqa
|
|
16
|
-
print(
|
|
17
|
-
"\n\nAn error occurred while building the project, "
|
|
18
|
-
"please ensure you have the most updated version of setuptools, "
|
|
19
|
-
"setuptools_scm and wheel with:\n"
|
|
20
|
-
" pip install -U setuptools setuptools_scm wheel\n\n"
|
|
21
|
-
)
|
|
22
|
-
raise
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: kuhl-haus-mdp-servers
|
|
3
|
-
Version: 0.0.3
|
|
4
|
-
Summary: Container image build repository for market data processing servers
|
|
5
|
-
Author-email: Tom Pounders <git@oldschool.engineer>
|
|
6
|
-
Project-URL: Homepage, https://github.com/kuhl-haus/kuhl-haus-mdp-servers
|
|
7
|
-
Project-URL: Documentation, https://github.com/kuhl-haus/kuhl-haus-mdp-servers/wiki
|
|
8
|
-
Project-URL: Source, https://github.com/kuhl-haus/kuhl-haus-mdp-servers.git
|
|
9
|
-
Project-URL: Changelog, https://github.com/kuhl-haus/kuhl-haus-mdp-servers/commits
|
|
10
|
-
Project-URL: Tracker, https://github.com/kuhl-haus/kuhl-haus-mdp-servers/issues
|
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Programming Language :: Python
|
|
13
|
-
Requires-Python: <3.13,>=3.9.21
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
Requires-Dist: kuhl-haus-mdp
|
|
16
|
-
Provides-Extra: testing
|
|
17
|
-
Requires-Dist: setuptools; extra == "testing"
|
|
18
|
-
Requires-Dist: pdm-backend; extra == "testing"
|
|
19
|
-
Requires-Dist: pytest; extra == "testing"
|
|
20
|
-
Requires-Dist: pytest-cov; extra == "testing"
|
|
21
|
-
|
|
22
|
-
# kuhl-haus-mdp-servers
|
|
23
|
-
Container image build repository for market data processing servers
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
README.md
|
|
2
|
-
pyproject.toml
|
|
3
|
-
setup.cfg
|
|
4
|
-
setup.py
|
|
5
|
-
src/kuhl_haus/servers/__init__.py
|
|
6
|
-
src/kuhl_haus/servers/mdl_server.py
|
|
7
|
-
src/kuhl_haus/servers/mdp_server.py
|
|
8
|
-
src/kuhl_haus/servers/wds_server.py
|
|
9
|
-
src/kuhl_haus_mdp_servers.egg-info/PKG-INFO
|
|
10
|
-
src/kuhl_haus_mdp_servers.egg-info/SOURCES.txt
|
|
11
|
-
src/kuhl_haus_mdp_servers.egg-info/dependency_links.txt
|
|
12
|
-
src/kuhl_haus_mdp_servers.egg-info/entry_points.txt
|
|
13
|
-
src/kuhl_haus_mdp_servers.egg-info/requires.txt
|
|
14
|
-
src/kuhl_haus_mdp_servers.egg-info/top_level.txt
|
|
15
|
-
src/kuhl_haus_mdp_servers.egg-info/zip-safe
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
kuhl_haus
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
{kuhl_haus_mdp_servers-0.0.3 → kuhl_haus_mdp_servers-0.1.3}/src/kuhl_haus/servers/__init__.py
RENAMED
|
File without changes
|