Skip to content

motion-ai/open-horizon

 
 

Repository files navigation

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 classifier
  • alpr4motion - A service to process MQTT messages through the OpenALPR automated license plate reader
  • face4motion - 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

To run a sample Open Horizon exchange, follow the Quick Start instructions

Build Status Coverage Status

Supports amd64 Architecture Supports arm64 Architecture Supports arm Architecture

(beta branch)

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 to https://exchange:3090/v1/
  • HZN_ORG_ID is unspecified (e.g. dcmartin)
  • DOCKER_NAMESPACE is unspecified (e.g. dcmartin)
  • DOCKER_REGISTRY is unset and defaults to docker.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:

Services include:

  • cpu - provide CPU usage as percentage services/0-100)
  • fft - Perform FFT analysis on sound
  • hal - provide Hardware-Abstraction-Layer information
  • herald - multi-cast data received from other heralds on local-area-network
  • hotword - Detect specific hot words
  • mqtt - MQTT message broker service
  • motion2mqtt - transmit motion detected images to MQTT
  • mqtt2kafka - relay MQTT traffic to Kafka
  • mqtt2mqtt - Relay MQTT traffic
  • noize - Capture noise from silence
  • record - Record audio from a microphone
  • wan - provide Wide-Area-Network information
  • yolo - recognize entities from USB camera
  • yolo2msghub - transmit yolo, hal, cpu, and wan information to Kafka
  • yolo4motion - subscribe to MQTT topics from motion2mqtt, 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 with hzn command-line-interface installed
  • hznsetup - Setup new devices as nodes
  • hznmonitor - Monitor exchange, organization, patterns, services, nodes, and Kafka for startup

There are base containers that are used by the other services:

Finally, there are services specialized for the nVidia GPU enabled computers:

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

Stargazers

Stargazers over time

Packages

No packages published

Languages

  • Shell 72.1%
  • Makefile 14.6%
  • Dockerfile 6.4%
  • HTML 4.9%
  • Python 2.0%