Skip to content

Commit

Permalink
RTDS provider fixes and improvements (#12)
Browse files Browse the repository at this point in the history
* pypmu: propagate exception to caller if connect fails

* setup.py: python 3.8+, re-add #!

* Exclude .venv from git

* Fix setup.py so "pip install" works with up to date setuptools

* add pyPMU to NOTICE

The license file was already included in the source tree.
However, it wasn't listed in NOTICE.

* Add RTDS provider to config.ini

* Improvements to RTDS provider

- Remove PMU sequence numbers.
They ended up being wildly inaccurate thanks to threading.
- Apply a field type mapping when creating Elasticsearch indices
- Handle Elastic bulk ingest error messages
- Add 'elastic-index-basename' option to configure
the Elasticsearch index name.
- Fix PMU connection rebuilding.
If RSCAD case is stopped, the provider no longer needs to be restarted and will properly restart the PMU connections.
This fixes a long-standing issue that's been around since HARMONIE.
- Improve PMU handling.
RTDS provider is now able to be started AFTER the RSCAD case is started.
- Change gtnet-skt to continually send data over UDP
- Add 'gtnet-skt-tcp-retry-delay' config option
- Add 'gtnet-skt-udp-write-rate' config option
- Move Elasticsearch processing and pushing into a thread.
This prevents it from blocking the core functionality of
sending data to SCEPTRE.
- Improve how boolean config options are handled
- Move RTDS data processing into a thread

* Add .editorconfig

* Remove references to tox

tox hasn't been used by pybennu for a very, very long time

* Remove version.py

Git hashes can't be used for the Version field in package metadata

* Remove pybennu-probe.spec

It isn't used anywhere. It's a pyinstaller spec but pyinstaller hasn't been used in a long time.

* fix "make bull"

* Cleanup Makefile

- Remove unused variables and stages
- Fix indentation
- Consolidate and update help messages
- Remove requirement for root from several commands

* fix errors and warnings during deb build

* update license in pybennu package metadata

* update license in deb package metadata

* RTDS: add udp support for PMUs

- Add 'rtds-pmu-protocols' to config.ini
- Add ability to use UDP for PMUs in the RTDS
- Totally untested right now, will be tested soon

* RTDS: fix timestamps being in local time, not UTC

* RTDS: get bennu version, set network.transport dynamically

* RTDS: type annotations

* RTDS: more type annotations, cleanup TODO

* rtds tweaks

* RTDS: use sceptre_time as absolute truth (for @timestamp)

* rtds: add calculated time drift to elastic data

* rtds: Fix missing type for time_drift field

* rtds: bump ecs.version to 8.11.0

* rtds: handle messages on date boundary going into wrong index

* rtds: fix for sceptre_time

* rtds: fix bennu version

* Performance optimizations and tweaks

- GTNET-SKT: Don't log every GTNET-SKT tag update
- GTNET-SKT: Log all GTNET-SKT values, only when debugging
- GTNET-SKT: calculate all the typecasts, THEN update the state all at once (instead of taking the lock 20 times and incrementally updating the state...)
- Move a lot of logging to if statements so we avoid function call
- asynchronous logging so log calls don't block threads (especially for file writes)

---------

Co-authored-by: Christopher Goes <[email protected]>
  • Loading branch information
GhostofGoes and GhostofGoes authored Apr 30, 2024
1 parent 6c3a68f commit e4cfe0e
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 117 deletions.
4 changes: 4 additions & 0 deletions src/pybennu/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ input-mappings = [/system/branch-1_8163-8164/active]

; ; Configurations for PMUs configured in RTDS, comma-separated
; ; NOTE: the length of all "rtds-pmu-*" options must match!
; ; TODO: UDP isn't implemented yet in pyPMU, therefore "udp" is not currently working
; ; Allowed values for "rtds-pmu-protocols": tcp, udp
; ; This selects which transport protocol will be used for C37.118
; rtds-pmu-ips = 172.24.9.51, 172.24.9.51, 172.24.9.51, 172.24.9.51, 172.24.9.51, 172.24.9.51, 172.24.9.51, 172.24.9.51
; rtds-pmu-ports = 4714, 4716, 4719, 4718, 4717, 4715, 4772, 4782
; rtds-pmu-protocols = tcp, tcp, tcp, tcp, tcp, tcp, tcp, tcp
; rtds-pmu-names = PMU1, PMU2, PMU3, PMU4, PMU5, PMU6, PMU7, PMU8
; rtds-pmu-labels = BUS7, BUS8, BUS9, BUS5, BUS5-1, BUS4, BUS6-1, BUS6
; rtds-pdc-ids = 41, 6, 91, 92, 71, 72, 5, 6
Expand Down
Loading

0 comments on commit e4cfe0e

Please sign in to comment.