Hornet is a nearline data processing engine written in Go. Its purpose is to provide rapid feedback about the content of data that is being produced by a triggered DAQ system such as the Tektronix RSA.
Hornet uses inotify to watch for filesystem changes on a specific directory. When a file close event is detected, it checks to see if the file should be processed (currently it simply checks if it is a MAT file such as those produced by the RSA), and if it does the file is scheduled for processing.
A simple FCFS scheduler is applied to incoming events. A group of goroutines is waiting for new filenames to be processed, and as they come in the first free goroutine takes the job of processing the data.
The worker simply invokes Katydid with a config file specified on the command line at runtime.
Hornet requires go version 1.1 or better. It's recommended that you setup your go workspace and GOPATH
environment (e.g.) in the standard way.
For use on systems where the standard go version is too old (e.g. Debian Wheezy),
the godeb
application is suggested. First, install the too-old version of golang
.
Then proceed to install godeb. When I (Noah) installed it on teselecta, I used the following sequence of commands:
> go get gopkg.in/niemeyer/godeb.v1/cmd/godeb
> sudo apt-get remove golang
> sudo $GOPATH/bin/godeb install
> sudo dpkg -i --force-overwrite go_[version]-godeb1_[system].deb
The second line removes the old version of go that I previously installed using the apt-get package manager. The third line gave me an error, so I used the fourth line to force the package manager to overwrite the golang package.
Aside from standard go libraries, several external packages are used, which you'll need to acquire:
> go get github.com/streadway/amqp
> go get github.com/ugorji/go/codec
> go get gopkg.in/fsnotify.v1
> go get github.com/op/go-logging
> go get github.com/kardianos/osext
> go get code.google.com/p/go-uuid/uuid
> go get github.com/spf13/viper
When using on a Windows system, Hornet requires the Microsoft File Checksum Integrity Verifier. Please make sure the install location is included in the Path
environment variable.
Hornet has been tested on Linux (Debian 8), Mac (OS X 10.10), and Windows (7).
Download hornet:
> go get -d github.com/project8/hornet
Add the -u flag to update hornet and its dependencies.
Update hornet's knowledge of its git commit and tag:
> cd $GOPATH/src/github.com/project8/hornet
> make remove_older_describe_go
There are two options for building hornet:
If you want to build an "official" copy that gets installed for general use:
> go install github.com/project8/hornet
The executable hornet
should now be in $GOPATH/bin
.
If you want to build a local copy for development purposes:
> go build -o run_hornet .
This will create the executable run_hornet
in the source directory. The name is different from hornet
since there's a subdirectory with that name.
examples/hornet_config.json
amqp.broker
(assuming either the sender or receiver are active), watcher.dir
(assuming the watcher is active), mover.dest-dir
, and shipper.dest-dir
. All of the directories used must exist.> hornet --config my_config.json
Unless otherwise noted, these are config file values to set.
hornet --config my_config.json [files to be processed; wildcards allowed]
scheduler.n-nearline-workers
amqp.receiver
and amqp.sender
set to false
. Also, if hash.required
is true
, then make sure hash.send-to
is ""
(empty string)watcher.active
set to true
or false
, respectivelywatcher.dir
classifier.types.[whatever]
mover.dest-dir
shipper.dest-dir
In addition to the instructions which follow for a "conventional" installation, it is also possible to run hornet using docker. This feature is still in development, but should be completely independent of platform. In particular, the linux implementation of hornet should be usable on windows using this virtualization.
git clone git@github.com:project8/hornet
docker build .
. You probably will want to include a name and tag for your image docker build -t hornet_default:latest .
and possibly further options which I haven't learned about yet.I'll assume you've built the image above (ie with name hornet_default and tag latest).
You can, in principle, simply spin up the container and have hornet running in a background container docker -d hornet:latest
.
You should read over the docker documentation for complete details, but I'll outline a few important options quickly:
-it
the container runs interactively in a sudo terminal (ie you'll be attached to hornet)--rm
the container will be deleted once it exits--name <name>
, you can assign a name to the container for reference laterdocker exec -it <name> bash
, you will attach to a terminal in your running container (without disrupting hornet)By default, when you spin up the container it runs a basic (an not very useful) instance of hornet. This is to keep the container image portable, but means that it doesn't know anything about the host system or other resources available. In all cases, you can expand features using docker volumes.
-v </path/on/host/to/config.json>:/go/hornet_config.json
argument.-v /home/<user>/.project8_authentications.json:/root/.project8_authentications.json
(or whatever non-standard path options you may want to use).-v
to mount whatever directories you want to watch and/or write to. If you forget to do this, the targets will be within the containers filesystem (and probably not useful). If you don't use your own configuration file, you would mount over /data/[hot|warm|cold] with whatever local directories you like.There are several important things left to test/develop that I'll caution you about here: