This project provides a generic driver architecture for ingesting real-time or historical samples into the MLDP ingestion API (see MLDP). It separates source readers from batching/transport so multiple data-source implementations can publish normalized payloads to MLDP over gRPC.
DOI Code - 10.11578/dc.20260305.3
The driver builds one effective configuration by accumulating one or more -c/--config
inputs. Each -c value must be either:
- a path to an existing YAML file, or
- a dotted
PATH=VALUEassignment, which is converted to YAML and merged in
All -c inputs are merged in the order provided.
The effective configuration has five top-level sections:
| Key | Required | Purpose |
|---|---|---|
name |
no | Controller instance label (metrics scope) |
writer |
yes (≥1) | Output sinks (mldp, hdf5, hdf5-merge) |
reader |
yes (≥1) | Input sources (epics-pvxs, epics-base, epics-archiver); EPICS readers take PVs inline (pvs) and/or from text files (pvs-files) |
routing |
no | Reader-to-writer routing and optional source filters |
metrics |
no | Prometheus exporter settings |
Use these docs for full details:
- Configuration Reference — complete schema, defaults, validation rules
- User Guide — practical end-to-end YAML examples
- Reader Types — reader capabilities + build/dependency matrix
- Writers Overview — writer model and extension points
The architecture is reader → bus → controller → writer:
- Readers collect live or historical EPICS data.
- Readers push normalized batches onto
IDataBus. - Controller partitions and routes batches.
- Writers deliver to MLDP gRPC or HDF5 storage.
Readers can be long-running (e.g., live PV subscriptions that stream indefinitely) or one-shot (e.g., archiver queries that finish after retrieving a fixed dataset). When a one-shot reader completes, it signals the controller and is automatically removed. Once all readers have finished and no readers remain active, the CLI exits automatically.
For detailed diagrams and threading/data-flow internals see Architecture Overview.
The driver is configured from one or more -c/--config inputs (see above) and is started
from the command line.
mldp_pvxs_driver [--help] [--version] [--config SOURCE]... [--log-level LEVEL] [--metrics-output FILE] [--metrics-interval SECONDS] [--print-config-startup] [--dry-run]-h, --help- Show the built-in help and exit.
-v, --version- Print the version and exit.
-c, --config SOURCE- Configuration source.
- If
SOURCEis an existing file, it is loaded as YAML. - Otherwise
SOURCEmust be a dotted assignment likemetrics.endpoint=0.0.0.0:9464. - May be repeated; all values are merged in order into one effective configuration.
- Default when omitted:
config.yaml
-l, --log-level LEVEL- Logging verbosity.
- Accepted values:
trace,debug,info,warn,error,critical,off - Default:
info - Notes: value is case-insensitive;
warningis accepted aswarn,erraserror, andfatalascritical.
-m, --metrics-output FILE- Path to output file for periodic metrics dumps (JSON Lines format).
- Default:
metrics.jsonl
--metrics-interval SECONDS- Interval in seconds for periodic metrics dumps.
- Default:
5
--print-config-startup(alias:--print-config)- Print a compact, user-friendly summary of the effective startup configuration.
- Default: disabled
--dry-run- Load and validate config, then exit without starting driver/readers.
- Default: disabled
# Run with an explicit config file
./mldp_pvxs_driver -c ./config.yaml
# Enable debug logging
./mldp_pvxs_driver -c ./config.yaml --log-level debug
# Print effective config at startup (compact format)
./mldp_pvxs_driver -c ./config.yaml --print-config-startup
# Validate config and exit without starting runtime components
./mldp_pvxs_driver -c ./config.yaml --dry-run
# Validate + print effective config summary, then exit
./mldp_pvxs_driver -c ./config.yaml --print-config --dry-run
# Merge a config file with dotted assignments
./mldp_pvxs_driver \
-c ./config.yaml \
-c metrics.endpoint=0.0.0.0:9464 \
-c reader.hdf5-bsas-gen1[0].file-path=/tmp/bsas.h5 \
--dry-run
# Show help/version
./mldp_pvxs_driver --help
./mldp_pvxs_driver --versionFor periodic metrics dumps and manual triggers (Ctrl+P, Ctrl+D, SIGUSR1/SIGQUIT), see the metrics export guide.
Instead of writing YAML by hand, use the built-in configuration utilities (run without -c):
# Generate a new config.yaml interactively
mldp_pvxs_driver config wizard
# Or seed from an existing config and modify it
mldp_pvxs_driver config wizard --from old-config.yaml --output new-config.yaml# Print minimal template (MLDP writer + PVXS reader)
mldp_pvxs_driver config template --minimal
# Print full template (both writers, all readers)
mldp_pvxs_driver config template --full# Validate a YAML file and report field-level errors/warnings
mldp_pvxs_driver config validate config.yaml# Show all writers, readers, routing rules, and metrics settings
mldp_pvxs_driver config list config.yaml# Add a new reader, writer, or routing entry interactively (KIND is optional — prompted when omitted)
mldp_pvxs_driver config add config.yaml
mldp_pvxs_driver config add writer config.yaml # skip kind prompt, go straight to writer type
mldp_pvxs_driver config add reader config.yaml
mldp_pvxs_driver config add routing config.yaml
# Remove a named writer, reader, or routing entry
mldp_pvxs_driver config remove writer config.yaml --name mldp_main
mldp_pvxs_driver config remove reader config.yaml --name pvxs_liveAll config subcommands support --help for per-command options.
🚀 New to the driver? Start with the User Guide — annotated YAML examples covering every reader, writer, routing, and source-filter scenario. No C++ knowledge required.
Readers collect data from configurable sources, push normalized batches onto a shared bus, and the controller routes them to one or more writers — each writer delivering to a different storage or transport backend.
- User Guide - Start here: annotated examples for operators and physicists (no C++ required)
- Architecture Overview - System architecture, data flow, and design patterns
- Configuration Reference - Complete YAML schema with all keys, types, and defaults
- Reader Types - Available reader implementations (EPICS Base, PVXS, Archiver)
- Implementing Custom Readers - Guide to creating new reader types
- Writers Overview - Writer pattern, factory registration, new writer guide
- MLDP Writer - gRPC ingestion writer details and configuration
- HDF5 Writer - HDF5 storage writer details and configuration
- Logging Guide - Main log file, optional per-reader/writer/controller files, size/age rotation, gzip compression and retention
- Query CLI Guide - SQL syntax reference, virtual table catalog, output formats, pagination, and step-by-step tutorial using the sample-data generator
- MLDP Query Client - Standalone out-of-band query API
- Query Engine Architecture - IQueryable provider model, planner/executor internals, predicate-pushdown rules, and extension points
- Logging Abstraction Guide - How
util::logworks and custom logger implementation - HTTP Transport Provider - Shared
util/httpabstraction for HTTP-based readers - Metrics Export Guide - Prometheus metrics and manual dump triggers
- Metrics Extension Guide - How to add per-component metric classes (
ExtendedMetricshierarchy)
For developer information and contribution guidelines see CONTRIBUTING.md.
- EPICS Base (default: R7.0.8.1) provides the core EPICS runtime and
libCom. - PVXS (default: 1.4.1) provides the PVAccess client used to subscribe to EPICS PVs.
- gRPC (system package; version per toolchain) provides the RPC transport to the MLDP ingestion service.
- Protocol Buffers (system package; version per toolchain) generates and serializes MLDP protobuf payloads.
- dp-grpc proto definitions supply the MLDP ingestion API
.protofiles used at build time. - OpenSSL (system library; version per OS/toolchain) provides TLS for gRPC credentials.
- spdlog v1.16.0 provides structured logging.
- prometheus-cpp v1.3.0 provides the metrics registry and HTTP exporter.
- argparse v3.2 provides CLI argument parsing.
- date v3.0.1 provides IANA timezone and daylight-saving conversion for query timestamp formatting.
- rapidyaml 0.10.0 (vendored in
ext/rapidyaml) parses the YAML configuration. - BS::thread_pool 5.0.0 (vendored in
ext/BS_thread_pool) provides the controller worker thread pool. - libevent (system library; required when statically linking PVXS) supplies PVXS' event loop dependencies in static builds.
- CMake 3.15+ configures and builds the project.
Tagged releases (vX.Y.Z) publish:
- A container image (recommended way to run).
- A standalone executable artifact (currently named
mldp_pvxs_driver-rockylinux-9.3-epics-R7.0.8.1). - An AppImage for easier distribution (currently named
mldp_pvxs_driver-rockylinux-9.3-epics-R7.0.8.1-pvxs-1.4.1-x86_64.AppImage).
The current CI/CD publishes and refreshes four related builder/dev refs in GHCR:
ghcr.io/slaclab/mldp-pvxs-driver/build:epics-7.0.8.1-pvxs-1.4.1- Shared builder image tagged only by EPICS + PVXS versions.
- Published by the release workflow in
.github/workflows/build-docker-image.yml.
ghcr.io/slaclab/mldp-pvxs-driver/dev:rockylinux-9.3-builder-r7.0.8.1-1.4.1- Latest reusable dev image for the active matrix variant.
- Refreshed by
mainCI in.github/workflows/build-and-test.ymlwhen content changes.
ghcr.io/slaclab/mldp-pvxs-driver/rockylinux-9.3-builder-r7.0.8.1-1.4.1:buildcache- Variant-specific builder image tag used to keep the registry cache warm.
ghcr.io/slaclab/mldp-pvxs-driver/rockylinux-9.3-builder-r7.0.8.1-1.4.1:buildkitcache- Registry-backed BuildKit cache export used by both CI workflows.
For local docker buildx builds, use both the shared builder image and the variant-specific BuildKit cache as cache sources, which matches the current CI setup:
docker login ghcr.io
docker buildx build \
-f .devcontainer/Dockerfile \
--build-arg BASE_OS_IMAGE=rockylinux/rockylinux:9.3 \
--build-arg EPICS_VERSION=R7.0.8.1 \
--build-arg PVXS_VERSION=1.4.1 \
--cache-from type=registry,ref=ghcr.io/slaclab/mldp-pvxs-driver/build:epics-7.0.8.1-pvxs-1.4.1 \
--cache-from type=registry,ref=ghcr.io/slaclab/mldp-pvxs-driver/rockylinux-9.3-builder-r7.0.8.1-1.4.1:buildkitcache \
-t mldp-pvxs-driver-dev:latest \
--load \
.Notes:
- The shared
build:epics-...-pvxs-...tag is the stable cross-branch builder reference. - The
dev:<variant>tag tracks the latest dev image for that OS/EPICS/PVXS matrix entry. - The
:buildkitcacheref is not a runnable image; it is a registry cache export for BuildKit. - The
:<variant>:buildcachetag is a pushed builder image that helps keep the cache hot onmain.
In the builder/dev container image:
- EPICS Base source is cloned into
/opt/epicsand installed into/opt/local. - PVXS source is cloned into
/opt/pvxsand installed into/opt/local. - The EPICS host architecture is recorded in
/etc/epics_host_arch(e.g.linux-x86_64).
In the runtime/release container image:
/opt/localis copied from the builder stage and contains EPICS Base + PVXS headers and libraries.EPICS_BASE=/opt/localandPVXS_BASE=/opt/localare set in the runtime image.
- Default build args are defined in .devcontainer/Dockerfile (
EPICS_VERSION,PVXS_VERSION). - CI/release versions are set by the workflow matrix in .github/workflows/build-and-test.yml and .github/workflows/build-docker-image.yml.
The standalone executable artifact is dynamically linked (not a fully static binary). This means it requires shared libraries to be present on the target host at runtime.
At a minimum, the binary depends on:
- gRPC + Protobuf runtime libraries (and their transitive deps like Abseil, c-ares, re2)
- OpenSSL (
libssl,libcrypto) - EPICS Base runtime (
libCom) - PVXS runtime (
libpvxs)
In the release build environment, EPICS Base + PVXS are installed under /opt/local, and the binary is built with a
runtime search path pointing there. If you download and run the standalone artifact on a different host, you must
either:
- install compatible EPICS Base + PVXS and ensure they are discoverable by the dynamic loader (e.g., via
LD_LIBRARY_PATHor a matching install prefix), and install the required gRPC/Protobuf/OpenSSL runtime packages, or - run via the published Docker image, which includes the correct runtime environment.
COPYRIGHT © SLAC National Accelerator Laboratory. All rights reserved. This work is supported [in part] by the U.S. Department of Energy, Office of Basic Energy Sciences under contract DE-AC02-76SF00515.
Neither the name of the Leland Stanford Junior University, SLAC National Accelerator Laboratory, U.S. Department of Energy nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
