© 2018-19 Nubix, Inc. |  All rights reserved  |  Privacy Policy

  • LinkedIn - White Circle
  • Twitter - White Circle
  • YouTube - White Circle

Orchestration Hub

The Nubix Orchestration Hub is the central home for application development and deployment in Nubix. 

 

The Orchestration Hub allows developers to:

 

  • Develop Pipelines

  • Create and Deploy Containers

  • Administer Deployments

Pipelines are the key concept for developers and are used to collect, analyze, and manage data. Pipelines are then packaged into containers for deployment.

Pipelines and Containers

Pipelines are created in the Nubix Orchestration Hub using a drag-and-drop interface. Components are selected from the palette and a sequence for a data flow is created. The diagram below shows a simple pipeline.

In the above example, in the first stage of the pipeline data is collected from an ADXL345 accelerometer. The second stage is a custom code block that performs a shock detection algorithm.  In the third and final stage, the GPIO Write capability is used to turn on an LED based on the value computed in the Shock Detection Stage.

In the Orchestration Hub, the source code for each stage is available by selecting the box for that stage. For example, here's what the code for a simple shock detection function would look like:

function M.execute(stageContext, metricsBatch)
  metricsBatch:foreach(function(measurement)

    local x = measurement:field('x')
    local y = measurement:field('y')
    local z = measurement:field('z')
    --print('** shock measurement: ', tostring(measurement))

    local magnitude = math.sqrt(x^2 + (y-1)^2 + (z-0)^2)
    --print('** mag: ', magnitude)
    
    if magnitude > 1 then
      measurement:field('shock', 'hard')
    elseif magnitude > .5 then
      measurement:field('shock', 'medium')
    elseif magnitude > .08 then
      measurement:field('shock', 'soft')
    else
      measurement:field('shock', 'none')
    end
    --print('** shock: ', tostring(measurement:field('shock')) )
  end)
  return metricsBatch
end

The pipeline, with its custom code for shock detection, would then be packaged as a container for deployment.  Visit the Nubix DevCenter to learn more about building and deploying containers.