The Containers

What is an IOhub container

A container is the smallest piece of software in the IOhubTM Application that is designed to execute a specific tasks. The container is developed with Docker. You can combine two or more IOhubTM containers to execute more complex tasks. This combination of containers is defined as an IOhubTM application.

IOhubTM has a Catalog of containers specifically designed for the industrial machine applications. This Catalog includes a continuously growing list of ready-to-use containers.

Hundreds of containers are also available on the Docker hub web site from which you can select and deploy to build your applications.

Add containers to an application

Containers can be added in different ways:

  • from IOhubTM Catalog
  • from Docker Registry
  • from a Template

Add containers from IOhub Catalog

IOhubTM Catalog is the simplest and fastest way to build your IOhubTM application. IOhubTM Catalog includes several out-of-the-box Docker images that have been already configured to work together.

The IOhubTM catalog was designed to give the maximum result with minimum effort.

You can select a container from the IOhubTM catalog from the application management interface (IOhubTM/EZ BoxTM name/Manage application name):

  1. Click Choose from Catalog button.
  2. Click +Add button to select and add the container you need.
  3. Repeat the step above to add other Containers into your Application.
<iohub></iohub> choose from catalog
<iohub></iohub> add mqtt

Please note that any time you add or remove a container, you'll be required to confirm the operation.

All added containers will be shown in the Containers list section like into the example below:

<iohub></iohub> container list

Please check the "Configure and customize the containers" section if you need to manage the containers.

Add containers form a Docker registry

IOhubTM allows users to add Docker containers from the Docker Hub registry or any other public Docker registry.

Docker Hub is the world’s largest online repository of container images.

Docker images may be public or private.

Public vs Private containers

There are no technical differences between public or private containers.

Public Docker containers are available to everyone from the Docker Hub registry or any other public Docker registry and anyone can use them in IOhubTM.

Private Docker containers let you keep container images private, either to your account or within an organization or team. Private Docker containers require a User ID and a token to be accessed and used.

IOhubTM allows you to configure the User ID and token to deploy private containers in IOhubTM .

Please visit Docker Hub Repositories documentation for further details.

Please visit Docker Hub website for further information and Docker image availability.

In order to add a container in an IOhubTM application from Docker Hub, you need to follow the instructions below:

  1. Type the Container name. (Required)
  2. Type the Docker Image name (Required)
  3. Click Docker image is private check box if containers require authentication and add the proper additional information.
  4. Click Add Container button to add the container into the Application.
<iohub></iohub> add container

Names must be lowercase and cannot include spaces. Names cannot start with "ezvpn-" prefix. "ezvpn-" prefix is reserved for internal use only.

Below are the names of the Docker images you'll find into the Docker registry website.
Docker image names allow tag usage. Some example includes:

hello-world

hello-world:latest

hello-world:latest:linux

Docker authentication information is provided directly from Docker Hub. You can create the token for your private image when accessing the Docker Hub profile security section of your account.

Please note that you'll be able to customize the container as soon as it has been added.

Configure and customize the containers

In order to facilitate IOhubTM usage, all IOhubTM catalog containers have already been preconfigured to facilitate the implementation and the interaction with each other.

Some containers may require your attention in order to configure or customize the parameters or variables necessary to adapt the containers to your environment.

Any containers you add into an application can be customized and configured to fit your needs.

Changes to the IOhubTM catalog's preconfigured containers may break the communications or interactions with other pre-configured IOhubTM catalog containers. Please check the documentation of each IOhubTM catalog container before applying any changes to the default settings.

To configure or customize containers please access the Container Management page (IOhubTM/EZ BoxTM name/Manage Application name):

  1. Click Manage button to access the Container Management interface.
<iohub></iohub> container list manage

Click on containers details to review the container configuration.

<iohub></iohub> container details

Within the containers management page you can customize and configure the following parameters (IOhubTM/EZ BoxTM name/Application name/Manage container name):

Please note that some of the above parameters may have already been configured if the container was added from IOhubTM Catalog.

Environment Variables

Environment variables is the common way to pass information to a Docker container. Docker containers within the IOhubTM catalog have already been configured to interact with other containers within the catalog. All you need to do is to add the additional variable and value to set the container for your needs.

Please refer to the IOhubTM Catalog containers information page for details about the variables. You may also review the documentation on the Docker Hub website for further information on specific Docker containers.

In order to add an Environment Variable:

  1. Type the variable name.
  2. Type the value for the variable.
  3. Select the validation language for the payload.
  4. Click Validate as button to validate the content of the payload.
  5. Click Add Variable button to add the variable.

Please note that steps 3 and 4 are optional and recommended for payload has been written with one of the following languages: JSON, XML, YAML, EXCH.

