open-horizon
edge fabric services & patterns
This repository contains Open Horizon services and patterns, including:
yolo4motion
- A service to process MQTT messages through the OpenYOLO object detector and classifieralpr4motion
- A service to process MQTT messages through the OpenALPR automated license plate readerface4motion
- A service to process MQTT messages through the OpenFACE face detector
Please see the "hello world" example for an introduction to developing for Open Horizon
Quick Start instructions
To run a sample Open Horizon exchange, follow theStatus
1.1.1 Introduction
These services and patterns are built and pushed to designated Docker registry & namespace as well as Open Horizon exchange and organization. The default build configuration is:
HZN_EXCHANGE_URL
defaults tohttps://exchange:3090/v1/
HZN_ORG_ID
is unspecified (e.g.dcmartin
)DOCKER_NAMESPACE
is unspecified (e.g.dcmartin
)DOCKER_REGISTRY
is unset and defaults todocker.io
This repository works best on a macOS computer. However, macOS need some additional software install the HomeBrew package manager and install the necessary software:
% brew install gettext
% cd /usr/local/bin && ln -s ../Cellar/gettext/0.19.8.1/bin/envsubst .
1.1.1 Variables
The HZN_ORG_ID
and DOCKER_NAMESPACE
should be specified appropriately prior to any build; substitute values appropriately, for example:
export HZN_ORG_ID=$(USER}
export HZN_USER_ID=${USER}
export DOCKER_NAMESPACE=${USER}
export HZN_EXCHANGE_URL="http://exchange:3090/v1/"
export HZN_EXCHANGE_APIKEY="whocares"
To make those environment variables persistent, copy them into files with the same names:
echo "${HZN_ORG_ID}" > HZN_ORG_ID
echo "${HZN_USER_ID}" > HZN_USER_ID
echo "${HZN_EXCHANGE_APIKEY}" > HZN_EXCHANGE_APIKEY
echo "${HZN_EXCHANGE_URL}" > HZN_EXCHANGE_URL
echo "${DOCKER_NAMESPACE}" > DOCKER_NAMESPACE
1.1.2 Dependencies
Docker provides for build dependencies through the FROM
directive in the Dockerfile
; most services depend on the base service containers for base-ubuntu
or base-alpine
.
Build services and containers from the top-level using the following command:
make build
To build (or push or publish ..) for all services on all architectures, modify the target with service-
prepended; for example:
make service-build
2. Services & Patterns
Services are defined within a directory hierarchy of this repository. All services in this repository share a common design.
Examples:
hello
- The "hello world" exampleesstest
- A simple test of the edge-sync-servicesdr2msghub
- Re-packaging ofIBM/sdr2msghub
service w/startup
Services include:
cpu
- provide CPU usage as percentage services/0-100)fft
- Perform FFT analysis on soundhal
- provide Hardware-Abstraction-Layer informationherald
- multi-cast data received from other heralds on local-area-networkhotword
- Detect specific hot wordsmqtt
- MQTT message broker servicemotion2mqtt
- transmit motion detected images to MQTTmqtt2kafka
- relay MQTT traffic to Kafkamqtt2mqtt
- Relay MQTT trafficnoize
- Capture noise from silencerecord
- Record audio from a microphonewan
- provide Wide-Area-Network informationyolo
- recognize entities from USB camerayolo2msghub
- transmityolo
,hal
,cpu
, andwan
information to Kafkayolo4motion
- subscribe to MQTT topics frommotion2mqtt
, recognize entities, and publish results
There are utility services that are used for command and control:
startup
- send and receive device information and configuration using ESS/CSS (and Kafka)hzncli
- service container withhzn
command-line-interface installedhznsetup
- Setup new devices as nodeshznmonitor
- Monitor exchange, organization, patterns, services, nodes, and Kafka forstartup
There are base containers that are used by the other services:
base-alpine
- base container for Alpine LINUXbase-ubuntu
- base container for Ubuntu LINUXapache-ubuntu
- Apache Web server for Ubuntuapache-alpine
- Apache Web server for Alpine
Finally, there are services specialized for the nVidia GPU enabled computers:
yolo-cuda
-yolo
for ARMv8 devicesyolo-tegra
-yolo
for ARMv8 devicesyolo-cuda4motion
-yolo4motion
for ARMv8 devicesyolo-tegra4motion
-yolo4motion
for ARMv8 devices
Further Information
See SERVICE.md
and PATTERN.md
for more information on building services and patterns.
Refer to the following for more information on [getting started][edge-fabric] and [installation][edge-install].
See the video library Coding with Dave
Changelog & Releases
Releases are based on Semantic Versioning, and use the format
of MAJOR.MINOR.PATCH
. In a nutshell, the version will be incremented
based on the following:
MAJOR
: Incompatible or major changes.MINOR
: Backwards-compatible new features and enhancements.PATCH
: Backwards-compatible bugfixes and package updates.
Authors & contributors
David C Martin (github@dcmartin.com)
CLOC
Language | files | blank | comment | code |
---|---|---|---|---|
Markdown | 72 | 2965 | 0 | 16211 |
JSON | 147 | 1 | 0 | 15388 |
Bourne Shell | 202 | 2386 | 2354 | 13309 |
Dockerfile | 38 | 479 | 310 | 1874 |
make | 6 | 308 | 231 | 1146 |
YAML | 4 | 47 | 271 | 733 |
Bourne Again Shell | 16 | 51 | 33 | 340 |
Python | 6 | 89 | 106 | 304 |
HTML | 6 | 236 | 2034 | 220 |
TOML | 5 | 30 | 0 | 205 |
awk | 1 | 4 | 0 | 16 |
Expect | 1 | 0 | 0 | 5 |
-------- | -------- | -------- | -------- | -------- |
SUM: | 504 | 6596 | 5339 | 49751 |