If you’ve looked at any of the videos, tutorials, etc. I put together for Myriad, you’ll eventually find something about building distributed applications through Akka’s remoting feature. It’s pretty straightforward to use in Myriad Desktop – just update an address and you’re good to go – but what actually lives on the remote system accepting these calls anyway?

So with that in mind, I’ve put together a little project to show the “what.” ActorPool reads a configuration file, starts up one stage in a Myriad processing pipeline, and waits for incoming data. The idea is that you’d have it start up automatically with the remote system and it’d be available to provide a little extra horsepower when processing data in a Myriad application. In the initial commit I’ve included support for the two stages in Myriad that tend to require the most horsepower – the sliding window stage and the actual Region Of Interest (ROI) detection stage. Also included is a Passive-Aggressive model trained to detect damage in C-scans, bundled with Myriad’s new Canny edge detection algorithm.

To use it, just edit application.conf to your liking; in particular choose what stage to run in the actorpool config block. Basic usage is java -jar /path/to/jar /path/to/application.conf e.g. java -jar target/actorpool-1.0-SNAPSHOT-allinone.jar application.conf. If all goes to plan, ActorPool will log a message with its Myriad address:

You’ll need Java 8 (Oracle or OpenJDK), Apache Maven, and (optionally) OpenCL SDKs if you’d like to use the experimental support for GPUs. Documentation is also available, as well as code samples and videos.

As previously promised I’ve updated the Myriad samples with a concurrent demo that more or less follows the same workflow as the 60 day technical review video. Included in the project for your convenience is a pre-trained machine learning model that’s learned to recognize indications of structural damage in C-scan maps. Although I originally trained it on ultrasonic sensor data, it did show some promise when I tried it out with microwave and X-ray data.

You’d most likely want to train it a bit more on data representative of your inspection to get the best results.

It’s a little amazing to me that ~250 lines of Java gets you a concurrent fault-tolerant damage detection app, but that’s very much courtesy the very excellent Akka framework. Well worth a look for your next project!

Just in case anyone else has had any trouble tracking down details and documentation for Cisco Configuration Engine and its support for Velocity dynamic templates, here’s a quick rundown of what I’ve been able to glean so far.

If you’d rather use Velocity templates instead of CCE’s format, it’s version 1.4.

Velocity calls to the internal LDAP server are through the $!{dsobj.getValue("name of attribute")} as demonstrated in this post.

Both the “legacy” (.cfgtpl) and Velocity templates can make calls to external Javascript courtesy the standard Java 6 scripting engine.

The legacy directive is #call /path/to/script.js .

I *think* the Velocity directive is $!{ds("/path/to/script.js", "arg1,arg2,arg3")}, where the first argument is (obviously) the full path to the script and the second is a comma-delimited list of arguments for the script. The second argument is split on commas and a global object arguments is available in the engine’s runtime environment.