<iohub></iohub> add variable
  1. Click Remove button to delete the variable.
<iohub></iohub> remove variable

To update a variable value, add a new variable with the same name and a new value. Variables with the same name are overwritten.

Port Mappings

Containers' networks are isolated by design and cannot be reached from other containers, applications or external users. Port mapping allows a container to be contacted from other applications or external users.

To add a port mapping:

  1. In the External port field type the port number that will be used to contact the container.
  2. In the internal port type, type the port number used by the container.
  3. Click Add Mappingbutton to create the port mapping.
<iohub></iohub> add mapping

In Port mappings, a network port forwarding method is applied automatically.

Adding the same external port will update port mapping entry.

Please note that ports from 12300 to 13299 are reserved for IOhubTM system applications.

To remove a port mapping entry:

  1. Click Remove button.
<iohub></iohub> remove mapping

Exposed Ports

Exposed ports are used to provide network communication between containers within the same application. A container that needs to be contacted by another container (within the same application) will need to be exposed to a communication port.

To configure exposed ports:

  1. Type the port number you need to expose.
  2. Click Add Expose button.
<iohub></iohub> add expose
IOhubTM catalog containers may already be configured with exposed ports. In order to ensure the interoperability with the other IOhubTM catalog's containers, we do not recommend changing the pre-configured exposed ports. Please check the related Container documentation for further details.

Please note that ports from 12300 to 13299 are reserved for IOhubTM internal system applications.

To remove an exposed port:

  1. Click the Remove button that belongs to the port you want to remove.
<iohub></iohub> remove expose

USB Devices

In the Devices section you can enable the available USB ports to let the container use an external device such as a USB-to-Serial adapter (suitable for example for RS485, RS422, RS232 and other connection types).

When a compatible USB device is connected, the container can use the USB interface through a standard device driver, mapped from the docker host to the container.

The number of available USB ports may vary and it depends on the EZ BoxTM device you are using.

IOhubTM automatically shows the exact number of available ports of the device you are configuring.

At the moment we support only USB-to-serial devices. The Prolific, FTDI and CP210X serial-to-USB chipset are tested and fully supported. Other chipset might work as well but they are untested at the moment.

Each USB device gets mapped in the container with a name depending on the physical port it is connected to. You can therefore configure your container without worring about the order you plug the devices into the EZ BoxTM.

For example, the serial adapters connected to the physical port #2, will provide a driver, inside the container, with name /dev/ttyUSB2.

If you need to know the exact number of available ports has your device and what name has each physical port, please check the technical detail of your EZ BoxTM device into the IOconTM hardware section

To enable a port:

  1. Tick all the /dev/ttyUSB<n> ports you need to enable.
  2. Click the Update Devices button to save the devices configuration.
<iohub></iohub> add device serial RTU RS485

To disable a port:

  1. Untick all the /dev/ttyUSB<n> ports you need to disable.
  2. Click the Update Devices button to save the devices configuration.
<iohub></iohub> remove device serial RTU RS485

Volumes

Volumes section defines data storage volumes for the container. Volumes are useful to store continuous information within the IOhubTM device. A device power cycle does not remove content saved in the volumes. Volumes size is dynamic and depends on the IOhubTM device storage.

For your convenience, the volume section of IOhubTM catalog containers have been already configured where necessary.

IOhubTM allow different type of volumes:
  1. Volumes.

    This is the standard volume. Access to this type of volume is allowed on the container only. Other containers cannot access this volume. Up to 5 standard Volumes can be configured for each container.

  2. Application share.

    Access to this volume is allowed to all containers within the same application.

  3. Global share.

    Access to this volume is allowed to all applications within the same device.

To configure a volume for the container:

  1. Click the Volume drop down menu and select the volume type you need.
  2. Type the Mount Point path for the container.
  3. Click Add Mount Point button to add the volume.
<iohub></iohub> add mount point

Mount Point path may vary from container to container. Please refer to the Docker container documentation for further details.

To remove a volume:

  1. Click Remove button of the Mounting point.
<iohub></iohub> remove mount point

Please note that removing a volume will delete any data in the volume. Data cannot be recovered.

Dependencies

Dependencies section defines startup relations among containers. When a container has a dependency it will be started when the dependent container has been started. A container may have more than one dependency. Dependencies guarantee the container will be executed when its dependent has been started.

To create a dependency:

  1. Click Depends On drop down menu and select the dependent container.
  2. Click Add Dependency button to create the dependency.
<iohub></iohub> add dependency

Repeat the above steps to add more dependencies.

To remove a dependency:

  1. Click the Remove button that belongs to the dependency.
<iohub></iohub> remove dependency