Create a weeve Module

What are weeve Modules?

A weeve module is a single unit in an edge application that is created on weeve platform. The concept of a module is implemented directly on the concept of a container (i.e. Docker). A module is thus a parameterizable container with the appropriate meta-data sufficient for running it in the weeve platform.
The weeve Manager presents all available modules. After selecting, each module is further configurable, as displayed in the figure below.
Module Manager
By placing multiple modules on the canvas, and by drawing a connecting line between connection nodes on each module, an edge application can be designed.
Each module is responsible for a single step in the edge application's data service. For instance, the MQTT Ingress module is responsible for subscribing to MQTT topics and reading (input) data into an edge application. Comparison Filter is a module filtering data based on some query. Slack Alert module sends notifications to a selected Slack channel.
In order to be successfully implemented into a weeve Edge Application, each module should consider the following three specifications that allow it to communicate within the application:
  1. 1.
    Ingress communication
    • Allows a module to receive input data that might be passed directly from IoT device sensors
    • Allows a module to receive input data from a previous module in the data service
  2. 2.
    • Data are processed to produce a desired output and prepare it for further passing to the next part of the data pipeline
    • Processing the data is left to the module designer, with parameters exposed through the ‘properties’ pane for that module
  3. 3.
    Egress communication
    • It allows the module to pass its output to the next module or directly to a data partner
The interaction between modules is implemented with a REST API, and could be visualized as follows:
Modules Communication

Module creation

In order to better understand the process of creating a deployable module, we decided to provide this brief overview of steps that module developer should undertake. Of course, it is a flexible approach, so it can be adjusted to your company’s engineering practices.
Work Flow
When creating a module, some steps must be handled by a module developer, these are marked with yellow in the above module lifecycle diagram, and the other will be handled by weeve as marked with blue. Let’s look closer at what exactly should be done by a module developer:
  1. 1.
    Create an image with one of our Boilerplates - depending on the type of your module (input, process, output), select the right Boilerplate and implement your code.
  2. 2.
    Create a module YAML file - if you are happy with your module performance on your test cases, it is time to implement your module YAML file. It is used for data-serialization and module configuration. The metadata for a module is represented in YAML or JSON format. After registration of the module into the platform, the properties pane will be enabled for parameterization by the user.
Module YAML
  1. 1.
    Containerize module and deploy to repository - next step requires publishing your module to a repository to allow the server to pull your modules and use them in the edge application. You can choose any container framework and registry compatible with the Docker ecosystem. More details on publishing your modules to container repository you can find here.
  2. 2.
    Create an icon for the Modules - Each module is also represented with an icon. This icon can be an abstract representation or a reference to the brand or company this module represent. Find a more detailed description here.
  3. 3.
    Request registration into the weeve platform - for now we still work on automating this process, but you need to contact us with your Module YAML file and a link to its container image repository. You will find all contact details on the bottom of the overview page
In the next chapters, you will find a "Hello weeve!" example for creating a module and a detailed description of each mentioned step.