项目作者: ess-dmsc

项目描述 :
Forward EPICS process variables to Kafka
高级语言: C++
项目地址: git://github.com/ess-dmsc/forward-epics-to-kafka.git
创建时间: 2017-02-09T09:19:49Z
项目社区:https://github.com/ess-dmsc/forward-epics-to-kafka

开源协议:BSD 2-Clause "Simplified" License

下载


Build Status
codecov
DOI

Forward EPICS to Kafka

Forwards EPICS PVs to Apache Kafka. Part of the ESS data streaming pipeline.

Usage

  1. -h,--help Print this help message and exit
  2. --log-file TEXT Log filename
  3. --streams-json TEXT Json file for streams to add
  4. --kafka-gelf TEXT Kafka GELF logging //broker[:port]/topic
  5. --graylog-logger-address TEXT
  6. Address for Graylog logging
  7. --influx-url TEXT Address for Influx logging
  8. -v,--verbosity=Error Set log message level. Set to 0 - 5 or one of
  9. `Trace`, `Debug`, `Info`, `Warning`, `Error`
  10. or `Critical`. Ex: "-v Debug". Default: `Error`
  11. --config-topic URI=localhost:9092/forward_epics_to_kafka_commands (REQUIRED)
  12. <host[:port]/topic> Kafka host/topic to listen for commands on
  13. --status-topic URI <host[:port][/topic]> Kafka broker/topic to publish status updates on
  14. --pv-update-period UINT=0 Force forwarding all PVs with this period even if values are not updated (ms). 0=Off
  15. --fake-pv-period UINT=0 Generates and forwards fake (random value) PV updates with the specified period in milliseconds, instead of forwarding real PV updates from EPICS
  16. --conversion-threads UINT=1 Conversion threads
  17. --conversion-worker-queue-size UINT=1024
  18. Conversion worker queue size
  19. --main-poll-interval INT=500
  20. Main Poll interval
  21. -S,--kafka-config KEY VALUE ...
  22. LibRDKafka options
  23. -c,--config-file TEXT Read configuration from an ini file

Configuration Files

The forwarder can be configured from a file via --config-file <ini> which mirrors the command line options.

For example:

  1. config-topic=//<host>[:port]/the_config_topic
  2. status-topic=//<host>[:port]/the_status_topic
  3. streams-json=./streams.json
  4. kafka-config=consumer.timeout.ms 501 fetch.message.max.bytes 1234 api.version.request true
  5. verbosity=5

Note: the Kafka options are key-value pairs and the forwarder can be given multiple by appending the key-value pair to
the end of the command line option.

Sending commands to the forwarder

Beyond the configuration options given at start-up, the forwarder can be sent commands via Kafka to configure which PVs
are forwarded.

See commands for more information.

Installation

The supported method for installation is via Conan.

Prerequisites

The following minimum software is required to get started:

  • Conan
  • CMake >= 3.1.0
  • Git
  • A C++14 compatible compiler (preferably GCC or Clang)
  • Doxygen (only required if you would like to generate the documentation)

Conan will install all the other required packages.

Add the Conan remote repositories

Follow the README here

Build

From within the forwarder’s top directory:

  1. mkdir _build
  2. cd _build
  3. conan install ../conan --build=outdated
  4. cmake ..
  5. make

There are additional CMake flags for adjusting the build:

  • -DRUN_DOXYGEN=TRUE if Doxygen documentation is required. Also, requires make docs to be run afterwards
  • -DBUILD_TESTS=FALSE to skip building the unit tests

Running the unit tests

From the build directory:

  1. ./tests/tests

Running on OSX

When using Conan on OSX, due to the way paths to dependencies are handled,
the activate_run.sh file must be sourced before running the application. The
deactivate_run.sh can be sourced to undo the changes afterwards.

System tests

The system tests consist of a series of automated tests for this repository that test it in ways similar to how it would
be used in production.

See System Tests page for more information.

Documentation

See the documentation directory.

Contributing

Please read CONTRIBUTING.md for information on submitting pull requests to this project.

License

This project is licensed under the BSD 2-Clause “Simplified” License - see the LICENSE.md file for details.