Depending on the needs regarding the deployment of the Context Broker Data Visualisation enabler, there are four different tutorials.
They are also divided between local environment and FIWARE lab (or Sandbox).
The first three tutorials are focused on a deployment in a local environment.
Depending on the needs of the tools to be deployed, it should be better to select the most adequate tutorial.
They are ordered by the number of tools that are deployed, being the third tutorial the most complete.
As a pre-requisite, Docker needs to have been installed before starting with any of the tutorials in a local environment.
This option is recommended for those users who want to deploy the enabler in a local environment and already have a Context Broker instance or want to use an external Context Broker instance (possibly, already running in a server). In this case, the user would only need to deploy the enabler.
The steps for the deployment are the following:
-
Check Docker is running on the computer.
-
Open a terminal and go to the folder: workspace/tutorials/enabler
cd workspace/tutorials/enabler
-
In case of Windows run the script called deploy_windows.bat:
deploy_windows.bat
In case of Linux run the script called deploy_linux.sh
sh deploy_linux.sh
-
Now, the needed images are being downloaded from DockerHub and they will be started after the download.
-
Execute the following command in the terminal:
docker ps
-
There should be two new containers in Docker:
-
Go to the web browser and try to access the enabler using the following URL:
localhost
If the deployment was done succesfully, you should see the enabler.
This second option is recommended for those users who want to deploy the enabler in a local environment, but do not have any Context Broker instance for testing. they are interested in real-time data and need a Context Broker instance, but are not interested in historical data.
The steps for the deployment are the following:
-
Check Docker is running on the computer.
-
Open a terminal and go to the folder: workspace/tutorials/enabler_orion
cd workspace/tutorials/enabler_orion
-
In case of Windows run the script called deploy_windows.bat:
deploy_windows.bat
In case of Linux run the script called deploy_linux.sh
sh deploy_linux.sh
-
Now, the needed images are being downloaded from DockerHub and they will be started after the download.
-
Execute the following command in the terminal:
docker ps
-
There should be four new containers in Docker:
- cbenabler
- cbenabler-server
- fiware-orion
- db-mongo
Illustration 2. Docker images of Tutorial 2
-
Go to the web browser and try to access to the enabler in the following URL:
localhost
-
If the deployment was done successfully, the Context Broker must be able to be connected in the Configuration page:
This third option is recommended for those users who want to deploy the enabler in a local environment and are interested in both real-time data (Context Broker) and historical data (Cygnus and STH-Comet).
This options is the most complete tutorial for local environments. It will guide the user in how to deploy the complete architecture of the enabler:
Illustration 4. Architecture of the enabler
More information related with the architecture can be found here.
The steps for the deployment are the following:
-
Check Docker is running on the computer.
-
Open a terminal and go to the folder: workspace/tutorials/enabler_orion_cygnus_sth
cd workspace/tutorials/enabler_orion_cygnus_sth
-
In case of Windows run the script called deploy_windows.bat:
deploy_windows.bat
In case of Linux run the script called deploy_linux.sh
sh deploy_linux.sh
-
Now, the needed images are being downloaded from DockerHub and they will be started after the download.
-
Execute the following command in the terminal:
docker ps
-
There should be six new containers in Docker:
- cbenabler
- cbenabler-server
- fiware-orion
- fiware-cygnus
- fiware-sth-comet
- db-mongo
Illustration 5. Docker images of Tutorial 3
-
Go to the web browser and try to access to the enabler in the following URL:
localhost
-
If the deployment was done successfully, the Context Broker, Cygnus and STH-Comet must be able to be connected in the Configuration page:
It is possible to generate test data to fill the Context Broker. For this, it will be necessary to download the script that is in this link of the GitHub repository, and it will need to be executed using python3.
-
To create the test data, the following python command must be executed using the create-data.py file:
python3 create-data.py
-
By default, two new test registries will be inserted in the Context Broker every hour. The available services to retreive the information from the Context Broker are:
- testparking
- testenvironment
As a result, the execution of the Python script will generate test data into the Context Broker, and it will be available in the enabler.
Tutorials 2 (Enabler + Context Broker) and 3 (complete architecture) generate new Docker images in a local environment. The access URLs for the tools are:
- fiware-orion:1026
- fiware-cygnus:5080
- fiware-sth-comet:8666
However, if the tools have been deployed separately (using other FIWARE tutorials), the following URLs should be used instead:
- localhost:1026
- localhost:5080
- localhost:8666
This tutorial is focused on the deployment of the enabler in the FIWARE lab (or Sandbox).
As a pre-requisite, a FIWARE lab account is needed in order to follow this tutorial. In order to register, access to this link and click on the Request Community Account button.
After the registration, the deployment can be carried out following Tutorial 4.
The deployment of the enabler in the FIWARE lab (or Sandbox) needs to set-up different configurations to achieve a succesful behaviour of the enabler and the rest of the tools. Those configurations are detailed as follows.
First of all, it is necessary to configure the Access & Security tab to enable access to the desired instances.
The steps to complete this are:
-
Go to the first tab of the Access & Security menu called Security groups and define a new security groups:
-
Click on Create security Group and define the name and description of the security group.
- Name: cbenabler_security_group
- Description: Context Broker Data Visualisation Enabler Security Group
-
Once the security group has been created, click on the button Manage rules, in order to enable the needed ports to establish communication with the enabler:
-
-
Return to the Access & Security menu and change to the tab called Floating IPs.
Once the configuration of the previous section has been completed and the new IP is available, the following step is to deploy the enabler.
For this purpose, there is a public Sandbox image that contains everything needed to deploy the enabler application.
An instance of the needed image can be created from the Images menu:
-
Look for the image called cb_data_visualisation_enabler in the public section.
-
Select the image an click on the Launch Instance button.
-
Fill in the following information:
-
Details:
- Availability Zone: assign a zone to the instance.
- Instance name: assign a name to the instance.
- Flavor: At least one medium-type image will be required, but it is possible to assign large or short-large types.
- Instance Count: Number of instances to be deployed, normally 1.
- Instance Boot Source: Select the option Boot from image.
- Image Name: Select the option cb_data_visualisation_enabler_dev.
-
Access & Security:
- Select the security group cbenabler_security_group (created in the previous section).
-
Networking:
- The node-int-net-01 network should be in the selected networks section.
-
-
Launch the instance. It must be visible with spawning status in the Instances menu.
-
Once the instance is running (after waiting some minutes), it will take about 5 more minutes to automatically download the latest available version of the Context Broker Data Visualisation Enabler from DockerHub and deploy it.
At this point, the Context Broker Data Visualisation Enabler is deployed, but it is not accessible from the browser because it doesn't have an associated Floating IP (public IP) yet.
-
Go to the Instances menu and move the drop-down (bottom scroll bar) to the right.
-
Search the launched instance with running status, select it and click on Associate Floating IP.
illustration 4. Associate floating IP to the image
-
Associate the IP created in the Configuring the enabler section.
-
After this configuration, the enabler is ready to be used by accessing the floating IP in a web browser.
After completing the previous sections for the deployment of the enabler in the FIWARE lab, the tool will be available for use. However, the Enabler needs to be integrated with different tools to consume data. As an optional configuration, there is available a second public image in the FIWARE lab, which contains the Enabler's optional set of tools.
This image is available in the Images menu, and its name is cb_data_visualisation_enabler_tools. Concretely, it contains:
- Orion Context Broker: exposed in port 1026
- Cygnus: exposed in port 5080
- STH Commet: exposed in port 8666
- MongoDB: it is not exposed in any port, Internally uses port 27017.
In order to instantiate the image, a new security group must be configured in the Access & Security menu:
-
Click on Create security Group and define the name and description of the security group:
-
Name: cbenabler_tools_security_group
-
Description: Context Broker Data Visualisation Enabler Tools Security Group
-
Once the security group has been created, click on the button Manage rules in order to enable the needed ports to establish communication. Add the following rules:
-
Add rule:
- Rule: Custom TCP Rule
- Direction: Ingress
- Open Port: Port
- Port: 1026
- Remote: CIDR
- CIDR: 0.0.0.0/0
-
Add rule:
- Rule: Custom TCP Rule
- Direction: Ingress
- Open Port: Port
- Port: 5051
- Remote: CIDR
- CIDR: 0.0.0.0/0
-
Add rule:
- Rule: Custom TCP Rule
- Direction: Ingress
- Open Port: Port
- Port: 5080
- Remote: CIDR
- CIDR: 0.0.0.0/0
-
Add rule:
- Rule: Custom TCP Rule
- Direction: Ingress
- Open Port: Port
- Port: 8666
- Remote: CIDR
- CIDR: 0.0.0.0/0
-
-
-
At this point, the image must be launched in the Images menu.
-
Look for the image cb_data_visualisation_enabler_tools in the public section.
-
Select the image and click on the Launch Instance button.
-
Fill in the following information:
- Details:
- Availability Zone: assigns a zone to the instance.
- Instance name: assigns a name to the instance.
- Flavor: At least one medium-type image will be required, but it is possible to assign large or short-large types.
- Instance Count: Number of instances to be deployed, normally 1.
- Instance Boot Source: Select the option Boot from image.
- Image Name: Select the option cb_data_visualisation_enabler_tools.
- Access & Security:
- Select the security group cbenabler_tools_security_group.
- Networking:
- The node-int-net-01 network should be in the Selected networks section.
- Post-creation:
- Normally, this section should be empty if the purpose is that there is no information in the context borker. But the development team has prepared a python script in case the user wants to fill the context broker with test data. The documentation can be found at the following link: generating test data
- Details:
-
The launched instance will be visible with spawning status in the Instances menu.
-
Once the instance is running (after waiting some minutes), it will take about 5 more minutes to download the latest available version of the tools from DockerHub and deploy them.
-
In this case, it will not be necessary to assign a Floating IP, since the instances have an internal IP that allows communication between them.
Illustration 5. Enabler tools' internal IP
-
After completing the previous steps, the communication between the enabler and the tools is achieved:
Illustration 6. Communication between the enabler and the tools
The following section will detail how to generate test data for the enabler tools.
It is possible to launch scripts together with one instance in the FIWARE lab during the launch process. Concretely, in the post-creation tab.
A Python3 script has been created with the objective of filling the Context Broker and the historical data tools with test data, which is fake data.
First of all, it is necessary to download the script. It is available on the GitHub repository of the project, and also on this link.
After that, the following steps need to be followed:
-
Configure the instance for the Enabler tools, as explaned here.
-
In the post-creation tab, there are two options to execute the script:
- The first option:
- Customization Script Source:
- Select Direct Input.
- Script data:
- Copy the content of the Python script.
- Customization Script Source:
- The second option:
- Customization Script Source:
- Select file.
- Script File
- Upload the file of the Python script.
- Customization Script Source:
Illustration 7. Generating test data
- The first option:
-
The previous configuration will execute the Python script together with the instance of the Enabler tools.
The Context Broker will receive two new test registries from the script every hour.
The services to be used for this testing data are:
- testparking
- testenvironment