Carlos Coutinho Victor Anaya Francisco Fraile

Basics

The IO Toolkit is a set of utilities for generating IO Components (Device Drivers and API Connectors) for on-premises access to devices and local (legacy) services.
The mission of the IO Toolkit is to accelerate the development of IO Components, providing resources to facilitate the access to those devices and APIs, while also facilitating the interaction with the rest of the vf-OS infrastructure. As such, it allows developers to build secure and controlled gateways (aka IO Components) between the factories and vf-OS. These gateways can later be used as part of the capability set of vApps. Through interaction with the vf-OS marketplace, these tools can be shared, sold and obtained by the development community.

The IO Toolkit is based on Node.js and provides the required dependencies to:
- Interact with the vf-OS kernel:
- Connect to the required vf-OS kernel component services (Registration, security, logging, middleware, etc.)
- Implement the REST Services used by other components
- Interact with common manufacturing assets, both Software and physical devices
- Implement the inner logic of IO Component:
- Internal storage (eg key value pairs)
- Lifecycle management
- Manipulate raw sensor data (Edge processing)
- Generate the component metadata (eg Manifest file)

Additionally, the IO Toolkit provides skeleton code samples that developers can use to quickly build new Device Drivers and API Connector Components.

IO Toolkit core concepts

The IO Toolkit is build on top of Loopback, which is a highly-extensible and open-source Node.js framework to create REST APIs and provides integrated build tools that can be used for developing the IO Toolkit as well as for developing new IO Components using the IO Toolkit resources.

Basically, Loopback makes it easy to define data models, implement access control, connect to multiple data sources, write business logic in Node.js and glue on top of existing services and data, so it provides an optimal development environment in the context of vf-OS I/O.

The following diagram illustrates how some of the available Loopback build components could be used in the context of vf-OS.

alt text

Loopback provides integration with Swagger, which defines a standard interface description for REST APIs, allowing both humans and computers to discover and understand the capabilities of a service. The Loopback Swagger:generator allows to generate the skeleton of a LoopBack application from a Swagger specification, generating the models, scaffolding the REST API endpoints with the CRUD capabilities expressed in the Swagger RESTful contract and even providing an API Eplorer (UI that can be used to test the application). Developers need only to implement the corresponding functions according to the inner logic of the component and modify the generated code to call the corresponding functions in the event loopback.

The development of the IO Toolkit with Loopback consists basically in developing:
- The Node.js modules implementing the functionality of the inner components of the IO Component.
- The vf-OS IO Component middleware that implements the interconnections between the different modules on top of the generated loopback code
This way IO Component developers can focus on the inner logic and bottom interface implementations of the component.
Some of the inner components implement connections to the vf-OS Kernel REST services APIs. In this sense, the Swagger Connector allows LoopBack applications to interact with other REST APIs described by the OpenAPI (Swagger) specification. This facilitates the integration of the different platform components based only on the defined REST APIs: If the different vf-OS kernel component Swagger descriptons are available, it is possible to implement the clients using the Swagger connectors. In the development of the IO Toolkit, developers can use this connector to implement the vf-OS layer that interconnects the different vf-OS Components.

This allows to build Loopback skeletons for Device Drivers and APIs from the defined technical specifications to be used by IO Component developers, who need only to implement the inner logic and bottom interfaces of the component using the provided dependencies. There are additional Loopback build resources available in this process. For instance, the Loopback connector nodes allows to integrate Loopback and Node_Red, so that developers can use the Node-Red environment to implement the inner logic and bottom interfaces. https://opensourceprojects.eu/p/vfos/iotoolkit/wiki/IO%20Toolklit/attachment/Architecture.png

Related links:
IO Toolkit REST API composition

Attachments
Architecture.png (62514 bytes)

Related

Post: Integration: IO Toolkit and storage