This repository contains a docker-compose for creating a working demo sample for golemu (LLRP Emulator), gosstrak-fc (Filtering & Collection middleware), and the visualization of LLRP traffic by Grafana and InfluxDB.
The docker-compose.yml
will spin up 4 docker containers.
- golemu: Run LLRP emulator with the gob files placed in
data/golemu/dataset
. golemu iterates through each.gob
file and repeat the cycle endlessly. - gosstrak: Run Filtering & Collection middleware to receive the RFID read events from the emulator in LLRP. It filters the tags based on
data/gosstrak/ecspec.csv
. Theecspec.csv
contains prefix URN of interested ID patterns and its corresponding notification URI. The ID patterns are aggregated with the notification URI; i.e., the first entry is the URI and the rest of the line is the patterns. - influxdb: A InfluxDB instance which receives the performance monitoring directly from gosstrak.
- grafana: Draw realtime plots of gosstrak performance with the InfluxDB instance.
The latest version of iomz/gosstrak docker image on Docker Hub is a custom version of gosstrak which dynamically adopts the efficient filtering algorithm depending on the statistics of event traffic.
-
Install Docker and docker-compose on your system.
-
Clone this repository.
-
(Optional) Prepare golemu and gosstrak docker images if you want to run different versions of them. See Containers section.
-
Download and untar the sample RFID tag dataset from https://github.com/iomz/docker-gosstrak-demo/releases/download/v0.0.1/dataset.tgz then place the
.gob
files indata/golemu/dataset
. -
Download the sample filtering rules from https://github.com/iomz/docker-gosstrak-demo/releases/download/v0.0.1/ecspec.csv and place it as
data/gosstrak/ecspec.csv
. -
Start the containers and wait a while for all the containers to start up. You can then access the Grafana dashboard at
http://localhost:3000
(User/Pass: admin/gosstrak) – navigate to thegosstrak
dashboard.
% cd docker-gosstrak-demo
% docker-compose up
The below assumes this repository is cloned to ~/docker-gosstrak-demo
.
Build the single binary golemu from the source and put build the docker image with it.
- Build a golemu binary and place it
$GOPATH/src/github.com/iomz/golemu % CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ~/docker-gosstrak-demo/golemu/golemu .
- Build a golemu docker image
~/docker-gosstrak-demo/golemu % docker build -t golemu -f Dockerfile.scratch .
Likewise in golemu.
- Build gosstrak-fc binary
$GOPAH/src/github.com/iomz/gosstrak % CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ~/docker-gosstrak-demo/gosstrak/gosstrak-fc ./cmd/gosstrak-fc
- Build gosstrak docker image
~/docker-gosstrak-demo/gosstrak % docker build -t gosstrak -f Dockerfile.scratch .
~/docker-gosstrak-demo % docker run --name gosstrak --mount type=bind,source=<path_to_project>/docker-gosstrak-demo/data/gosstrak,target=/opt/gosstrak gosstrak:latest
~/docker-gosstrak-demo % docker run --name golemu --mount type=bind,source=<path_to_project>/docker-gosstrak-demo/data/golemu,target=/opt/golemu golemu:latest
MIT
Iori Mizutani (a.k.a. iomz)