This repository contains a set of examples to demonstrate a CI/CD process for services and patterns.
Please see the "hello world" example for an introduction to developing for Open Horizon
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://alpha.edge-fabric.com/v1
HZN_ORG_ID
is unspecified (e.g.dcmartin@us.ibm.com
)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 .
The HZN_ORG_ID
and DOCKER_NAMESPACE
should be specified appropriately prior to any build; substitute values appropriately, for example:
% export HZN_ORG_ID="dcmartin@us.ibm.com"
% export DOCKER_NAMESPACE="dcmartin"
To make those environment variables persistent, copy them into files with the same names:
% echo "${HZN_ORG_ID}" > HZN_ORG_ID
% echo "${DOCKER_NAMESPACE}" > DOCKER_NAMESPACE
An IBM Cloud Platform API key is required to publish any service or pattern; please refer to the IBM IAM service to download a JSON API key file. Then copy that file into the top-level directory of the forked or cloned repository; for example:
% cp ~/Downloads/apiKey.json ~/gitdir/open-horizon/
The API key will be automatically extracted and saved in a local APIKEY
file for use in the build process.
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 all services and containers from the top-level using the following command:
% make service-build
Services are defined within a directory hierarchy of this repository. All services in this repository share a common design.
Patterns include:
yolo2msghub
- Pattern ofyolo2msghub
withyolo
,hal
,wan
, andcpu
motion2mqtt
- Pattern ofmotion2mqtt
,yolo4motion
andmqtt2kafka
withmqtt
,hal
,wan
, andcpu
Services include:
cpu
- provide CPU usage as percentage (0-100)wan
- provide Wide-Area-Network informationhal
- provide Hardware-Abstraction-Layer informationyolo
- recognize entities from USB cameramqtt
- MQTT message broker servicehzncli
- service container withhzn
command-line-interface installedherald
- multi-cast data received from other heralds on local-area-networkyolo2msghub
- transmityolo
,hal
,cpu
, andwan
information to Kafkamotion2mqtt
- transmit motion detected images to MQTTyolo4motion
- subscribe to MQTT topics frommotion2mqtt
, recognize entities, and publish resultsmqtt2kafka
- relay MQTT traffic to Kafkafft
- Perform FFT analysis on soundnoize
- Capture noise from silencemqtt2mqtt
- Relay MQTT trafficrecord
- Record audio from a microphonehznsetup
- Setup new devices as nodes
There are also base containers that are used by the other services:
base-alpine
- base container for Alpine LINUXbase-ubuntu
- base container for Ubuntu LINUX
Finally, there are services specialized for the nVidia Jetson computers:
jetson-jetpack
- base container for Jetson devicesjetson-cuda
- base container for Jetson devices with CUDAjetson-opencv
- base container for Jetson devices with CUDA & OpenCVjetson-caffe
- BVLC Caffe with CUDA and OpenCV for nVidia Jetson TXjetson-yolo
- Darknet YOLO with CUDA and OpenCV for nVidia Jetson TXjetson-digits
- nVidia DIGITS with CUDA
See SERVICE.md
and PATTERN.md
for more information on building services and patterns.
Refer to the following for more information on getting started and installation.
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.
David C Martin (github@dcmartin.com)
Language | files | blank | comment | code |
---|---|---|---|---|
Markdown | 49 | 1986 | 0 | 12122 |
JSON | 130 | 1 | 0 | 11538 |
Bourne Shell | 105 | 1144 | 1335 | 7096 |
Dockerfile | 26 | 311 | 191 | 1182 |
Bourne Again Shell | 5 | 83 | 103 | 441 |
make | 2 | 96 | 66 | 304 |
Python | 6 | 84 | 108 | 293 |
YAML | 1 | 0 | 39 | 148 |
awk | 1 | 4 | 0 | 16 |
Expect | 1 | 0 | 0 | 5 |
-------- | -------- | -------- | -------- | -------- |
SUM: | 326 | 3709 | 1842 | 33145 |