Skip to main content

IPI EUVL experiment control system

Project description

ipi-ecs

IPI Experiment Control System (ECS) — a modular toolkit for building distributed control systems.

ipi-ecs provides a compact, DDS-like communications layer for discovery, key/value state, and event distribution, plus a networked, journal-like logging system designed for multi-process / multi-machine research setups.

Primarily built to support our in-house EUV source system, but the core pieces have been intentionally kept generic: ipi-ecs aims to be a solid foundation that can support a wide-variety of usage scenarios ranging from experiment control systems to electric vehicle firnware (yes, really!)**

**Arduino compatible embedded client library is under development!


What’s included

Distributed coordination (DDS-like)

  • Subsystem registry for dynamic discovery (with stable identities).
  • Key/Value data surface for configuration, commands, and telemetry.
  • Push/subscribe updates for “published” KV entries.
  • Event distribution for request/response-style control actions.

Journaled logging (built for debugging + replay)

  • Network log ingestion server (ipi-ecs logger) that accepts structured records over TCP.
  • Global line numbers: Every log entry gets a global incremental line number that will always be unique, allowing systems to store the line numbers for regions of interest to retrieve them later.
  • Append-only NDJSON segments with rotation (size/time) so logs stay manageable.
  • SQLite index for fast queries by line range, time, subsystem/UUID, type, severity, etc.
  • Event markers: begin/end “events” that reference a range of log lines (great for experiments, shots, runs, faults, etc.).
  • CLI tooling:
    • log show/query/follow for scripting + terminal use
    • log browse (prompt_toolkit) for a “less-like” interactive viewer
    • log tui (Textual) for a richer interactive viewer (filters, details, event-range gutter)
  • JSON payload: Useful to record system state in a machine-readable format and replay it if desired, when combined with...
  • Replay services for reproducing past system states and debugging.
  • Log type and origin filtering: Filter out software-originated / state recording messages to get only the data operators want to see.

Data recording / indexing

  • Records to capture experiment-relevant data alongside logs.
  • Data library to index and retrieve recorded data efficiently.
  • Tags to annotate recorded data for easy indexing/filtering.
  • SQLite index for fast querying of recorded data based on time, tags, origin, etc.
  • Data recording services for capturing relevant streams/state.* Intended use case is to record high-rate instrument data that cannot neatly fit into the logging system (i.e. exposure UV intensity over time per pulse)

UI + operator tooling*

  • Terminal-oriented UI (TUI) options for interactive operation.
  • Tk-based UI components for GUI apps.

Lifecycle and reflection

  • Lifecycle management services for starting/stopping subsystems cleanly, and automatically restarting dead systems to improve availability.
  • Reflection / introspection hooks to make it easier to build UIs and diagnostics.*

* Limited functionality at this moment. This project is still under active development!


Design goals

  • Modularity: subsystems stay small and composable.

  • Fault tolerance: failures should be observable and survivable.

  • Observability by default: structured logs + queryability.

  • Practical ergonomics: optimized for real research equipment bring-up and long runs.

  • Minimal user interaction needed to recover from faults.


Installation

From the Python Package Index

python -m pip install ipi-ecs

From source as editable install (recommended for development)

git clone https://github.com/IPI-EUVL/ecs.git
cd ecs
python -m pip install -e.

Optional dev tooling:

python -m pip install -e ".[dev]"

Make sure your Python install scripts directory is in PATH to be able to use CLI tools!


Core concepts

Subsystems

A subsystem is a service/process that:

  • registers a name + a UUID
  • exposes a set of KV items (readable/writable/published)
  • exposes a set of events it can handle (and/or consume)

KV items

Key-Value items are the primary way of sharing data between subsystems.

  • read/write for configuration and commands
  • read-only or write-only handlers are supported.
  • Dynamic handlers can handle arbitrary requests that a subsystem receives
  • Can be published for streaming telemetry/state updates to subscribers
  • Local and remote KV providers can hide the entire DDS stack and expose a regular variable that can be used in normal Python expressions
  • KVs are typed, and subsystems can specifically accept/reject values at runtime (i.e. can enforce the validity of a configuration write request.)

Events

Events are routed control actions:

  • Request/response semantics for “do a thing”
  • Asynchronous, with state feedback
  • Can be used as a query system as well:
    • i.e. Controller subsystem sends global event "can begin exposure"
    • If a subsystem objects, it can reject the event and provide a reason alongside as well if desired.

Services

Core components are provided as standalone services that can run in the background. For the moment, only Windows services are supported, but Linux systemd services are planned for the future. ipi-ecs and all of its dependencies must be installed on the system (not a user account or venv) for services to work.

Service installation (Windows, must run from elevated shell):

# These must be run before service installation to set up dependencies correctly
sc.exe config ipi-ecs-LifecycleManagerService depend=ipi-ecs-DDSServerService 
sc.exe config ipi-ecs-DDSServerService depend=ipi-ecs-LoggerService

ipi-ecs-logger.exe install
ipi-ecs-ddsserver.exe install

Services can then be managed using:

ipi-ecs-ddsserver.exe start     # Start service
ipi-ecs-ddsserver.exe stop      # Stop service
ipi-ecs-ddsserver.exe restart   # Restart service
ipi-ecs-ddsserver.exe debug     # Run service in terminal debug mode (will show service stdout)

Services can also be managed using the standard services.msc management console ("Services" on Windows). Service logs are stored in the platform-appropriate log directory (i.e. %PROGRAMDATA%/ipi-ecs/logs on Windows). In addition to these services, a lifecycle manager service template is provided that can be used to build custom lifecycle managers for specific setups.


Contributing

PRs are welcome, HOWEVER, as this is a project undergoing very fast development at the moment, we'd advise you to wait until things have settled down for a bit and most major features have been implemented.


Status

This project is under active development and is primarily driven by real research-system needs. APIs may evolve; pin versions for production deployments. Expect lots, and lots of bugs, we'd like if you let us know by opening an issue ticket!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipi_ecs-0.1.5.tar.gz (98.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipi_ecs-0.1.5-py3-none-any.whl (114.2 kB view details)

Uploaded Python 3

File details

Details for the file ipi_ecs-0.1.5.tar.gz.

File metadata

  • Download URL: ipi_ecs-0.1.5.tar.gz
  • Upload date:
  • Size: 98.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ipi_ecs-0.1.5.tar.gz
Algorithm Hash digest
SHA256 9bfa7ae45a85cb8587411f6f03a16914bcd2b9b075c348a91b9c6b00d345549e
MD5 3dc835f7b42a2e8fec92e8d9e7fbca93
BLAKE2b-256 638a0c8fcab4dfc3f3a992f24e4a15c8b5c6e7b2f16143683ef09ed4e2ba02ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for ipi_ecs-0.1.5.tar.gz:

Publisher: python-publish.yml on IPI-EUVL/ecs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ipi_ecs-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: ipi_ecs-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 114.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ipi_ecs-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1c5a33b7bbee63f4a2b3352d71513ef4d22126af4f1dd5e31b1425926b887e11
MD5 6596ff35d581c89aa90542a3b5c4ed58
BLAKE2b-256 dce86cf736235df2b4fba81359724ac53180d7230c8ff833b67f7e1ef83012d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ipi_ecs-0.1.5-py3-none-any.whl:

Publisher: python-publish.yml on IPI-EUVL/ecs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page